ExpenseApplyFor.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  1. <template>
  2. <div>
  3. <!-- 搜索 -->
  4. <el-row class="top">
  5. <el-form
  6. v-model="queryFrom"
  7. size="small"
  8. label-width="95px"
  9. class="query-form"
  10. >
  11. <el-form-item label="转账状态" label-width="95px" prop="transferFlag">
  12. <el-select
  13. v-model="queryFrom.transferFlag"
  14. placeholder="请选择转账状态"
  15. clearable
  16. >
  17. <el-option label="已转账" value="0"></el-option>
  18. <el-option label="未转账" value="1"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="申请人" label-width="95px" prop="applicant">
  22. <el-input
  23. v-model="queryFrom.applicant"
  24. placeholder="请输入申请人"
  25. class="widths"
  26. clearable
  27. ></el-input>
  28. </el-form-item>
  29. <el-form-item label="申请部门" label-width="95px" prop="applySector">
  30. <el-input
  31. v-model="queryFrom.applySector"
  32. placeholder="请输入申请部门"
  33. class="widths"
  34. clearable
  35. ></el-input>
  36. </el-form-item>
  37. <el-form-item label="申请日期" label-width="95px" prop="applyTime">
  38. <el-date-picker
  39. v-model="queryFrom.applyTime"
  40. type="date"
  41. placeholder="选择日期"
  42. >
  43. </el-date-picker>
  44. </el-form-item>
  45. <el-form-item>
  46. <el-button type="primary" size="small" @click="queryStaffInfo"
  47. >查询</el-button
  48. >
  49. </el-form-item>
  50. </el-form>
  51. </el-row>
  52. <!-- 申请按钮 -->
  53. <el-button
  54. class="operation"
  55. type="primary"
  56. plain
  57. size="medium"
  58. @click="showExpense"
  59. >资金使用申请单</el-button
  60. >
  61. <!-- 表格 -->
  62. <kt-common-table
  63. :operationWidth="operationWidth"
  64. class="ktTable"
  65. permsEdit="sys:agent:view"
  66. ref="dataTable"
  67. :data="pageResult"
  68. :columns="columns"
  69. editButtonName="编辑"
  70. button1Name="删除"
  71. :showBatchDelete="false"
  72. :showOperation="true"
  73. @findPage="findPage"
  74. :isshowpagination="true"
  75. @handleEdit="expendEdit"
  76. @handleButton1="expendDelete"
  77. ></kt-common-table>
  78. <!-- 申请资金弹框 -->
  79. <el-dialog
  80. class="dialog"
  81. :title="expendTitle"
  82. :close-on-click-modal="false"
  83. :before-close="resetForm"
  84. :visible.sync="expenseDialog"
  85. width="60%"
  86. >
  87. <div class="dialog-body">
  88. <el-form
  89. :model="tableForm"
  90. ref="tableForm"
  91. label-width="0px"
  92. class="demo-tableForm"
  93. >
  94. <el-row>
  95. <el-col :span="12">
  96. <el-form-item
  97. label="单位:"
  98. label-width="50px"
  99. prop="company"
  100. >
  101. <el-select
  102. v-model="tableForm.company"
  103. filterable
  104. placeholder="单位"
  105. >
  106. <el-option
  107. v-for="(item, index) in innerCollectionData"
  108. :key="item.accountId + '' + index"
  109. :label="item.name"
  110. :value="item.bankCardNum"
  111. >
  112. </el-option>
  113. </el-select>
  114. </el-form-item>
  115. </el-col>
  116. <el-col style="display: flex; justify-content: end" :span="12">
  117. <!-- <el-button type="primary" @click="addUserFn" size="small"
  118. >新增账户信息</el-button
  119. > -->
  120. </el-col>
  121. </el-row>
  122. <table
  123. class="expense-table"
  124. width="100%"
  125. height="500"
  126. border="1"
  127. bordercolor="#71787f"
  128. align="center"
  129. cellspacing=""
  130. cellpadding="10"
  131. style="border-collapse: collapse"
  132. >
  133. <tr>
  134. <td class="td-title" colspan="1">申请人</td>
  135. <td class="td-content" colspan="1">
  136. <el-input
  137. type="text"
  138. resize="none"
  139. v-model="tableForm.applicant"
  140. ></el-input>
  141. </td>
  142. <td class="td-title" colspan="1">申请部门</td>
  143. <td class="td-content" colspan="1">
  144. <el-input
  145. type="text"
  146. resize="none"
  147. v-model="tableForm.applySector"
  148. ></el-input>
  149. </td>
  150. <td class="td-title" colspan="1">申请日期</td>
  151. <td class="td-content" colspan="1">
  152. <el-date-picker
  153. v-model="tableForm.applyTime"
  154. align="right"
  155. type="date"
  156. value-format="yyyy-MM-dd"
  157. :picker-options="pickerOptions"
  158. >
  159. </el-date-picker>
  160. </td>
  161. </tr>
  162. <tr>
  163. <td class="td-title" colspan="1">收款单位信息</td>
  164. <td class="td-content" colspan="5">
  165. <el-select
  166. v-model="tableForm.collectionMessage"
  167. filterable
  168. placeholder=""
  169. >
  170. <el-option
  171. v-for="(item, index) in collectionData"
  172. :key="item.accountId + 'aa' + index"
  173. :label="item.name"
  174. :value="item.bankCardNum"
  175. >
  176. </el-option>
  177. </el-select>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td class="td-title" colspan="1">资金流程</td>
  182. <td class="td-content" colspan="5">
  183. <div style="display: flex; align-items: center">
  184. <el-select
  185. v-model="tableForm.company"
  186. filterable
  187. disabled
  188. placeholder=""
  189. >
  190. <el-option
  191. v-for="(item, index) in collectionData"
  192. :key="item.accountId + 'ac' + index"
  193. :label="item.name"
  194. :value="item.bankCardNum"
  195. >
  196. </el-option>
  197. </el-select>
  198. <i class="el-icon-right"></i>
  199. <el-select
  200. v-model="tableForm.collectionMessage"
  201. filterable
  202. disabled
  203. placeholder=""
  204. >
  205. <el-option
  206. v-for="(item, index) in collectionData"
  207. :key="item.accountId + 'avb' + index"
  208. :label="item.name"
  209. :value="item.bankCardNum"
  210. >
  211. </el-option>
  212. </el-select>
  213. </div>
  214. </td>
  215. </tr>
  216. <tr>
  217. <td class="td-title" colspan="1">资金用途</td>
  218. <td class="td-content" colspan="3">
  219. <el-cascader
  220. v-model="tableForm.fundUse"
  221. :show-all-levels="false"
  222. :clearable="true"
  223. :checkStrictly="true"
  224. :emitPath="false"
  225. placeholder=""
  226. :options="fundFlowData"
  227. filterable
  228. :props="{
  229. children: 'child',
  230. label: 'category',
  231. value: 'category',
  232. checkStrictly: true,
  233. }"
  234. ></el-cascader>
  235. </td>
  236. <td class="td-title" colspan="1">备注</td>
  237. <td class="td-content" colspan="1">
  238. <el-select v-model="tableForm.remark" placeholder="" allow-create filterable>
  239. <el-option
  240. v-for="item in use_fundsData"
  241. :key="item.value"
  242. :label="item.label"
  243. :value="item.label"
  244. >
  245. </el-option>
  246. </el-select>
  247. </td>
  248. </tr>
  249. <tr>
  250. <td class="td-title" colspan="1">申请金额(元)</td>
  251. <td class="td-content" colspan="2">
  252. <el-input-number
  253. v-model="tableForm.applyAmount"
  254. :min="0"
  255. :precision="2"
  256. @blur="chageAppl"
  257. :max="99999999999999999"
  258. label=""
  259. ></el-input-number>
  260. </td>
  261. <td class="td-title" colspan="1">大写金额</td>
  262. <td class="td-content idea-box" colspan="2">
  263. <el-input
  264. type="text"
  265. resize="none"
  266. v-model="tableForm.bigApplyAmount"
  267. disabled
  268. ></el-input>
  269. </td>
  270. </tr>
  271. <tr>
  272. <td class="td-title" colspan="1">支付方式</td>
  273. <td class="td-content" colspan="5">
  274. <el-checkbox-group v-model="tableForm.payMethod">
  275. <el-checkbox
  276. v-for="payItem in payment_methodsData"
  277. :key="payItem.value"
  278. :label="payItem.label"
  279. :value="payItem.value"
  280. :disabled="payItem.value == 2"
  281. ></el-checkbox>
  282. </el-checkbox-group>
  283. </td>
  284. </tr>
  285. <tr>
  286. <td class="td-title" rowspan="2" colspan="1">审核意见</td>
  287. <td class="td-title" colspan="2">公司领导</td>
  288. <td class="td-title" colspan="1">财务部</td>
  289. <td class="td-title" colspan="2">部门领导</td>
  290. </tr>
  291. <tr class="idea-box">
  292. <td class="td-content" colspan="2">
  293. <el-input
  294. type="text"
  295. resize="none"
  296. v-model="tableForm.desc"
  297. disabled
  298. ></el-input>
  299. </td>
  300. <td class="td-content" colspan="1">
  301. <el-input
  302. type="text"
  303. resize="none"
  304. v-model="tableForm.desc"
  305. disabled
  306. ></el-input>
  307. </td>
  308. <td class="td-content" colspan="2">
  309. <el-input
  310. type="text"
  311. resize="none"
  312. v-model="tableForm.desc"
  313. disabled
  314. ></el-input>
  315. </td>
  316. </tr>
  317. </table>
  318. </el-form>
  319. </div>
  320. <div slot="footer" class="dialog-footer">
  321. <el-button @click="resetForm" size="small">取 消</el-button>
  322. <el-button
  323. v-if="expendDataId"
  324. @click="expendDataup"
  325. type="primary"
  326. size="small"
  327. >导 出</el-button
  328. >
  329. <el-button type="primary" @click="submitForm" size="small">{{
  330. buttonValue
  331. }}</el-button>
  332. </div>
  333. </el-dialog>
  334. <!-- <el-dialog
  335. class="dialog"
  336. :title="expendTitle"
  337. :close-on-click-modal="false"
  338. :before-close="resetForm"
  339. :visible.sync="expenseaaa"
  340. width="60%"
  341. > -->
  342. <!-- <ExpenseManagement></ExpenseManagement> -->
  343. <!-- </el-dialog> -->
  344. <!-- 新增账户弹框 -->
  345. <!-- <expense-component
  346. ref="expenseComponent"
  347. :formData="formData"
  348. :title="title"
  349. :dialogFormVisible="dialogFormVisible"
  350. @resetForm="closeForm"
  351. @submitForm="submitUserForm"
  352. @setDateInterval="setDateInterval"
  353. @outChange="outChange"
  354. class="expense-component"
  355. ></expense-component> -->
  356. </div>
  357. </template>
  358. <script>
  359. import ExpenseComponent from "./ExpenseComponent.vue"; //新增账户信息弹框
  360. // import ExpenseManagement from "./ExpenseManagement.vue"; //新增账户信息
  361. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  362. import { toChies } from "../../../utils/moneyTransition";
  363. export default {
  364. name: "ExpenseApplyFor",
  365. components: { KtCommonTable, ExpenseComponent,},
  366. data() {
  367. return {
  368. expenseaaa:true,
  369. expendTitle: "新增资金使用申请单", //弹框标题
  370. operationWidth: 200, //操作单元格宽度
  371. queryFrom: {}, //查询form表单
  372. pageRequest: {
  373. // 列表查询条件
  374. pageNo: 1,
  375. pageSize: 10,
  376. },
  377. dialogFormVisible: false, //账户信息弹出框状态
  378. title: "新增账户信息", //账户信息弹框标题
  379. expenseDialog: false, //申请单显示状态
  380. pageResult: {//表格参数
  381. pageNo: 1,
  382. pageSize: 10,
  383. content: [],
  384. },
  385. formData: {
  386. outerFlag: "0", //账户类别
  387. accountName: "", //户名
  388. accountQuality: "", //账户性质
  389. bankCardNum: "", //银行卡号
  390. bank: "", //开户行
  391. bankName: "", //开户行名称
  392. bankNum: "", //开户行号
  393. certExpirationDate: "", //证书有效期
  394. clearingProfit: "", //结算卡
  395. dayStrokeNum: "", //单日转账笔数限制
  396. exteriorProfit: "", //外部过账金额
  397. fiscalProfit: "", //财税公司利润
  398. insuranceProfit: "", //保险公司回款
  399. otherProfit: "", //其他利润
  400. parkProfit: "", //园区利润
  401. priDayLines: "", //对私单日限额
  402. priSingleLines: "", //对私单笔限额
  403. priYearExcess: "", //对私年剩余额度
  404. priYearLines: "", //对私年额度
  405. pubDayLines: "", //对公单日限额
  406. pubSingleLines: "", //对公单笔限额
  407. pubYearExcess: "", //对公年剩余额度
  408. pubYearLines: "", //对公年额度
  409. tianqinProfit: "", //天勤利润
  410. },
  411. columns: [
  412. // 申请列表表格头部
  413. {
  414. prop: "transferFlagName",
  415. label: "转账状态",
  416. minWidth: 80,
  417. sortable: false,
  418. },
  419. {
  420. prop: "applicant",
  421. label: "申请人",
  422. minWidth: 80,
  423. sortable: false,
  424. },
  425. {
  426. prop: "applySector",
  427. label: "申请部门",
  428. minWidth: 100,
  429. sortable: false,
  430. },
  431. {
  432. prop: "applyTime",
  433. label: "申请日期",
  434. minWidth: 100,
  435. sortable: false,
  436. },
  437. {
  438. prop: "applyAmount",
  439. label: "申请金额(元)",
  440. minWidth: 120,
  441. sortable: false,
  442. },
  443. {
  444. prop: "bigApplyAmount",
  445. label: "大写金额",
  446. minWidth: 150,
  447. sortable: false,
  448. },
  449. {
  450. prop: "company",
  451. label: "单位",
  452. minWidth: 260,
  453. sortable: false,
  454. },
  455. {
  456. prop: "collectionMessage",
  457. label: "收款单位信息",
  458. minWidth: 260,
  459. sortable: false,
  460. },
  461. {
  462. prop: "fundFlow",
  463. label: "资金流程",
  464. minWidth: 460,
  465. sortable: false,
  466. },
  467. {
  468. prop: "fundUse",
  469. label: "资金用途",
  470. minWidth: 100,
  471. sortable: false,
  472. },
  473. {
  474. prop: "remark",
  475. label: "备注",
  476. minWidth: 100,
  477. sortable: false,
  478. },
  479. {
  480. prop: "payMethod",
  481. label: "支付方式",
  482. minWidth: 160,
  483. sortable: false,
  484. },
  485. ],
  486. pickerOptions: {
  487. //日期快捷键
  488. disabledDate(time) {
  489. return time.getTime() > Date.now();
  490. },
  491. shortcuts: [
  492. {
  493. text: "今天",
  494. onClick(picker) {
  495. picker.$emit("pick", new Date());
  496. },
  497. },
  498. {
  499. text: "昨天",
  500. onClick(picker) {
  501. const date = new Date();
  502. date.setTime(date.getTime() - 3600 * 1000 * 24);
  503. picker.$emit("pick", date);
  504. },
  505. },
  506. {
  507. text: "一周前",
  508. onClick(picker) {
  509. const date = new Date();
  510. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  511. picker.$emit("pick", date);
  512. },
  513. },
  514. ],
  515. },
  516. payment_methodsData: [], //支付方式字典数据
  517. use_fundsData: [], //备注字典数据
  518. collectionData: [], //收款单位信息数据
  519. innerCollectionData: [], //内部账户单位信息数据
  520. account_qualityData: [], //账户性质字典
  521. fundFlowData: [], //资金用途字典数据
  522. tableRules: {
  523. //资金申请单规则
  524. name: [
  525. { required: true, message: "请输入活动名称", trigger: "blur" },
  526. { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
  527. ],
  528. region: [
  529. { required: true, message: "请选择活动区域", trigger: "change" },
  530. ],
  531. date1: [
  532. {
  533. type: "date",
  534. required: true,
  535. message: "请选择日期",
  536. trigger: "change",
  537. },
  538. ],
  539. date2: [
  540. {
  541. type: "date",
  542. required: true,
  543. message: "请选择时间",
  544. trigger: "change",
  545. },
  546. ],
  547. type: [
  548. {
  549. type: "array",
  550. required: true,
  551. message: "请至少选择一个活动性质",
  552. trigger: "change",
  553. },
  554. ],
  555. resource: [
  556. { required: true, message: "请选择活动资源", trigger: "change" },
  557. ],
  558. desc: [{ required: true, message: "请填写活动形式", trigger: "blur" }],
  559. },
  560. companyItem: {}, //选择单位整条数据
  561. collectionMessageItem: {}, //选择收款单位整条数据
  562. expendDataId: "", //修改时该条数据id
  563. buttonValue: "导 出", //弹框提交按钮内容
  564. //新增申请表单form表单
  565. tableForm: {
  566. company: "", //单位
  567. applicant: "", //申请人
  568. applySector: "", //申请部门
  569. applyTime: "", //申请日期
  570. collectionMessage: "", //收款单位信息
  571. fundFlow: "", //资金流程
  572. fundUse: "", //资金用途
  573. remark: "", //备注
  574. applyAmount: "", //申请金额
  575. bigApplyAmount: "", //大写金额
  576. payMethod: [], //支付方式
  577. },
  578. };
  579. },
  580. watch: {
  581. expenseDialog(n) {
  582. if (!n) {
  583. this.tableForm = {
  584. company: "", //单位
  585. applicant: "", //申请人
  586. applySector: "", //申请部门
  587. applyTime: "", //申请日期
  588. collectionMessage: "", //收款单位信息
  589. fundFlow: "", //资金流程
  590. fundUse: "", //资金用途
  591. remark: "", //备注
  592. applyAmount: "", //申请金额
  593. bigApplyAmount: "", //大写金额
  594. payMethod: [], //支付方式
  595. };
  596. this.tableForm.payMethod = [
  597. this.payment_methodsData.find((item) => item.value == 2).label,
  598. ];
  599. this.expendDataId = "";
  600. }
  601. },
  602. },
  603. created() {
  604. this.business("use_funds"); //备注字典
  605. this.business("payment_methods"); //支付方式字典
  606. this.business("account_quality"); //账户性质字典
  607. this.getTreeList(); //获取资金用途树字典
  608. this.getAllUser(); //获取所有银行账户信息
  609. },
  610. mounted() {},
  611. methods: {
  612. //导出
  613. expendDataup(idList) {
  614. if (this.expendDataId) { //编辑查看直接导出
  615. let url = process.env.BASE_URL + "/upload/" + this.tableForm.uplodePath; // 3.创建一个临时的url指向blob对象
  616. // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
  617. let a = document.createElement("a");
  618. a.href = url;
  619. a.download = "资金使用申请单.xlsx";
  620. a.click();
  621. // 5.释放这个临时的对象url
  622. window.URL.revokeObjectURL(url);
  623. this.resetForm();
  624. this.findPage();
  625. } else { //新增并导出
  626. this.$api.expense.excel(idList).then((response) => {
  627. if (response.code == 200) {
  628. response.data.forEach((data) => {
  629. this.resetForm();
  630. this.findPage();
  631. let url = process.env.BASE_URL + "/upload/" + data.uplodePath; // 3.创建一个临时的url指向blob对象
  632. // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
  633. let a = document.createElement("a");
  634. a.href = url;
  635. a.download = "资金使用申请单.xlsx";
  636. a.click();
  637. // 5.释放这个临时的对象url
  638. window.URL.revokeObjectURL(url);
  639. });
  640. } else {
  641. this.$message.error(response.msg);
  642. }
  643. });
  644. }
  645. },
  646. //点击编辑按钮
  647. expendEdit(index) {
  648. let row = index.row;
  649. if (row.transferFlag == 0) {
  650. this.$message.error("已转账数据不能操作");
  651. return;
  652. }
  653. this.expendDataId = row.excelAccountOperateId;
  654. this.$api.expense
  655. .getAccountExcelById(row.excelAccountOperateId)
  656. .then((res) => {
  657. if (res.code == 200) {
  658. this.tableForm = JSON.parse(JSON.stringify(res.data));
  659. this.tableForm.payMethod = this.tableForm.payMethod.split(",");
  660. this.tableForm.collectionMessage = res.data.enterCardNum;
  661. this.tableForm.company = res.data.outCardNum;
  662. let obj = this.fundFlowData.find((item) =>
  663. item.child.find(
  664. (chidlItem) => chidlItem.category == this.tableForm.fundUse
  665. )
  666. );
  667. this.tableForm.fundUse = [
  668. obj.category,
  669. obj.child.find((item) => item.category == this.tableForm.fundUse)
  670. .category,
  671. ];
  672. } else {
  673. this.$message.error(res.msg);
  674. }
  675. });
  676. this.expendTitle = "编辑资金使用申请单";
  677. this.buttonValue = "确认提交";
  678. this.expenseDialog = true;
  679. },
  680. //删除数据事件
  681. expendDelete(index) {
  682. let row = index.row;
  683. if (row.transferFlag == 0) {
  684. this.$message.error("已转账数据不能操作");
  685. return;
  686. }
  687. this.$confirm("确认删除该条数据吗?", "提示", {
  688. type: "warning",
  689. })
  690. .then(() => {
  691. this.$api.expense
  692. .deleteAccountExcel(index.row.excelAccountOperateId)
  693. .then((res) => {
  694. if (res.code == 200) {
  695. this.$message.success("删除成功");
  696. this.findPage();
  697. } else {
  698. this.$message.error(res.msg);
  699. }
  700. });
  701. })
  702. .catch(() => {});
  703. },
  704. //获取资金用途树数据
  705. getTreeList() {
  706. this.$api.expense.getAccountExpensesTreeList().then((res) => {
  707. this.fundFlowData = res.data;
  708. });
  709. },
  710. //搜索列表功能
  711. queryStaffInfo() {
  712. this.findPage();
  713. },
  714. //查询列表
  715. findPage(data) {
  716. if (data && data.pageRequest) {
  717. this.pageRequest.pageNo = data.pageRequest.pageNum;
  718. this.pageRequest.pageSize = data.pageRequest.pageSize;
  719. }
  720. let obj = { ...this.queryFrom, ...this.pageRequest };
  721. this.$api.expense
  722. .getAccountExcel(obj)
  723. .then((res) => {
  724. res.data.records.forEach((element) => {
  725. element.transferFlagName =
  726. element.transferFlag == 0 ? "已转账" : "未转账";
  727. });
  728. this.pageResult = {
  729. content: res.data.records,
  730. pageNum: res.data.current,
  731. pageSize: res.data.size,
  732. totalPages: res.data.pages,
  733. totalSize: res.data.total,
  734. };
  735. })
  736. .then(data != null ? data.callback : "");
  737. },
  738. //选择证书有效日期区间
  739. setDateInterval(e) {
  740. if (e != null && e != "") {
  741. this.formData.startCertExpirationDate = e[0];
  742. this.formData.endCertExpirationDate = e[1];
  743. } else {
  744. this.formData.startCertExpirationDate = "";
  745. this.formData.endCertExpirationDate = "";
  746. }
  747. },
  748. //新增用户信息提交
  749. submitUserForm() {
  750. let params = JSON.parse(JSON.stringify(this.formData));
  751. delete params.certExpirationDate;
  752. //新增
  753. this.$api.expense.insertAccount(params).then((res) => {
  754. if (res.code == 200) {
  755. this.$message({
  756. message: "添加成功",
  757. type: "success",
  758. });
  759. } else {
  760. this.$message({
  761. message: `添加失败, ${res.msg}`,
  762. type: "error",
  763. });
  764. }
  765. this.getAllUser();
  766. this.closeForm();
  767. });
  768. },
  769. //弹框重新赋值
  770. outChange(e) {
  771. if (e == 1) {
  772. this.formData = {
  773. outerFlag: e, //账户类别
  774. accountName: this.formData.accountName, //户名
  775. accountQuality: this.formData.accountQuality, //账户性质
  776. bankCardNum: this.formData.bankCardNum, //银行卡号
  777. bank: this.formData.bank, //开户行
  778. };
  779. } else {
  780. this.formData = {
  781. outerFlag: e, //账户类别
  782. accountName: this.formData.accountName, //户名
  783. accountQuality: this.formData.accountQuality, //账户性质
  784. bankCardNum: this.formData.bankCardNum, //银行卡号
  785. bank: this.formData.bank, //开户行
  786. bankName: "", //开户行名称
  787. bankNum: "", //开户行号
  788. certExpirationDate: "", //证书有效期
  789. clearingProfit: "", //结算卡
  790. dayStrokeNum: "", //单日转账笔数限制
  791. exteriorProfit: "", //外部过账金额
  792. fiscalProfit: "", //财税公司利润
  793. insuranceProfit: "", //保险公司回款
  794. otherProfit: "", //其他利润
  795. parkProfit: "", //园区利润
  796. priDayLines: "", //对私单日限额
  797. priSingleLines: "", //对私单笔限额
  798. priYearExcess: "", //对私年剩余额度
  799. priYearLines: "", //对私年额度
  800. pubDayLines: "", //对公单日限额
  801. pubSingleLines: "", //对公单笔限额
  802. pubYearExcess: "", //对公年剩余额度
  803. pubYearLines: "", //对公年额度
  804. tianqinProfit: "", //天勤利润
  805. };
  806. }
  807. },
  808. //弹框取消重置
  809. closeForm() {
  810. this.dialogFormVisible = false;
  811. this.formData = {
  812. outerFlag: "0", //账户类别
  813. accountName: "", //户名
  814. accountQuality: "", //账户性质
  815. bankCardNum: "", //银行卡号
  816. bank: "", //开户行
  817. bankName: "", //开户行名称
  818. bankNum: "", //开户行号
  819. certExpirationDate: "", //证书有效期
  820. clearingProfit: "", //结算卡
  821. dayStrokeNum: "", //单日转账笔数限制
  822. exteriorProfit: "", //外部过账金额
  823. fiscalProfit: "", //财税公司利润
  824. insuranceProfit: "", //保险公司回款
  825. otherProfit: "", //其他利润
  826. parkProfit: "", //园区利润
  827. priDayLines: "", //对私单日限额
  828. priSingleLines: "", //对私单笔限额
  829. priYearExcess: "", //对私年剩余额度
  830. priYearLines: "", //对私年额度
  831. pubDayLines: "", //对公单日限额
  832. pubSingleLines: "", //对公单笔限额
  833. pubYearExcess: "", //对公年剩余额度
  834. pubYearLines: "", //对公年额度
  835. tianqinProfit: "", //天勤利润
  836. };
  837. },
  838. //新增账户信息
  839. addUserFn() {
  840. this.dialogFormVisible = true;
  841. },
  842. //获取所有账户信息
  843. getAllUser() {
  844. this.$api.expense.getAccountByAccountName().then((res) => {
  845. if (res.code == 200) {
  846. let arr = [];
  847. let newarr = []
  848. res.data.forEach((item, index) => {
  849. if (item.invAccountCardList != null) {
  850. item.invAccountCardList.forEach((it) => {
  851. it.name =
  852. (item.outerFlag == 0 ? "内部用户" : "外部用户") +
  853. " " +
  854. (it.accountQuality == 0 ? "公户" : "私户") +
  855. " " +
  856. item.accountName +
  857. " " +
  858. it.bankCardNum +
  859. " " +
  860. it.bank;
  861. it.nameValue =
  862. item.accountName + " " + it.bankCardNum + " " + it.bank;
  863. });
  864. arr.push(...item.invAccountCardList);
  865. //获取全部内部用户
  866. if(item.outerFlag == 0){
  867. newarr.push(...item.invAccountCardList)
  868. }
  869. }
  870. });
  871. this.innerCollectionData = newarr;
  872. this.collectionData = arr;
  873. }
  874. });
  875. },
  876. //申请金额填写完成后
  877. chageAppl(e) {
  878. this.tableForm.bigApplyAmount = toChies(this.tableForm.applyAmount);
  879. },
  880. //数据字典
  881. business(typeName) {
  882. this.$api.dict.findByLableName(typeName).then((res) => {
  883. this[typeName + "Data"] = res.data;
  884. if (typeName == "payment_methods") {
  885. this.tableForm.payMethod = [
  886. this[typeName + "Data"].find((item) => item.value == 2).label,
  887. ];
  888. }
  889. });
  890. },
  891. //费用申请弹框
  892. showExpense() {
  893. this.expendTitle = "新增资金使用申请单";
  894. this.buttonValue = "导 出";
  895. this.expenseDialog = true;
  896. },
  897. //取消隐藏弹框
  898. resetForm() {
  899. this.expenseDialog = false;
  900. },
  901. //导出事件
  902. submitForm() {
  903. let params = JSON.parse(JSON.stringify(this.tableForm));
  904. //校验
  905. if (!params.company) {
  906. this.$message.error("请选择单位");
  907. return;
  908. } else if (!params.applicant) {
  909. this.$message.error("申请人不能为空");
  910. return;
  911. } else if (!params.applySector) {
  912. this.$message.error("申请部门不能为空");
  913. return;
  914. } else if (!params.applyTime) {
  915. this.$message.error("请填写申请日期");
  916. return;
  917. } else if (!params.collectionMessage) {
  918. this.$message.error("请选择收款单位信息");
  919. return;
  920. } else if (!params.fundUse) {
  921. this.$message.error("请选择资金用途");
  922. return;
  923. } else if (params.applyAmount == 0) {
  924. this.$message.error("请填写金额");
  925. return;
  926. }
  927. params.payMethod = this.toPayment(params.payMethod); //支付方式转换
  928. let companyItem = this.collectionData.find((item) => {
  929. return item.bankCardNum === params.company;
  930. });
  931. let collectionMessageItem = this.collectionData.find(
  932. (item) => item.bankCardNum === params.collectionMessage
  933. );
  934. params.company = companyItem.nameValue; //单位
  935. params.outCardNum = companyItem.bankCardNum; //支出账户id
  936. params.outFlag = collectionMessageItem.outerFlag; //支出账户性质
  937. params.collectionMessage = collectionMessageItem.nameValue; //收入账户信息
  938. params.enterCardNum = collectionMessageItem.bankCardNum; //收入账户id
  939. params.fundUse = params.fundUse[params.fundUse.length - 1]; //资金用途
  940. params.fundFlow = params.company + "→" + params.collectionMessage; //资金流程
  941. if (this.expendDataId) {
  942. //修改
  943. params.expendDataId = this.expendDataId;
  944. this.$api.expense.update(params).then((res) => {
  945. if (res.code == 200) {
  946. this.resetForm();
  947. this.findPage();
  948. } else {
  949. this.$message.error(res.msg);
  950. }
  951. });
  952. } else {
  953. //新增+导出
  954. this.$api.expense.insert(params).then((res) => {
  955. if (res.code == 200) {
  956. this.expendDataup([res.data]);
  957. } else {
  958. this.$message.error(res.msg);
  959. }
  960. });
  961. }
  962. },
  963. //支付方式转换
  964. toPayment(list) {
  965. let newList = [];
  966. list.forEach((item) => {
  967. let newItem = this.payment_methodsData.find(
  968. (payItem) => payItem.label == item
  969. );
  970. if (newItem) {
  971. newList.push(newItem.value);
  972. }
  973. });
  974. newList.sort();
  975. newList = newList.join(",");
  976. return newList;
  977. },
  978. },
  979. };
  980. </script>
  981. <style scoped>
  982. .query-form {
  983. display: flex;
  984. align-items: center;
  985. margin-top: 14px;
  986. }
  987. .td-title,
  988. .demo-tableForm >>> .el-form-item__label {
  989. color: #323335;
  990. font-weight: bold;
  991. text-align: center;
  992. }
  993. .td-content,
  994. .demo-tableForm >>> .el-input.is-disabled .el-input__inner {
  995. color: #474545;
  996. }
  997. .expense-table >>> .el-textarea__inner,
  998. .expense-table >>> .el-input__inner {
  999. border: none;
  1000. padding: 0;
  1001. text-align: center;
  1002. }
  1003. .expense-table >>> .el-form-item {
  1004. margin: 0;
  1005. padding: 0;
  1006. }
  1007. .expense-table >>> .el-checkbox-group,
  1008. .expense-table >>> .el-date-editor,
  1009. .expense-table >>> .el-select,
  1010. .expense-table >>> .el-input-number,
  1011. .expense-table >>> .el-cascader,
  1012. .demo-tableForm >>> .el-select {
  1013. width: 100%;
  1014. text-align: center;
  1015. }
  1016. .demo-tableForm >>> .el-input__inner {
  1017. border: none;
  1018. }
  1019. .demo-tableForm >>> .el-input__prefix,
  1020. .demo-tableForm >>> .el-select__caret {
  1021. display: none;
  1022. }
  1023. .idea-box >>> .el-input.is-disabled .el-input__inner,
  1024. .expense-table >>> .el-input.is-disabled .el-input__inner {
  1025. background-color: #fff;
  1026. }
  1027. .demo-tableForm >>> .el-input-number__decrease,
  1028. .demo-tableForm >>> .el-input-number__increase {
  1029. display: none;
  1030. }
  1031. .demo-tableForm >>> .el-checkbox__input.is-disabled + span.el-checkbox__label {
  1032. color: #409eff;
  1033. }
  1034. .demo-tableForm
  1035. >>> .el-checkbox__input.is-disabled.is-checked
  1036. .el-checkbox__inner {
  1037. background-color: #409eff;
  1038. border-color: #409eff;
  1039. color: #fff;
  1040. }
  1041. .demo-tableForm
  1042. >>> .el-checkbox__input.is-disabled.is-checked
  1043. .el-checkbox__inner::after {
  1044. border-color: #fff;
  1045. }
  1046. .demo-tableForm >>> .el-input__suffix {
  1047. display: none;
  1048. }
  1049. .el-icon-right {
  1050. font-size: 20px;
  1051. }
  1052. .operation {
  1053. margin-bottom: 15px;
  1054. }
  1055. </style>