ExpenseManagement.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055
  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. <kt-common-table
  65. :operationWidth="operationWidth"
  66. class="ktTable"
  67. permsEdit="sys:agent:view"
  68. ref="dataTable"
  69. :data="pageResult"
  70. :columns="columns"
  71. :showBatchDelete="false"
  72. :showOperation="true"
  73. editButtonName="修改"
  74. :button3Name="button3Name"
  75. :button2Name="button2Name"
  76. :button1Name="button1Name"
  77. button2Background="#92D050"
  78. button3Background="#f56c6c"
  79. button1Icon="el-icon-s-finance"
  80. button2Icon="el-icon-s-ticket"
  81. button3Icon="fa fa-trash"
  82. @handleButton3="handleTableDelete"
  83. @handleButton2="handleTableIncome"
  84. @handleButton1="handleTableExpend"
  85. @findPage="findPage"
  86. @handleEdit="handleTableEdit"
  87. :isshowpagination="true"
  88. ></kt-common-table>
  89. <!-- 新增修改弹框 -->
  90. <expense-component
  91. ref="expenseComponent"
  92. :formData="formData"
  93. :formDataId="formDataId"
  94. :title="title"
  95. :dialogFormVisible="dialogFormVisible"
  96. @resetForm="resetForm"
  97. @submitForm="submitForm"
  98. @setDateInterval="setDateInterval"
  99. @outChange="outChange"
  100. ></expense-component>
  101. <!-- 支出弹框 -->
  102. <el-dialog
  103. class="dialog expendDialog"
  104. title="支出信息"
  105. :close-on-click-modal="false"
  106. :before-close="expendResetForm"
  107. :visible.sync="expendDialogVisible"
  108. width="60%"
  109. >
  110. <!-- 支出表格 -->
  111. <kt-common-table
  112. :operationWidth="130"
  113. class="ktTable expendTable"
  114. ref="expendTable"
  115. :data="expendPageResult"
  116. :columns="expendColumns"
  117. :showBatchDelete="false"
  118. :showOperation="true"
  119. :button1Name="expendButton1Name"
  120. button2Background="#92D050"
  121. button3Background="#f56c6c"
  122. button1Icon="el-icon-s-finance"
  123. @handleButton1="handleTableConfirm"
  124. @findPage="getExpendData"
  125. :isshowpagination="true"
  126. ></kt-common-table>
  127. </el-dialog>
  128. <!-- 收入弹框 -->
  129. <el-dialog
  130. class="dialog expendDialog"
  131. title="收入信息"
  132. :close-on-click-modal="false"
  133. :before-close="incomeResetForm"
  134. :visible.sync="incomeDialogVisible"
  135. width="60%"
  136. >
  137. <el-form
  138. :model="inComeFormData"
  139. :rules="inComeFormRules"
  140. ref="inComeFormData"
  141. label-width="130px"
  142. size="small"
  143. class="inComeForm"
  144. >
  145. <el-row>
  146. <el-col :span="12">
  147. <el-form-item label="转账方" prop="company">
  148. <el-select
  149. v-model="inComeFormData.company"
  150. filterable
  151. placeholder=""
  152. @change="companyChange"
  153. >
  154. <el-option
  155. v-for="item in collectionData"
  156. :key="item.accountId"
  157. :label="item.name"
  158. :value="item.nameValue"
  159. >
  160. </el-option>
  161. </el-select>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="12">
  165. <el-form-item label="收款方" prop="collectionMessage">
  166. <el-input
  167. disabled
  168. v-model="inComeFormData.collectionMessage"
  169. autocomplete="off"
  170. ></el-input>
  171. </el-form-item>
  172. </el-col>
  173. </el-row>
  174. <el-row>
  175. <el-col :span="12">
  176. <el-form-item label="金额" prop="outerFlag">
  177. <el-input-number
  178. v-model="inComeFormData.applyAmount"
  179. :min="0"
  180. :precision="2"
  181. @blur="chageAppl"
  182. :max="99999999999999999"
  183. label=""
  184. ></el-input-number>
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="12">
  188. <el-form-item label="大写金额" prop="bigApplyAmount">
  189. <el-input
  190. v-model="inComeFormData.bigApplyAmount"
  191. disabled
  192. autocomplete="off"
  193. ></el-input>
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. <el-row class="collec">
  198. <el-col :span="24">
  199. <el-form-item label="资金流向" style="width: 100%">
  200. <el-input
  201. v-model="inComeFormData.company"
  202. disabled
  203. autocomplete="off"
  204. ></el-input>
  205. <i class="el-icon-right"></i>
  206. <el-input
  207. disabled
  208. v-model="inComeFormData.collectionMessage"
  209. autocomplete="off"
  210. ></el-input>
  211. </el-form-item>
  212. </el-col>
  213. <el-col :span="12"> </el-col>
  214. </el-row>
  215. <el-row>
  216. <el-col :span="12">
  217. <el-form-item label="备注" prop="remark">
  218. <el-select v-model="inComeFormData.remark" placeholder="">
  219. <el-option
  220. v-for="item in use_fundsData"
  221. :key="item.value"
  222. :label="item.label"
  223. :value="item.value"
  224. >
  225. </el-option>
  226. </el-select>
  227. </el-form-item>
  228. </el-col>
  229. </el-row>
  230. </el-form>
  231. <div slot="footer" class="dialog-footer">
  232. <el-button @click="incomeResetForm()" size="small">取 消</el-button>
  233. <el-button type="primary" @click="submitIncomeForm()" size="small"
  234. >确 定</el-button
  235. >
  236. </div>
  237. </el-dialog>
  238. </div>
  239. </template>
  240. <script>
  241. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  242. import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
  243. import ExpenseComponent from "./ExpenseComponent.vue"; //新增账户信息弹框
  244. import {toChies} from '../../../utils/moneyTransition';
  245. export default {
  246. name: "ExpenseManagement",
  247. components: { KtCommonTable, KtButton, ExpenseComponent },
  248. created() {
  249. this.business("account_quality"); //账户性质字典;
  250. this.business("use_funds"); //备注字典
  251. },
  252. mounted() {},
  253. data() {
  254. return {
  255. /**
  256. * 账户收入模块
  257. */
  258. incomeDialogVisible: false, //收入弹出框状态
  259. collectionData: [], //收入form表单 转账方下拉菜单数组
  260. use_fundsData: [], //收入form表单 备注字典数据
  261. inComeFormData: {
  262. //收入form表单
  263. collectionMessage: "", //收款名字
  264. fundFlow: "", //资金流向
  265. applyAmount: "", //金额
  266. bigApplyAmount: "", //大写金额
  267. remark: "", //备注
  268. company: "", //转账方
  269. },
  270. inComeFormRules: {
  271. //收入form表单规则
  272. company: [
  273. { required: true, message: "转账方不能为空", trigger: "change" },
  274. ],
  275. remark: [{ required: true, message: "请选择备注", trigger: "change" }],
  276. },
  277. enterAccountId: "", //点击收入按钮当条数据收入id
  278. /**
  279. * 账户模块
  280. */
  281. title: "新增账户信息",
  282. dialogFormVisible: false, //弹出框状态
  283. operationWidth: 200, //操作列宽度
  284. account_qualityData: [], //账户性质数据字典
  285. queryFrom: {//查询条件
  286. accountQuality: "", //账户性质查询
  287. bankCardNum: "", //银行卡号查询
  288. accountName: "", //户名查询
  289. },
  290. button1Name: "支出", //按钮内容
  291. button3Name: "删除",
  292. button2Name: "收入",
  293. expendButton1Name: "确认已转账",
  294. pageResult: {}, //表格内容分页参数
  295. formDataId: "", //数据Id
  296. pageRequest: {
  297. // 列表查询条件
  298. pageNo: 1,
  299. pageSize: 10,
  300. },
  301. // 数据列
  302. columns: [
  303. {
  304. prop: "outerFlagName",
  305. label: "账户类别",
  306. minWidth: 70,
  307. sortable: false,
  308. },
  309. {
  310. prop: "accountQualityName",
  311. label: "账户性质",
  312. minWidth: 70,
  313. sortable: false,
  314. },
  315. {
  316. prop: "yy",
  317. label: "营业性质",
  318. minWidth: 70,
  319. sortable: false,
  320. },
  321. {
  322. prop: "ss",
  323. label: "所属地",
  324. minWidth: 70,
  325. sortable: false,
  326. },
  327. {
  328. prop: "fr",
  329. label: "法人",
  330. minWidth: 70,
  331. sortable: false,
  332. },
  333. {
  334. prop: "clrq",
  335. label: "成立日期",
  336. minWidth: 70,
  337. sortable: false,
  338. },
  339. {
  340. prop: "accountName",
  341. label: "户名",
  342. minWidth: 160,
  343. sortable: false,
  344. },
  345. {
  346. prop: "bankCardNum",
  347. label: "银行卡号",
  348. minWidth: 170,
  349. sortable: false,
  350. },
  351. { prop: "bank", label: "开户行", minWidth: 100, sortable: false },
  352. {
  353. prop: "bankName",
  354. label: "开户行名称",
  355. minWidth: 190,
  356. sortable: false,
  357. },
  358. { prop: "bankNum", label: "开户行号", minWidth: 150, sortable: false },
  359. {
  360. prop: "balance",
  361. label: "余额",
  362. minWidth: 100,
  363. sortable: false,
  364. },
  365. {
  366. prop: "startCertExpirationDate",
  367. label: "证书有效开始日期",
  368. minWidth: 120,
  369. sortable: false,
  370. },
  371. {
  372. prop: "endCertExpirationDate",
  373. label: "证书有效结束日期",
  374. minWidth: 120,
  375. sortable: false,
  376. },
  377. {
  378. prop: "clearingProfit",
  379. label: "结算卡",
  380. minWidth: 120,
  381. sortable: false,
  382. },
  383. {
  384. prop: "dayStrokeNum",
  385. label: "单日转账笔数限制",
  386. minWidth: 120,
  387. sortable: false,
  388. },
  389. {
  390. prop: "exteriorProfit",
  391. label: "外部过账金额",
  392. minWidth: 120,
  393. sortable: false,
  394. },
  395. {
  396. prop: "fiscalProfit",
  397. label: "财税公司利润",
  398. minWidth: 120,
  399. sortable: false,
  400. },
  401. {
  402. prop: "insuranceProfit",
  403. label: "保险公司回款",
  404. minWidth: 120,
  405. sortable: false,
  406. },
  407. {
  408. prop: "otherProfit",
  409. label: "其他利润",
  410. minWidth: 120,
  411. sortable: false,
  412. },
  413. {
  414. prop: "parkProfit",
  415. label: "园区利润",
  416. minWidth: 120,
  417. sortable: false,
  418. },
  419. {
  420. prop: "priDayLines",
  421. label: "对私单日限额",
  422. minWidth: 120,
  423. sortable: false,
  424. },
  425. {
  426. prop: "priSingleLines",
  427. label: "对私单笔限额",
  428. minWidth: 120,
  429. sortable: false,
  430. },
  431. {
  432. prop: "priYearExcess",
  433. label: "对私年剩余额度",
  434. minWidth: 120,
  435. sortable: false,
  436. },
  437. {
  438. prop: "priYearLines",
  439. label: "对私年额度",
  440. minWidth: 120,
  441. sortable: false,
  442. },
  443. {
  444. prop: "pubDayLines",
  445. label: "对公单日限额",
  446. minWidth: 120,
  447. sortable: false,
  448. },
  449. {
  450. prop: "pubSingleLines",
  451. label: "对公单笔限额",
  452. minWidth: 120,
  453. sortable: false,
  454. },
  455. {
  456. prop: "pubYearExcess",
  457. label: "对公年剩余额度",
  458. minWidth: 120,
  459. sortable: false,
  460. },
  461. {
  462. prop: "pubYearLines",
  463. label: "对公年额度",
  464. minWidth: 120,
  465. sortable: false,
  466. },
  467. {
  468. prop: "tianqinProfit",
  469. label: "天勤利润",
  470. minWidth: 120,
  471. sortable: false,
  472. },
  473. ],
  474. formData: {//账户form表单
  475. outerFlag: "0", //账户类别
  476. accountName: "", //户名
  477. accountQuality: "", //账户性质
  478. bankCardNum: "", //银行卡号
  479. bank: "", //开户行
  480. bankName: "", //开户行名称
  481. bankNum: "", //开户行号
  482. certExpirationDate: "", //证书有效期
  483. clearingProfit: "", //结算卡
  484. dayStrokeNum: "", //单日转账笔数限制
  485. exteriorProfit: "", //外部过账金额
  486. fiscalProfit: "", //财税公司利润
  487. insuranceProfit: "", //保险公司回款
  488. otherProfit: "", //其他利润
  489. parkProfit: "", //园区利润
  490. priDayLines: "", //对私单日限额
  491. priSingleLines: "", //对私单笔限额
  492. priYearExcess: "", //对私年剩余额度
  493. priYearLines: "", //对私年额度
  494. pubDayLines: "", //对公单日限额
  495. pubSingleLines: "", //对公单笔限额
  496. pubYearExcess: "", //对公年剩余额度
  497. pubYearLines: "", //对公年额度
  498. tianqinProfit: "", //天勤利润
  499. },
  500. /**
  501. * 支出模块
  502. */
  503. expendColumns: [// 支出数据列
  504. {
  505. prop: "company",
  506. label: "转账方",
  507. minWidth: 160,
  508. sortable: false,
  509. },
  510. {
  511. prop: "collectionMessage",
  512. label: "收账方",
  513. minWidth: 80,
  514. sortable: false,
  515. },
  516. {
  517. prop: "applyAmount",
  518. label: "金额",
  519. minWidth: 150,
  520. sortable: false,
  521. },
  522. {
  523. prop: "applyTime",
  524. label: "转账日期",
  525. minWidth: 150,
  526. sortable: false,
  527. },
  528. {
  529. prop: "transferFlagName",
  530. label: "转账状态",
  531. minWidth: 150,
  532. sortable: false,
  533. },
  534. ],
  535. expendPageResult: {
  536. //支出表格参数
  537. pageNo: 1,
  538. pageSize: 10,
  539. },
  540. expendDialogVisible: false, //支出弹出框状态
  541. expendOutAccountId: "", //点击支出按钮当条数据支出id
  542. companyItem: {}, //选择单位整条数据
  543. };
  544. },
  545. watch: {
  546. expendDialogVisible(n) {
  547. if (n == false) {
  548. this.expendOutAccountId = "";
  549. }
  550. },
  551. //收入去除form表单信息
  552. incomeDialogVisible(n) {
  553. if (n == false) {
  554. this.enterAccountId = "";
  555. this.$refs.inComeFormData.clearValidate();
  556. this.inComeFormData = {
  557. //收入form数据
  558. collectionMessage: "", //收款名字
  559. fundFlow: "", //资金流向
  560. applyAmount: "", //金额
  561. bigApplyAmount: "", //大写金额
  562. remark: "", //备注
  563. company: "", //转账方
  564. };
  565. }
  566. },
  567. },
  568. methods: {
  569. //申请金额填写完成后
  570. chageAppl(e) {
  571. this.inComeFormData.bigApplyAmount = toChies(
  572. this.inComeFormData.applyAmount
  573. );
  574. },
  575. //获取所有外部账户信息
  576. getAllUser() {
  577. this.$api.expense.getAccountByAccountName().then((res) => {
  578. if (res.code == 200) {
  579. let outArr = res.data.filter((item) => item.outerFlag == 1);
  580. outArr.forEach((item, index) => {
  581. item.name =
  582. (item.accountQuality == 0 ? "公户" : "私户") +
  583. " " +
  584. item.accountName +
  585. " " +
  586. item.bankCardNum +
  587. " " +
  588. item.bank;
  589. item.nameValue =
  590. item.accountName + " " + item.bankCardNum + " " + item.bank;
  591. });
  592. this.collectionData = outArr;
  593. }
  594. });
  595. },
  596. //选择收款单位change事件
  597. companyChange(val) {
  598. const item = this.collectionData.find((item) => item.accountId === val);
  599. this.companyItem = item;
  600. },
  601. //选择账户类别
  602. outChange(e) {
  603. if (e == 1) {
  604. this.formData = {
  605. outerFlag: e, //账户类别
  606. accountName: this.formData.accountName, //户名
  607. accountQuality: this.formData.accountQuality, //账户性质
  608. bankCardNum: this.formData.bankCardNum, //银行卡号
  609. bank: this.formData.bank, //开户行
  610. };
  611. } else {
  612. this.formData = {
  613. outerFlag: e, //账户类别
  614. accountName: this.formData.accountName, //户名
  615. accountQuality: this.formData.accountQuality, //账户性质
  616. bankCardNum: this.formData.bankCardNum, //银行卡号
  617. bank: this.formData.bank, //开户行
  618. bankName: "", //开户行名称
  619. bankNum: "", //开户行号
  620. certExpirationDate: "", //证书有效期
  621. clearingProfit: "", //结算卡
  622. dayStrokeNum: "", //单日转账笔数限制
  623. exteriorProfit: "", //外部过账金额
  624. fiscalProfit: "", //财税公司利润
  625. insuranceProfit: "", //保险公司回款
  626. otherProfit: "", //其他利润
  627. parkProfit: "", //园区利润
  628. priDayLines: "", //对私单日限额
  629. priSingleLines: "", //对私单笔限额
  630. priYearExcess: "", //对私年剩余额度
  631. priYearLines: "", //对私年额度
  632. pubDayLines: "", //对公单日限额
  633. pubSingleLines: "", //对公单笔限额
  634. pubYearExcess: "", //对公年剩余额度
  635. pubYearLines: "", //对公年额度
  636. tianqinProfit: "", //天勤利润
  637. };
  638. }
  639. },
  640. //点击确认收入事件
  641. submitIncomeForm() {
  642. let obj = JSON.parse(JSON.stringify(this.inComeFormData));
  643. obj.enterAccountId = this.enterAccountId;
  644. obj.fundFlow = obj.company + "→" + obj.collectionMessage;
  645. this.$refs.inComeFormData.validate((valid) => {
  646. if (valid) {
  647. this.$api.expense.insertAccountOperate(obj).then((res) => {
  648. this.incomeDialogVisible = false;
  649. if (res.code == 200) {
  650. this.$message.success("添加成功!");
  651. } else {
  652. this.$message.success(res.msg);
  653. }
  654. });
  655. } else {
  656. return false;
  657. }
  658. });
  659. },
  660. //点击页面收入按钮
  661. handleTableIncome(e) {
  662. if (e.row.outerFlag == 1) {
  663. this.$message.error("请选择内部账户");
  664. return;
  665. }
  666. this.getAllUser();
  667. this.enterAccountId = e.row.accountId;
  668. this.inComeFormData.collectionMessage =
  669. e.row.accountName + " " + e.row.bankCardNum + " " + e.row.bank;
  670. this.incomeDialogVisible = true;
  671. },
  672. //点击页面支出按钮
  673. handleTableExpend(e) {
  674. if (e.row.outerFlag == 1) {
  675. this.$message.error("请选择内部账户");
  676. return;
  677. }
  678. this.expendDialogVisible = true;
  679. this.expendOutAccountId = e.row.accountId;
  680. this.getExpendData();
  681. },
  682. //获取支出信息列表
  683. getExpendData(data) {
  684. if (data && data.pageRequest) {
  685. this.expendPageResult.pageNo = data.pageRequest.pageNum;
  686. this.expendPageResult.pageSize = data.pageRequest.pageSize;
  687. }
  688. let obj = {
  689. pageNo: this.expendPageResult.pageNo,
  690. pageSize: this.expendPageResult.pageSize,
  691. transferFlag: 1,
  692. outAccountId: this.expendOutAccountId,
  693. };
  694. this.$api.expense
  695. .getAccountExcel(obj)
  696. .then((res) => {
  697. res.data.records.forEach((element) => {
  698. element.transferFlagName =
  699. element.transferFlag == 0 ? "已转账" : "未转账";
  700. this.use_fundsData.forEach((item) => {
  701. if (element.remark == item.value) {
  702. element.remarkName = item.label;
  703. }
  704. });
  705. });
  706. this.expendPageResult = {
  707. content: res.data.records,
  708. pageNum: res.data.current,
  709. pageSize: res.data.size,
  710. totalPages: res.data.pages,
  711. totalSize: res.data.total,
  712. };
  713. })
  714. .then(data != null ? data.callback : "");
  715. },
  716. //弹框确认支出按钮事件
  717. handleTableConfirm(index) {
  718. this.$confirm("确认把该条数据设为已转账状态吗?", "提示", {
  719. type: "warning",
  720. })
  721. .then(() => {
  722. this.$api.expense
  723. .updateTransferFlag(index.row.excelAccountOperateId)
  724. .then((res) => {
  725. if (res.code == 200) {
  726. this.$message.success("确认转账成功");
  727. this.getExpendData();
  728. } else {
  729. this.$message.error(res.msg);
  730. }
  731. });
  732. })
  733. .catch(() => {});
  734. },
  735. //选择证书有效日期区间
  736. setDateInterval(e) {
  737. if (e != null && e != "") {
  738. this.formData.startCertExpirationDate = e[0];
  739. this.formData.endCertExpirationDate = e[1];
  740. } else {
  741. this.formData.startCertExpirationDate = "";
  742. this.formData.endCertExpirationDate = "";
  743. }
  744. },
  745. //获取支出页面列表数据
  746. expendFindPage(data) {},
  747. //获取页面列表数据
  748. findPage(data) {
  749. if (data && data.pageRequest) {
  750. this.pageRequest.pageNo = data.pageRequest.pageNum;
  751. this.pageRequest.pageSize = data.pageRequest.pageSize;
  752. }
  753. let obj = { ...this.queryFrom, ...this.pageRequest };
  754. this.$api.expense
  755. .getAccount(obj)
  756. .then((res) => {
  757. console.log(res)
  758. res.data.records.forEach((element) => {
  759. element.outerFlagName =
  760. element.outerFlag == 0 ? "内部账户" : "外部账户";
  761. element.accountQualityName = this.dictFn(element, 1); //转化账户性质跟账户性别
  762. });
  763. this.pageResult = {
  764. content: res.data.records,
  765. pageNum: res.data.current,
  766. pageSize: res.data.size,
  767. totalPages: res.data.pages,
  768. totalSize: res.data.total,
  769. };
  770. })
  771. .then(data != null ? data.callback : "");
  772. },
  773. //数据字典
  774. business(typeName) {
  775. this.$api.dict.findByLableName(typeName).then((res) => {
  776. // this.account_qualityData = res.data;
  777. this[typeName + "Data"] = res.data;
  778. });
  779. },
  780. //用户性质转换
  781. dictFn(obj, type) {
  782. if(obj.accountQuality==null){
  783. return
  784. }
  785. if (type == 1) {
  786. return this.account_qualityData.find(
  787. (item) => item.value == obj.accountQuality
  788. ).label;
  789. } else {
  790. return this.account_qualityData.find(
  791. (item) => item.label == obj.accountQuality
  792. ).value;
  793. }
  794. },
  795. // 查询
  796. queryStaffInfo() {
  797. this.findPage();
  798. },
  799. //新增事件
  800. addAmount() {
  801. this.title = "新增账户信息";
  802. this.dialogFormVisible = true;
  803. },
  804. //删除数据事件
  805. handleTableDelete(index) {
  806. this.$confirm("确认删除该记录吗?", "提示", {
  807. type: "warning",
  808. })
  809. .then(() => {
  810. this.$api.expense.deleteAccount(index.row.accountId).then((res) => {
  811. if (res.code == 200) {
  812. this.$message.success("删除成功");
  813. this.findPage();
  814. } else {
  815. this.$message.error(res.msg);
  816. }
  817. });
  818. })
  819. .catch(() => {});
  820. },
  821. //收入弹框取消重置
  822. incomeResetForm() {
  823. this.incomeDialogVisible = false;
  824. },
  825. //支出弹框取消重置
  826. expendResetForm() {
  827. this.expendDialogVisible = false;
  828. },
  829. //弹框取消重置
  830. resetForm() {
  831. this.dialogFormVisible = false;
  832. this.formDataId = "";
  833. this.formData = {
  834. outerFlag: "0", //账户类别
  835. accountName: "", //户名
  836. accountQuality: "", //账户性质
  837. bankCardNum: "", //银行卡号
  838. bank: "", //开户行
  839. bankName: "", //开户行名称
  840. bankNum: "", //开户行号
  841. certExpirationDate: "", //证书有效期
  842. clearingProfit: "", //结算卡
  843. dayStrokeNum: "", //单日转账笔数限制
  844. exteriorProfit: "", //外部过账金额
  845. fiscalProfit: "", //财税公司利润
  846. insuranceProfit: "", //保险公司回款
  847. otherProfit: "", //其他利润
  848. parkProfit: "", //园区利润
  849. priDayLines: "", //对私单日限额
  850. priSingleLines: "", //对私单笔限额
  851. priYearExcess: "", //对私年剩余额度
  852. priYearLines: "", //对私年额度
  853. pubDayLines: "", //对公单日限额
  854. pubSingleLines: "", //对公单笔限额
  855. pubYearExcess: "", //对公年剩余额度
  856. pubYearLines: "", //对公年额度
  857. tianqinProfit: "", //天勤利润
  858. };
  859. },
  860. //修改
  861. handleTableEdit(index) {
  862. let row = index.row;
  863. this.formDataId = row.accountId;
  864. this.$api.expense.getAccountById(this.formDataId).then((res) => {
  865. if (res.code == 200) {
  866. this.formData = JSON.parse(JSON.stringify(res.data));
  867. if (
  868. res.data.startCertExpirationDate &&
  869. res.data.endCertExpirationDate
  870. ) {
  871. this.formData.certExpirationDate = [
  872. res.data.startCertExpirationDate,
  873. res.data.endCertExpirationDate,
  874. ];
  875. }
  876. } else {
  877. this.$message.error(res.msg);
  878. }
  879. });
  880. this.title = "编辑账户信息";
  881. this.dialogFormVisible = true;
  882. },
  883. //提交
  884. submitForm() {
  885. let params = JSON.parse(JSON.stringify(this.formData));
  886. delete params.certExpirationDate;
  887. if (this.formDataId) {
  888. //修改
  889. params.accountId = this.formDataId;
  890. this.$api.expense.updateAccoount(params).then((res) => {
  891. if (res.code == 200) {
  892. this.$message({
  893. message: "修改成功",
  894. type: "success",
  895. });
  896. } else {
  897. this.$message({
  898. message: `修改失败, ${res.msg}`,
  899. type: "error",
  900. });
  901. }
  902. this.findPage();
  903. this.resetForm();
  904. });
  905. } else {
  906. //新增
  907. this.$api.expense.insertAccount(params).then((res) => {
  908. if (res.code == 200) {
  909. this.$message({
  910. message: "添加成功",
  911. type: "success",
  912. });
  913. } else {
  914. this.$message({
  915. message: `添加失败, ${res.msg}`,
  916. type: "error",
  917. });
  918. }
  919. this.findPage();
  920. this.resetForm();
  921. });
  922. }
  923. },
  924. },
  925. };
  926. </script>
  927. <style scoped>
  928. .operation {
  929. margin-left: 14px !important;
  930. margin-top: 15px !important ;
  931. }
  932. .form {
  933. display: flex;
  934. margin-top: 14px;
  935. align-items: center;
  936. margin-left: -12px;
  937. margin-bottom: 20px;
  938. }
  939. .el-pagination {
  940. font-weight: normal;
  941. }
  942. .el-card__body {
  943. padding: 12px !important;
  944. }
  945. .footer .footerdiv {
  946. display: flex;
  947. align-items: center;
  948. }
  949. .container .el-form-item {
  950. margin-bottom: -14px !important;
  951. }
  952. .form .el-form-item__label {
  953. font-size: 15px !important;
  954. font-weight: 600 !important;
  955. }
  956. .ktTable {
  957. margin-top: 20px;
  958. }
  959. .el-row {
  960. margin-top: 18px;
  961. }
  962. .top {
  963. margin-top: 0px;
  964. }
  965. .el-date-editor--daterange.el-input__inner {
  966. width: 300px;
  967. }
  968. /deep/ .el-select--small {
  969. width: 100%;
  970. }
  971. .frame {
  972. width: 100%;
  973. background-color: #fff;
  974. padding: 20px;
  975. -webkit-box-sizing: border-box;
  976. box-sizing: border-box;
  977. margin-bottom: 15px;
  978. border-radius: 6px;
  979. border: 1px solid #ebeef5;
  980. -webkit-transition: all 0.2s ease-in-out;
  981. transition: all 0.2s ease-in-out;
  982. -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  983. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  984. }
  985. /deep/ .el-dialog__body {
  986. overflow-y: scroll;
  987. max-height: 500px;
  988. }
  989. .addremove-box {
  990. width: 100%;
  991. display: flex;
  992. justify-content: center;
  993. align-items: center;
  994. font-size: 25px;
  995. margin-top: 10px;
  996. /* position: absolute;
  997. bottom:0;
  998. left: 0; */
  999. }
  1000. .addremove-box > i {
  1001. cursor: pointer;
  1002. }
  1003. .frame >>> .el-date-editor {
  1004. width: 100%;
  1005. }
  1006. .frame .el-input-number--small {
  1007. width: 200px;
  1008. }
  1009. .ktTable >>> .el-button span {
  1010. margin-left: 0;
  1011. }
  1012. .expendTable >>> .bottomFixed {
  1013. position: static;
  1014. margin-top: 20px;
  1015. }
  1016. .expendTable >>> .el-table {
  1017. height: 400px !important;
  1018. }
  1019. .expendDialog >>> .el-dialog__body {
  1020. overflow-y: hidden !important;
  1021. max-height: 500px;
  1022. }
  1023. .collec >>> .el-form-item__content {
  1024. display: flex;
  1025. align-items: center;
  1026. }
  1027. .inComeForm >>> .el-input-number__decrease,
  1028. .inComeForm >>> .el-input-number__increase {
  1029. display: none;
  1030. }
  1031. .inComeForm >>> .el-input-number {
  1032. width: 100%;
  1033. }
  1034. .inComeForm >>> .el-input.is-disabled .el-input__inner {
  1035. background-color: #fff;
  1036. color: #606266;
  1037. }
  1038. .el-icon-right {
  1039. margin: 0 10px;
  1040. font-size: 20px;
  1041. }
  1042. .ktTable >>> .cell .el-button{
  1043. width: 80px;
  1044. }
  1045. .expendDialog >>> .cell .el-button{
  1046. width: auto;
  1047. }
  1048. </style>