ExpenseManagement.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124
  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. export default {
  245. name: "ExpenseManagement",
  246. components: { KtCommonTable, KtButton, ExpenseComponent },
  247. created() {
  248. this.business("account_quality"); //账户性质字典;
  249. this.business("use_funds"); //备注字典
  250. },
  251. mounted() {},
  252. data() {
  253. return {
  254. /**
  255. * 账户收入模块
  256. */
  257. incomeDialogVisible: false, //收入弹出框状态
  258. collectionData: [], //收入form表单 转账方下拉菜单数组
  259. use_fundsData: [], //收入form表单 备注字典数据
  260. inComeFormData: {
  261. //收入form表单
  262. collectionMessage: "", //收款名字
  263. fundFlow: "", //资金流向
  264. applyAmount: "", //金额
  265. bigApplyAmount: "", //大写金额
  266. remark: "", //备注
  267. company: "", //转账方
  268. },
  269. inComeFormRules: {
  270. //收入form表单规则
  271. company: [
  272. { required: true, message: "转账方不能为空", trigger: "change" },
  273. ],
  274. remark: [{ required: true, message: "请选择备注", trigger: "change" }],
  275. },
  276. enterAccountId: "", //点击收入按钮当条数据收入id
  277. /**
  278. * 账户模块
  279. */
  280. title: "新增账户信息",
  281. dialogFormVisible: false, //弹出框状态
  282. operationWidth: 200, //操作列宽度
  283. account_qualityData: [], //账户性质数据字典
  284. queryFrom: {//查询条件
  285. accountQuality: "", //账户性质查询
  286. bankCardNum: "", //银行卡号查询
  287. accountName: "", //户名查询
  288. },
  289. button1Name: "支出", //按钮内容
  290. button3Name: "删除",
  291. button2Name: "收入",
  292. expendButton1Name: "确认已转账",
  293. pageResult: {}, //表格内容分页参数
  294. formDataId: "", //数据Id
  295. pageRequest: {
  296. // 列表查询条件
  297. pageNo: 1,
  298. pageSize: 10,
  299. },
  300. // 数据列
  301. columns: [
  302. {
  303. prop: "outerFlagName",
  304. label: "账户类别",
  305. minWidth: 70,
  306. sortable: false,
  307. },
  308. {
  309. prop: "accountQualityName",
  310. label: "账户性质",
  311. minWidth: 70,
  312. sortable: false,
  313. },
  314. {
  315. prop: "accountName",
  316. label: "户名",
  317. minWidth: 160,
  318. sortable: false,
  319. },
  320. {
  321. prop: "bankCardNum",
  322. label: "银行卡号",
  323. minWidth: 170,
  324. sortable: false,
  325. },
  326. { prop: "bank", label: "开户行", minWidth: 100, sortable: false },
  327. {
  328. prop: "bankName",
  329. label: "开户行名称",
  330. minWidth: 190,
  331. sortable: false,
  332. },
  333. { prop: "bankNum", label: "开户行号", minWidth: 150, sortable: false },
  334. {
  335. prop: "balance",
  336. label: "余额",
  337. minWidth: 100,
  338. sortable: false,
  339. },
  340. {
  341. prop: "startCertExpirationDate",
  342. label: "证书有效开始日期",
  343. minWidth: 120,
  344. sortable: false,
  345. },
  346. {
  347. prop: "endCertExpirationDate",
  348. label: "证书有效结束日期",
  349. minWidth: 120,
  350. sortable: false,
  351. },
  352. {
  353. prop: "clearingProfit",
  354. label: "结算卡",
  355. minWidth: 120,
  356. sortable: false,
  357. },
  358. {
  359. prop: "dayStrokeNum",
  360. label: "单日转账笔数限制",
  361. minWidth: 120,
  362. sortable: false,
  363. },
  364. {
  365. prop: "exteriorProfit",
  366. label: "外部过账金额",
  367. minWidth: 120,
  368. sortable: false,
  369. },
  370. {
  371. prop: "fiscalProfit",
  372. label: "财税公司利润",
  373. minWidth: 120,
  374. sortable: false,
  375. },
  376. {
  377. prop: "insuranceProfit",
  378. label: "保险公司回款",
  379. minWidth: 120,
  380. sortable: false,
  381. },
  382. {
  383. prop: "otherProfit",
  384. label: "其他利润",
  385. minWidth: 120,
  386. sortable: false,
  387. },
  388. {
  389. prop: "parkProfit",
  390. label: "园区利润",
  391. minWidth: 120,
  392. sortable: false,
  393. },
  394. {
  395. prop: "priDayLines",
  396. label: "对私单日限额",
  397. minWidth: 120,
  398. sortable: false,
  399. },
  400. {
  401. prop: "priSingleLines",
  402. label: "对私单笔限额",
  403. minWidth: 120,
  404. sortable: false,
  405. },
  406. {
  407. prop: "priYearExcess",
  408. label: "对私年剩余额度",
  409. minWidth: 120,
  410. sortable: false,
  411. },
  412. {
  413. prop: "priYearLines",
  414. label: "对私年额度",
  415. minWidth: 120,
  416. sortable: false,
  417. },
  418. {
  419. prop: "pubDayLines",
  420. label: "对公单日限额",
  421. minWidth: 120,
  422. sortable: false,
  423. },
  424. {
  425. prop: "pubSingleLines",
  426. label: "对公单笔限额",
  427. minWidth: 120,
  428. sortable: false,
  429. },
  430. {
  431. prop: "pubYearExcess",
  432. label: "对公年剩余额度",
  433. minWidth: 120,
  434. sortable: false,
  435. },
  436. {
  437. prop: "pubYearLines",
  438. label: "对公年额度",
  439. minWidth: 120,
  440. sortable: false,
  441. },
  442. {
  443. prop: "tianqinProfit",
  444. label: "天勤利润",
  445. minWidth: 120,
  446. sortable: false,
  447. },
  448. ],
  449. formData: {//账户form表单
  450. outerFlag: "0", //账户类别
  451. accountName: "", //户名
  452. accountQuality: "", //账户性质
  453. bankCardNum: "", //银行卡号
  454. bank: "", //开户行
  455. bankName: "", //开户行名称
  456. bankNum: "", //开户行号
  457. certExpirationDate: "", //证书有效期
  458. clearingProfit: "", //结算卡
  459. dayStrokeNum: "", //单日转账笔数限制
  460. exteriorProfit: "", //外部过账金额
  461. fiscalProfit: "", //财税公司利润
  462. insuranceProfit: "", //保险公司回款
  463. otherProfit: "", //其他利润
  464. parkProfit: "", //园区利润
  465. priDayLines: "", //对私单日限额
  466. priSingleLines: "", //对私单笔限额
  467. priYearExcess: "", //对私年剩余额度
  468. priYearLines: "", //对私年额度
  469. pubDayLines: "", //对公单日限额
  470. pubSingleLines: "", //对公单笔限额
  471. pubYearExcess: "", //对公年剩余额度
  472. pubYearLines: "", //对公年额度
  473. tianqinProfit: "", //天勤利润
  474. },
  475. /**
  476. * 支出模块
  477. */
  478. expendColumns: [// 支出数据列
  479. {
  480. prop: "company",
  481. label: "转账方",
  482. minWidth: 160,
  483. sortable: false,
  484. },
  485. {
  486. prop: "collectionMessage",
  487. label: "收账方",
  488. minWidth: 80,
  489. sortable: false,
  490. },
  491. {
  492. prop: "applyAmount",
  493. label: "金额",
  494. minWidth: 150,
  495. sortable: false,
  496. },
  497. {
  498. prop: "applyTime",
  499. label: "转账日期",
  500. minWidth: 150,
  501. sortable: false,
  502. },
  503. {
  504. prop: "transferFlagName",
  505. label: "转账状态",
  506. minWidth: 150,
  507. sortable: false,
  508. },
  509. ],
  510. expendPageResult: {
  511. //支出表格参数
  512. pageNo: 1,
  513. pageSize: 10,
  514. },
  515. expendDialogVisible: false, //支出弹出框状态
  516. expendOutAccountId: "", //点击支出按钮当条数据支出id
  517. companyItem: {}, //选择单位整条数据
  518. };
  519. },
  520. watch: {
  521. expendDialogVisible(n) {
  522. if (n == false) {
  523. this.expendOutAccountId = "";
  524. }
  525. },
  526. //收入去除form表单信息
  527. incomeDialogVisible(n) {
  528. if (n == false) {
  529. this.enterAccountId = "";
  530. this.$refs.inComeFormData.clearValidate();
  531. this.inComeFormData = {
  532. //收入form数据
  533. collectionMessage: "", //收款名字
  534. fundFlow: "", //资金流向
  535. applyAmount: "", //金额
  536. bigApplyAmount: "", //大写金额
  537. remark: "", //备注
  538. company: "", //转账方
  539. };
  540. }
  541. },
  542. },
  543. methods: {
  544. //申请金额填写完成后
  545. chageAppl(e) {
  546. this.inComeFormData.bigApplyAmount = this.toChies(
  547. this.inComeFormData.applyAmount
  548. );
  549. },
  550. //获取所有外部账户信息
  551. getAllUser() {
  552. this.$api.expense.getAccountByAccountName().then((res) => {
  553. if (res.code == 200) {
  554. let outArr = res.data.filter((item) => item.outerFlag == 1);
  555. outArr.forEach((item, index) => {
  556. item.name =
  557. (item.accountQuality == 0 ? "公户" : "私户") +
  558. " " +
  559. item.accountName +
  560. " " +
  561. item.bankCardNum +
  562. " " +
  563. item.bank;
  564. item.nameValue =
  565. item.accountName + " " + item.bankCardNum + " " + item.bank;
  566. });
  567. this.collectionData = outArr;
  568. }
  569. });
  570. },
  571. //选择收款单位change事件
  572. companyChange(val) {
  573. const item = this.collectionData.find((item) => item.accountId === val);
  574. this.companyItem = item;
  575. },
  576. //选择账户类别
  577. outChange(e) {
  578. if (e == 1) {
  579. this.formData = {
  580. outerFlag: e, //账户类别
  581. accountName: this.formData.accountName, //户名
  582. accountQuality: this.formData.accountQuality, //账户性质
  583. bankCardNum: this.formData.bankCardNum, //银行卡号
  584. bank: this.formData.bank, //开户行
  585. };
  586. } else {
  587. this.formData = {
  588. outerFlag: e, //账户类别
  589. accountName: this.formData.accountName, //户名
  590. accountQuality: this.formData.accountQuality, //账户性质
  591. bankCardNum: this.formData.bankCardNum, //银行卡号
  592. bank: this.formData.bank, //开户行
  593. bankName: "", //开户行名称
  594. bankNum: "", //开户行号
  595. certExpirationDate: "", //证书有效期
  596. clearingProfit: "", //结算卡
  597. dayStrokeNum: "", //单日转账笔数限制
  598. exteriorProfit: "", //外部过账金额
  599. fiscalProfit: "", //财税公司利润
  600. insuranceProfit: "", //保险公司回款
  601. otherProfit: "", //其他利润
  602. parkProfit: "", //园区利润
  603. priDayLines: "", //对私单日限额
  604. priSingleLines: "", //对私单笔限额
  605. priYearExcess: "", //对私年剩余额度
  606. priYearLines: "", //对私年额度
  607. pubDayLines: "", //对公单日限额
  608. pubSingleLines: "", //对公单笔限额
  609. pubYearExcess: "", //对公年剩余额度
  610. pubYearLines: "", //对公年额度
  611. tianqinProfit: "", //天勤利润
  612. };
  613. }
  614. },
  615. //点击确认收入事件
  616. submitIncomeForm() {
  617. let obj = JSON.parse(JSON.stringify(this.inComeFormData));
  618. obj.enterAccountId = this.enterAccountId;
  619. obj.fundFlow = obj.company + "→" + obj.collectionMessage;
  620. this.$refs.inComeFormData.validate((valid) => {
  621. if (valid) {
  622. this.$api.expense.insertAccountOperate(obj).then((res) => {
  623. this.incomeDialogVisible = false;
  624. if (res.code == 200) {
  625. this.$message.success("添加成功!");
  626. } else {
  627. this.$message.success(res.msg);
  628. }
  629. });
  630. } else {
  631. return false;
  632. }
  633. });
  634. },
  635. //点击页面收入按钮
  636. handleTableIncome(e) {
  637. if (e.row.outerFlag == 1) {
  638. this.$message.error("请选择内部账户");
  639. return;
  640. }
  641. this.getAllUser();
  642. this.enterAccountId = e.row.accountId;
  643. this.inComeFormData.collectionMessage =
  644. e.row.accountName + " " + e.row.bankCardNum + " " + e.row.bank;
  645. this.incomeDialogVisible = true;
  646. },
  647. //点击页面支出按钮
  648. handleTableExpend(e) {
  649. if (e.row.outerFlag == 1) {
  650. this.$message.error("请选择内部账户");
  651. return;
  652. }
  653. this.expendDialogVisible = true;
  654. this.expendOutAccountId = e.row.accountId;
  655. this.getExpendData();
  656. },
  657. //获取支出信息列表
  658. getExpendData(data) {
  659. if (data && data.pageRequest) {
  660. this.expendPageResult.pageNo = data.pageRequest.pageNum;
  661. this.expendPageResult.pageSize = data.pageRequest.pageSize;
  662. }
  663. let obj = {
  664. pageNo: this.expendPageResult.pageNo,
  665. pageSize: this.expendPageResult.pageSize,
  666. transferFlag: 1,
  667. outAccountId: this.expendOutAccountId,
  668. };
  669. this.$api.expense
  670. .getAccountExcel(obj)
  671. .then((res) => {
  672. res.data.records.forEach((element) => {
  673. element.transferFlagName =
  674. element.transferFlag == 0 ? "已转账" : "未转账";
  675. this.use_fundsData.forEach((item) => {
  676. if (element.remark == item.value) {
  677. element.remarkName = item.label;
  678. }
  679. });
  680. });
  681. this.expendPageResult = {
  682. content: res.data.records,
  683. pageNum: res.data.current,
  684. pageSize: res.data.size,
  685. totalPages: res.data.pages,
  686. totalSize: res.data.total,
  687. };
  688. })
  689. .then(data != null ? data.callback : "");
  690. },
  691. //弹框确认支出按钮事件
  692. handleTableConfirm(index) {
  693. this.$confirm("确认把该条数据设为已转账状态吗?", "提示", {
  694. type: "warning",
  695. })
  696. .then(() => {
  697. this.$api.expense
  698. .updateTransferFlag(index.row.excelAccountOperateId)
  699. .then((res) => {
  700. if (res.code == 200) {
  701. this.$message.success("确认转账成功");
  702. this.getExpendData();
  703. } else {
  704. this.$message.error(res.msg);
  705. }
  706. });
  707. })
  708. .catch(() => {});
  709. },
  710. //选择证书有效日期区间
  711. setDateInterval(e) {
  712. if (e != null && e != "") {
  713. this.formData.startCertExpirationDate = e[0];
  714. this.formData.endCertExpirationDate = e[1];
  715. } else {
  716. this.formData.startCertExpirationDate = "";
  717. this.formData.endCertExpirationDate = "";
  718. }
  719. },
  720. //获取支出页面列表数据
  721. expendFindPage(data) {},
  722. //获取页面列表数据
  723. findPage(data) {
  724. if (data && data.pageRequest) {
  725. this.pageRequest.pageNo = data.pageRequest.pageNum;
  726. this.pageRequest.pageSize = data.pageRequest.pageSize;
  727. }
  728. let obj = { ...this.queryFrom, ...this.pageRequest };
  729. this.$api.expense
  730. .getAccount(obj)
  731. .then((res) => {
  732. res.data.records.forEach((element) => {
  733. element.outerFlagName =
  734. element.outerFlag == 0 ? "内部账户" : "外部账户";
  735. element.accountQualityName = this.dictFn(element, 1); //转化账户性质跟账户性别
  736. });
  737. this.pageResult = {
  738. content: res.data.records,
  739. pageNum: res.data.current,
  740. pageSize: res.data.size,
  741. totalPages: res.data.pages,
  742. totalSize: res.data.total,
  743. };
  744. })
  745. .then(data != null ? data.callback : "");
  746. },
  747. //数据字典
  748. business(typeName) {
  749. this.$api.dict.findByLableName(typeName).then((res) => {
  750. // this.account_qualityData = res.data;
  751. this[typeName + "Data"] = res.data;
  752. });
  753. },
  754. //用户性质转换
  755. dictFn(obj, type) {
  756. if (type == 1) {
  757. return this.account_qualityData.find(
  758. (item) => item.value == obj.accountQuality
  759. ).label;
  760. } else {
  761. return this.account_qualityData.find(
  762. (item) => item.label == obj.accountQuality
  763. ).value;
  764. }
  765. },
  766. // 查询
  767. queryStaffInfo() {
  768. this.findPage();
  769. },
  770. //新增事件
  771. addAmount() {
  772. this.title = "新增账户信息";
  773. this.dialogFormVisible = true;
  774. },
  775. //删除数据事件
  776. handleTableDelete(index) {
  777. this.$confirm("确认删除该记录吗?", "提示", {
  778. type: "warning",
  779. })
  780. .then(() => {
  781. this.$api.expense.deleteAccount(index.row.accountId).then((res) => {
  782. if (res.code == 200) {
  783. this.$message.success("删除成功");
  784. this.findPage();
  785. } else {
  786. this.$message.error(res.msg);
  787. }
  788. });
  789. })
  790. .catch(() => {});
  791. },
  792. //收入弹框取消重置
  793. incomeResetForm() {
  794. this.incomeDialogVisible = false;
  795. },
  796. //支出弹框取消重置
  797. expendResetForm() {
  798. this.expendDialogVisible = false;
  799. },
  800. //弹框取消重置
  801. resetForm() {
  802. this.dialogFormVisible = false;
  803. this.formDataId = "";
  804. this.formData = {
  805. outerFlag: "0", //账户类别
  806. accountName: "", //户名
  807. accountQuality: "", //账户性质
  808. bankCardNum: "", //银行卡号
  809. bank: "", //开户行
  810. bankName: "", //开户行名称
  811. bankNum: "", //开户行号
  812. certExpirationDate: "", //证书有效期
  813. clearingProfit: "", //结算卡
  814. dayStrokeNum: "", //单日转账笔数限制
  815. exteriorProfit: "", //外部过账金额
  816. fiscalProfit: "", //财税公司利润
  817. insuranceProfit: "", //保险公司回款
  818. otherProfit: "", //其他利润
  819. parkProfit: "", //园区利润
  820. priDayLines: "", //对私单日限额
  821. priSingleLines: "", //对私单笔限额
  822. priYearExcess: "", //对私年剩余额度
  823. priYearLines: "", //对私年额度
  824. pubDayLines: "", //对公单日限额
  825. pubSingleLines: "", //对公单笔限额
  826. pubYearExcess: "", //对公年剩余额度
  827. pubYearLines: "", //对公年额度
  828. tianqinProfit: "", //天勤利润
  829. };
  830. },
  831. //修改
  832. handleTableEdit(index) {
  833. let row = index.row;
  834. this.formDataId = row.accountId;
  835. this.$api.expense.getAccountById(this.formDataId).then((res) => {
  836. if (res.code == 200) {
  837. this.formData = JSON.parse(JSON.stringify(res.data));
  838. if (
  839. res.data.startCertExpirationDate &&
  840. res.data.endCertExpirationDate
  841. ) {
  842. this.formData.certExpirationDate = [
  843. res.data.startCertExpirationDate,
  844. res.data.endCertExpirationDate,
  845. ];
  846. }
  847. } else {
  848. this.$message.error(res.msg);
  849. }
  850. });
  851. this.title = "编辑账户信息";
  852. this.dialogFormVisible = true;
  853. },
  854. //提交
  855. submitForm() {
  856. let params = JSON.parse(JSON.stringify(this.formData));
  857. delete params.certExpirationDate;
  858. if (this.formDataId) {
  859. //修改
  860. params.accountId = this.formDataId;
  861. this.$api.expense.updateAccoount(params).then((res) => {
  862. if (res.code == 200) {
  863. this.$message({
  864. message: "修改成功",
  865. type: "success",
  866. });
  867. } else {
  868. this.$message({
  869. message: `修改失败, ${res.msg}`,
  870. type: "error",
  871. });
  872. }
  873. this.findPage();
  874. this.resetForm();
  875. });
  876. } else {
  877. //新增
  878. this.$api.expense.insertAccount(params).then((res) => {
  879. if (res.code == 200) {
  880. this.$message({
  881. message: "添加成功",
  882. type: "success",
  883. });
  884. } else {
  885. this.$message({
  886. message: `添加失败, ${res.msg}`,
  887. type: "error",
  888. });
  889. }
  890. this.findPage();
  891. this.resetForm();
  892. });
  893. }
  894. },
  895. //小写转大写金额
  896. toChies(amount) {
  897. // 汉字的数字
  898. const cnNums = [
  899. "零",
  900. "壹",
  901. "贰",
  902. "叁",
  903. "肆",
  904. "伍",
  905. "陆",
  906. "柒",
  907. "捌",
  908. "玖",
  909. ];
  910. // 基本单位
  911. const cnIntRadice = ["", "拾", "佰", "仟"];
  912. // 对应整数部分扩展单位
  913. const cnIntUnits = ["", "万", "亿", "兆"];
  914. // 对应小数部分单位
  915. const cnDecUnits = ["角", "分"];
  916. // 整数金额时后面跟的字符
  917. const cnInteger = "整";
  918. // 整型完以后的单位
  919. const cnIntLast = "元";
  920. // 最大处理的数字
  921. const maxNum = 9999999999999999.99;
  922. // 金额整数部分
  923. let integerNum;
  924. // 金额小数部分
  925. let decimalNum;
  926. // 输出的中文金额字符串
  927. let chineseStr = "";
  928. // 分离金额后用的数组,预定义
  929. let parts;
  930. if (amount === "") {
  931. return "";
  932. }
  933. amount = parseFloat(amount);
  934. if (amount >= maxNum) {
  935. // 超出最大处理数字
  936. return "";
  937. }
  938. if (amount === 0) {
  939. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  940. return chineseStr;
  941. }
  942. // 转换为字符串
  943. amount = amount.toString();
  944. if (amount.indexOf(".") === -1) {
  945. integerNum = amount;
  946. decimalNum = "";
  947. } else {
  948. parts = amount.split(".");
  949. integerNum = parts[0];
  950. decimalNum = parts[1].substr(0, 4);
  951. }
  952. // 获取整型部分转换
  953. if (parseInt(integerNum, 10) > 0) {
  954. let zeroCount = 0;
  955. const IntLen = integerNum.length;
  956. for (let i = 0; i < IntLen; i++) {
  957. const n = integerNum.substr(i, 1);
  958. const p = IntLen - i - 1;
  959. const q = p / 4;
  960. const m = p % 4;
  961. if (n === "0") {
  962. zeroCount++;
  963. } else {
  964. if (zeroCount > 0) {
  965. chineseStr += cnNums[0];
  966. }
  967. // 归零
  968. zeroCount = 0;
  969. //alert(cnNums[parseInt(n)])
  970. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  971. }
  972. if (m === 0 && zeroCount < 4) {
  973. chineseStr += cnIntUnits[q];
  974. }
  975. }
  976. chineseStr += cnIntLast;
  977. }
  978. // 小数部分
  979. if (decimalNum !== "") {
  980. const decLen = decimalNum.length;
  981. for (let i = 0; i < decLen; i++) {
  982. const n = decimalNum.substr(i, 1);
  983. if (n !== "0") {
  984. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  985. }
  986. }
  987. }
  988. if (chineseStr === "") {
  989. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  990. } else if (decimalNum === "") {
  991. chineseStr += cnInteger;
  992. }
  993. return chineseStr;
  994. },
  995. },
  996. };
  997. </script>
  998. <style scoped>
  999. .operation {
  1000. margin-left: 14px !important;
  1001. margin-top: 15px !important ;
  1002. }
  1003. .form {
  1004. display: flex;
  1005. margin-top: 14px;
  1006. align-items: center;
  1007. margin-left: -12px;
  1008. margin-bottom: 20px;
  1009. }
  1010. .el-pagination {
  1011. font-weight: normal;
  1012. }
  1013. .el-card__body {
  1014. padding: 12px !important;
  1015. }
  1016. .footer .footerdiv {
  1017. display: flex;
  1018. align-items: center;
  1019. }
  1020. .container .el-form-item {
  1021. margin-bottom: -14px !important;
  1022. }
  1023. .form .el-form-item__label {
  1024. font-size: 15px !important;
  1025. font-weight: 600 !important;
  1026. }
  1027. .ktTable {
  1028. margin-top: 20px;
  1029. }
  1030. .el-row {
  1031. margin-top: 18px;
  1032. }
  1033. .top {
  1034. margin-top: 0px;
  1035. }
  1036. .el-date-editor--daterange.el-input__inner {
  1037. width: 300px;
  1038. }
  1039. /deep/ .el-select--small {
  1040. width: 100%;
  1041. }
  1042. .frame {
  1043. width: 100%;
  1044. background-color: #fff;
  1045. padding: 20px;
  1046. -webkit-box-sizing: border-box;
  1047. box-sizing: border-box;
  1048. margin-bottom: 15px;
  1049. border-radius: 6px;
  1050. border: 1px solid #ebeef5;
  1051. -webkit-transition: all 0.2s ease-in-out;
  1052. transition: all 0.2s ease-in-out;
  1053. -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  1054. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  1055. }
  1056. /deep/ .el-dialog__body {
  1057. overflow-y: scroll;
  1058. max-height: 500px;
  1059. }
  1060. .addremove-box {
  1061. width: 100%;
  1062. display: flex;
  1063. justify-content: center;
  1064. align-items: center;
  1065. font-size: 25px;
  1066. margin-top: 10px;
  1067. /* position: absolute;
  1068. bottom:0;
  1069. left: 0; */
  1070. }
  1071. .addremove-box > i {
  1072. cursor: pointer;
  1073. }
  1074. .frame >>> .el-date-editor {
  1075. width: 100%;
  1076. }
  1077. .frame .el-input-number--small {
  1078. width: 200px;
  1079. }
  1080. .ktTable >>> .el-button span {
  1081. margin-left: 0;
  1082. }
  1083. .expendTable >>> .bottomFixed {
  1084. position: static;
  1085. margin-top: 20px;
  1086. }
  1087. .expendTable >>> .el-table {
  1088. height: 400px !important;
  1089. }
  1090. .expendDialog >>> .el-dialog__body {
  1091. overflow-y: hidden !important;
  1092. max-height: 500px;
  1093. }
  1094. .collec >>> .el-form-item__content {
  1095. display: flex;
  1096. align-items: center;
  1097. }
  1098. .inComeForm >>> .el-input-number__decrease,
  1099. .inComeForm >>> .el-input-number__increase {
  1100. display: none;
  1101. }
  1102. .inComeForm >>> .el-input-number {
  1103. width: 100%;
  1104. }
  1105. .inComeForm >>> .el-input.is-disabled .el-input__inner {
  1106. background-color: #fff;
  1107. color: #606266;
  1108. }
  1109. .el-icon-right {
  1110. margin: 0 10px;
  1111. font-size: 20px;
  1112. }
  1113. .ktTable >>> .cell .el-button{
  1114. width: 80px;
  1115. }
  1116. </style>