PaymentManagement.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322
  1. <template>
  2. <!--布局容器-->
  3. <div class="container" style="width: 99%; margin-top: 0px">
  4. <!-- 顶部查询 -->
  5. <el-row class="top">
  6. <el-form v-model="pageRequest" size="small" class="form" label-width="100px">
  7. <el-form-item label="发票类型" prop="invoiceType">
  8. <el-select
  9. v-model="pageRequest.invoiceType"
  10. placeholder="请选择发票类型"
  11. clearable
  12. >
  13. <el-option
  14. v-for="item in invoice_typeData"
  15. :key="item.value + 'km'"
  16. :label="item.label"
  17. :value="item.value"
  18. ></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="开票员" prop="biller">
  22. <el-input
  23. v-model="pageRequest.biller"
  24. placeholder="请输入开票员"
  25. class=""
  26. clearable
  27. ></el-input>
  28. </el-form-item>
  29. <el-form-item label="开票方" prop="invoiceBy">
  30. <el-input
  31. v-model="pageRequest.invoiceBy"
  32. placeholder="请输入开票方"
  33. class=""
  34. clearable
  35. ></el-input>
  36. </el-form-item>
  37. <el-form-item label="对方单位名称" prop="otherUnit">
  38. <el-input
  39. v-model="pageRequest.otherUnit"
  40. placeholder="请输入对方单位名称"
  41. class=""
  42. clearable
  43. ></el-input>
  44. </el-form-item>
  45. <el-form-item label="开票日期" prop="invoiceTime">
  46. <el-date-picker
  47. v-model="pageRequest.invoiceTime"
  48. type="daterange"
  49. range-separator="至"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期"
  52. value-format="yyyy-MM-dd"
  53. >
  54. </el-date-picker>
  55. </el-form-item>
  56. <el-form-item label="进账日期" prop="applyTime">
  57. <el-date-picker
  58. v-model="pageRequest.applyTime"
  59. type="daterange"
  60. range-separator="至"
  61. start-placeholder="开始日期"
  62. end-placeholder="结束日期"
  63. value-format="yyyy-MM-dd"
  64. >
  65. </el-date-picker>
  66. </el-form-item>
  67. <el-form-item
  68. ><el-button
  69. type="primary"
  70. style="margin-left: 20px"
  71. size="small"
  72. @click="queryStaffInfo"
  73. >查询</el-button
  74. >
  75. </el-form-item>
  76. <el-button
  77. class="operation"
  78. type="primary"
  79. plain
  80. size="medium"
  81. @click="addPayment"
  82. >开票新增</el-button
  83. >
  84. <el-button
  85. class="operation"
  86. type="primary"
  87. plain
  88. size="medium"
  89. @click="expentData"
  90. >导出</el-button
  91. >
  92. </el-form>
  93. <!-- 合计 -->
  94. <div style="margin-top: 20px">
  95. <el-descriptions title="" size="mini" border>
  96. <el-descriptions-item label="开票金额总和">{{
  97. allNumObj.invoiceMoneySum
  98. }}</el-descriptions-item>
  99. <el-descriptions-item label="进账金额总和">{{
  100. allNumObj.payoutMoneySum
  101. }}</el-descriptions-item>
  102. <el-descriptions-item label="未进账金额总和">{{
  103. allNumObj.notPayoutMoneySum
  104. }}</el-descriptions-item>
  105. <el-descriptions-item label="开票数总和">{{
  106. allNumObj.invoiceNumSum
  107. }}</el-descriptions-item>
  108. <el-descriptions-item label="税额总和">{{
  109. allNumObj.taxSum
  110. }}</el-descriptions-item>
  111. <el-descriptions-item label="不含税金额总和">{{
  112. allNumObj.noHasTaxSum
  113. }}</el-descriptions-item>
  114. </el-descriptions>
  115. </div>
  116. </el-row>
  117. <!-- 表格 -->
  118. <kt-common-table
  119. v-loading="loading"
  120. element-loading-text="拼命加载中..."
  121. element-loading-spinner="el-icon-loading"
  122. :operationWidth="operationWidth"
  123. class="ktTable"
  124. permsEdit="sys:agent:view"
  125. ref="dataTable"
  126. :data="pageResult"
  127. :columns="columns"
  128. :showBatchDelete="false"
  129. :showOperation="true"
  130. editButtonName="进账"
  131. button3Name="撤销"
  132. button2Name="编辑"
  133. button4Name="记录"
  134. button3Icon="fa fa-trash"
  135. button4Icon="el-icon-s-order"
  136. button4Background="#67C23A"
  137. button3Background="#f56c6c"
  138. button2Background="#E6A23C"
  139. @handleButton4="handleTableDetail"
  140. @handleButton3="handleTableDelete"
  141. @handleButton2="handleDetail($event, 1)"
  142. @handleEdit="handleDetail($event, 2)"
  143. @findPage="findPage"
  144. :isshowpagination="true"
  145. ></kt-common-table>
  146. <!-- 新增编辑弹框 -->
  147. <el-dialog
  148. class="dialog detailtTable"
  149. :title="title"
  150. :close-on-click-modal="false"
  151. :before-close="resetForm"
  152. :visible.sync="detailDialog"
  153. width="60%"
  154. >
  155. <div class="dialog-body">
  156. <el-form
  157. :model="formData"
  158. :rules="rules"
  159. ref="formData"
  160. label-width="130px"
  161. size="small"
  162. :class="formDataId ? 'data_form' : 'frame data_form'"
  163. >
  164. <div v-if="!formDataId || (typeStatus == 1 && formDataId)">
  165. <el-row>
  166. <el-col :span="12">
  167. <el-form-item label="开票方" prop="invoiceBy">
  168. <el-select
  169. v-model="formData.invoiceBy"
  170. filterable
  171. placeholder=""
  172. clearable
  173. value-key="bankCardNum"
  174. @change="companyChange"
  175. >
  176. <el-option
  177. v-for="(item, index) in collectionData"
  178. :key="index + 'kpf'"
  179. :label="item.name"
  180. :value="item"
  181. >
  182. </el-option>
  183. </el-select>
  184. </el-form-item>
  185. </el-col>
  186. <el-col :span="12">
  187. <el-form-item label="收入卡号" prop="revBankCardNum">
  188. <el-input
  189. disabled
  190. v-model="formData.revBankCardNum"
  191. autocomplete="off"
  192. ></el-input>
  193. </el-form-item>
  194. </el-col>
  195. </el-row>
  196. <el-row>
  197. <el-col :span="12">
  198. <el-form-item label="开票员" prop="biller">
  199. <el-input
  200. disabled
  201. v-model="formData.biller"
  202. autocomplete="off"
  203. ></el-input>
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="12">
  207. <el-form-item label="开票金额" prop="invoiceMoney">
  208. <el-input-number
  209. v-model="formData.invoiceMoney"
  210. :min="-99999999999999999"
  211. :max="99999999999999999"
  212. label=""
  213. ></el-input-number>
  214. </el-form-item>
  215. </el-col>
  216. </el-row>
  217. <el-row>
  218. <el-col :span="12">
  219. <el-form-item label="发票数" prop="invoiceNum">
  220. <el-input-number
  221. v-model="formData.invoiceNum"
  222. :min="0"
  223. :max="99999999999999999"
  224. label=""
  225. ></el-input-number>
  226. </el-form-item>
  227. </el-col>
  228. <el-col class="invoic" :span="12">
  229. <el-form-item label="开票科目" prop="invoiceSubjectsValue">
  230. <el-input
  231. v-model="formData.invoiceSubjects1"
  232. autocomplete="off"
  233. ></el-input>
  234. <span>*</span>
  235. <el-input
  236. v-model="formData.invoiceSubjects2"
  237. autocomplete="off"
  238. ></el-input>
  239. </el-form-item>
  240. </el-col>
  241. </el-row>
  242. <el-row>
  243. <el-col :span="12">
  244. <el-form-item label="发票类型" prop="invoiceType">
  245. <el-select
  246. v-model="formData.invoiceType"
  247. placeholder="请选择发票类型"
  248. clearable
  249. >
  250. <el-option
  251. v-for="item in invoice_typeData"
  252. :key="item.value + 'km'"
  253. :label="item.label"
  254. :value="item.value"
  255. ></el-option>
  256. </el-select>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="12">
  260. <el-form-item label="开票日期" prop="invoiceTime">
  261. <el-date-picker
  262. v-model="formData.invoiceTime"
  263. value-format="yyyy-MM-dd"
  264. type="date"
  265. placeholder="选择日期"
  266. >
  267. </el-date-picker>
  268. </el-form-item>
  269. </el-col>
  270. </el-row>
  271. <el-row>
  272. <el-col :span="12">
  273. <el-form-item label="对方单位" prop="otherUnit">
  274. <el-select
  275. v-model="formData.otherUnit"
  276. filterable
  277. placeholder=""
  278. clearable
  279. value-key="bankCardNum"
  280. @change="outherChange"
  281. >
  282. <el-option
  283. v-for="(item, index) in allCollectionData"
  284. :key="index + 'kpf'"
  285. :label="item.name"
  286. :value="item"
  287. >
  288. </el-option>
  289. </el-select>
  290. </el-form-item>
  291. </el-col>
  292. <el-col :span="12">
  293. <el-form-item label="支出卡号" prop="outBankCardNum">
  294. <el-input
  295. disabled
  296. v-model="formData.outBankCardNum"
  297. autocomplete="off"
  298. ></el-input>
  299. </el-form-item>
  300. </el-col>
  301. </el-row>
  302. <el-row>
  303. <el-col :span="12">
  304. <el-form-item label="税率(%)" prop="rate">
  305. <el-input-number
  306. v-model="formData.rate"
  307. :min="0"
  308. :max="60"
  309. label=""
  310. ></el-input-number>
  311. </el-form-item>
  312. </el-col>
  313. </el-row>
  314. </div>
  315. <div v-if="typeStatus == 2 && formDataId">
  316. <el-row>
  317. <el-col :span="12">
  318. <el-form-item label="进账金额" prop="payoutMoney">
  319. <el-input-number
  320. v-model="formData.payoutMoney"
  321. :min="1"
  322. :max="99999999999999999"
  323. label=""
  324. ></el-input-number>
  325. </el-form-item>
  326. </el-col>
  327. <el-col :span="12">
  328. <el-form-item label="进账日期" prop="payoutTime">
  329. <el-date-picker
  330. v-model="formData.payoutTime"
  331. type="date"
  332. value-format="yyyy-MM-dd"
  333. placeholder="选择日期"
  334. >
  335. </el-date-picker>
  336. </el-form-item>
  337. </el-col>
  338. </el-row>
  339. <el-row>
  340. <el-col :span="12">
  341. <el-form-item label="支付方式" prop="payMethod">
  342. <el-select
  343. v-model="formData.payMethod"
  344. multiple
  345. placeholder=""
  346. >
  347. <el-option
  348. v-for="item in payment_methodsData"
  349. :key="item.value"
  350. :label="item.label"
  351. :value="item.value"
  352. >
  353. </el-option>
  354. </el-select>
  355. </el-form-item>
  356. </el-col>
  357. <el-col :span="12">
  358. <el-form-item label="资金用途" prop="fundUse">
  359. <el-cascader
  360. v-model="formData.fundUse"
  361. :show-all-levels="true"
  362. :clearable="true"
  363. :checkStrictly="true"
  364. :emitPath="false"
  365. placeholder=""
  366. :options="fundFlowData"
  367. filterable
  368. :props="{
  369. children: 'child',
  370. label: 'category',
  371. value: 'category',
  372. checkStrictly: false,
  373. }"
  374. ></el-cascader>
  375. </el-form-item>
  376. </el-col>
  377. </el-row>
  378. <el-row>
  379. <el-col :span="12" style="text-align: center"
  380. ><h3 style="margin-left: 120px">收入方资金归属</h3>
  381. </el-col>
  382. <el-col :span="12" style="text-align: center"
  383. ><h3 style="margin-left: 120px">支出方资金归属</h3>
  384. </el-col>
  385. </el-row>
  386. <el-row class="profit_box">
  387. <el-col :span="12">
  388. <el-form-item
  389. v-for="item in affiliationData"
  390. :key="item.profitId + 'sr'"
  391. :label="item.profitName"
  392. prop="entProfit"
  393. >
  394. <el-input-number
  395. v-model="item.profit"
  396. :min="0"
  397. placeholder="请输入利润"
  398. :max="9999999999999"
  399. label=""
  400. ></el-input-number>
  401. </el-form-item>
  402. </el-col>
  403. <el-col :span="12">
  404. <el-form-item
  405. v-for="item in affiliationData2"
  406. :key="item.profitId + 'zc'"
  407. :label="item.profitName"
  408. prop="entProfit"
  409. >
  410. <el-input-number
  411. v-model="item.profit"
  412. :min="0"
  413. placeholder="请输入利润"
  414. :max="9999999999999"
  415. label=""
  416. ></el-input-number>
  417. </el-form-item>
  418. </el-col>
  419. </el-row>
  420. </div>
  421. </el-form>
  422. </div>
  423. <div slot="footer" class="dialog-footer">
  424. <el-button @click="resetForm" size="small">取 消</el-button>
  425. <el-button @click="submitInfo" type="primary" size="small">{{
  426. modelText
  427. }}</el-button>
  428. </div>
  429. </el-dialog>
  430. <!-- 记录弹框 -->
  431. <el-dialog
  432. class="dialog expendDialog"
  433. title="进账记录"
  434. :close-on-click-modal="false"
  435. :before-close="expendResetForm"
  436. :visible.sync="expendDialogVisible"
  437. width="70%"
  438. >
  439. <!-- 记录表格 -->
  440. <kt-common-table
  441. :operationWidth="130"
  442. class="ktTable expendTable"
  443. ref="expendTable"
  444. :data="expendPageResult"
  445. :columns="expendColumns"
  446. :showBatchDelete="false"
  447. :showOperation="true"
  448. button3Name="撤销"
  449. button3Icon="fa fa-trash"
  450. button3Background="#f56c6c"
  451. @handleButton3="handleTableRepeal"
  452. @findPage="getRecordData"
  453. :isshowpagination="true"
  454. ></kt-common-table>
  455. </el-dialog>
  456. </div>
  457. </template>
  458. <script>
  459. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  460. import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
  461. import { toChies } from "../../../utils/moneyTransition"; //金额小写转大写
  462. export default {
  463. name: "InvoiceInformation",
  464. components: { KtCommonTable, KtButton },
  465. created() {
  466. // this.business("subjects"); //开票科目
  467. this.business("invoice_type"); //开票类型
  468. this.business("payment_methods"); //支付方式字典
  469. this.getTreeList(); //资金用途字典数据
  470. this.getAffiliationData(); //获取归属数据
  471. },
  472. mounted() {
  473. this.getAllUser();
  474. },
  475. data() {
  476. let invoiceSubjectsRules = (rule, value, callback) => {
  477. if (!this.formData.invoiceSubjects1 || !this.formData.invoiceSubjects2) {
  478. callback(new Error("开票科目不能为空!"));
  479. } else {
  480. callback();
  481. }
  482. };
  483. return {
  484. affiliationData: [], //归属字典数据
  485. affiliationData2: [], //归属字典数据
  486. allNumObj: {}, //合计对象
  487. subjectsData: [], //开票科目数据
  488. invoice_typeData: [], //发票类型数据
  489. fundFlowData: [], //资金用途字典数据
  490. payment_methodsData: [], //支付方式数据
  491. title: "开票新增",
  492. loading: true,
  493. detailDialog: false,
  494. operationWidth: 180, //操作列宽度
  495. queryFrom: {
  496. //查询条件
  497. },
  498. pageResult: {
  499. content: [],
  500. }, //表格参数
  501. pageRequest: {
  502. // 列表查询条件
  503. pageNo: 1,
  504. pageSize: 20,
  505. invoiceTime: "", //开票日期
  506. applyTime: "", //进账日期
  507. invoiceBy: "", //开票方
  508. biller: "", //开票员
  509. invoiceType: "", //开票类型
  510. },
  511. columns: [
  512. { prop: "invoiceId", label: "发票号码", type: "text", minWidth: 160 },
  513. { prop: "invoiceNum", label: "发票数", type: "text", minWidth: 60 },
  514. { prop: "invoiceBy", label: "开票方", type: "text", minWidth: 360 },
  515. {
  516. prop: "otherUnit",
  517. label: "对方单位名称",
  518. type: "text",
  519. minWidth: 360,
  520. },
  521. {
  522. prop: "invoiceTypeName",
  523. label: "发票类型",
  524. type: "text",
  525. minWidth: 80,
  526. },
  527. {
  528. prop: "invoiceMoney",
  529. label: "开票金额",
  530. type: "text",
  531. minWidth: 100,
  532. },
  533. { prop: "invoiceTime", label: "开票日期", type: "text", minWidth: 100 },
  534. { prop: "biller", label: "开票员", type: "text", minWidth: 70 },
  535. {
  536. prop: "invoiceSubjects",
  537. label: "开票科目",
  538. type: "text",
  539. minWidth: 120,
  540. },
  541. {
  542. prop: "payoutMoney",
  543. label: "进账金额",
  544. type: "text",
  545. minWidth: 100,
  546. },
  547. {
  548. prop: "notPayoutMoney",
  549. label: "未进账金额",
  550. type: "text",
  551. minWidth: 100,
  552. },
  553. {
  554. prop: "rate",
  555. label: "税率(%)",
  556. type: "text",
  557. minWidth: 70,
  558. },
  559. {
  560. prop: "tax",
  561. label: "税额",
  562. type: "text",
  563. minWidth: 100,
  564. },
  565. {
  566. prop: "noHasTax",
  567. label: "不含税金额",
  568. type: "text",
  569. minWidth: 100,
  570. },
  571. {
  572. prop: "clearFlagName",
  573. label: "转账状态",
  574. type: "text",
  575. minWidth: 100,
  576. },
  577. ],
  578. detailData: [],
  579. detailParams: {
  580. pageNo: 1,
  581. pageSize: 20,
  582. teamOrUserFlag: "2",
  583. },
  584. modelText: "提 交",
  585. formData: {
  586. revBankCardNum: "", //收入卡号
  587. outBankCardNum: "", //支出卡号
  588. biller: "", //开票员
  589. invoiceBy: "", //开票方
  590. invoiceMoney: "", //开票金额
  591. invoiceNum: 1, //发票数
  592. invoiceSubjects: "", //开票科目
  593. invoiceSubjects1: "", //开票科目
  594. invoiceSubjects2: "", //开票科目
  595. invoiceTime: "", //开票日期
  596. invoiceType: "", //发票类型
  597. otherUnit: "", //对方单位
  598. payoutMoney: 0, //进账金额
  599. rate: 0, //税率
  600. payoutTime: "", //进账日期
  601. payMethod: [], //支付方式
  602. fundUse: "", //资金用途
  603. },
  604. rules: {
  605. //内部表单规则
  606. invoiceBy: [
  607. { required: true, message: "请选择开票方", trigger: "change" },
  608. ],
  609. invoiceMoney: [
  610. { required: true, message: "开票金额不能为空", trigger: "change" },
  611. ],
  612. invoiceNum: [
  613. { required: true, message: "发票数不能为空", trigger: "blur" },
  614. ],
  615. invoiceSubjects1: [
  616. { required: true, message: "开票科目不能为空", trigger: "change" },
  617. ],
  618. invoiceSubjectsValue: [
  619. { validator: invoiceSubjectsRules, trigger: "blur" },
  620. ],
  621. invoiceType: [
  622. { required: true, message: "请选择发票类型", trigger: "blur" },
  623. ],
  624. otherUnit: [
  625. { required: true, message: "对方单位不能为空", trigger: "blur" },
  626. ],
  627. payoutMoney: [
  628. { required: true, message: "进账金额不能为空", trigger: "blur" },
  629. ],
  630. rate: [{ required: true, message: "税率不能为空", trigger: "blur" }],
  631. payoutTime: [
  632. {
  633. required: true,
  634. message: "请选择进账日期",
  635. trigger: "change",
  636. },
  637. ],
  638. payMethod: [
  639. { required: true, message: "请选择支付方式", trigger: "change" },
  640. ],
  641. fundUse: [
  642. { required: true, message: "请选择资金用途", trigger: "change" },
  643. ],
  644. invoiceTime: [
  645. {
  646. required: true,
  647. message: "请选择开票日期",
  648. trigger: "change",
  649. },
  650. ],
  651. },
  652. collectionData: [], //所有内部账户信息列表
  653. allCollectionData: [], //所有账户信息列表
  654. formDataId: "", //编辑数据id
  655. profitObj: {},
  656. typeStatus: "", //1是编辑 2是进账
  657. /**
  658. * 记录模块
  659. */
  660. expendColumns: [
  661. //记录表格数据列
  662. {
  663. prop: "revenueOutlayName",
  664. label: "转账类型",
  665. minWidth: 80,
  666. sortable: false,
  667. },
  668. {
  669. prop: "company",
  670. label: "支出单位",
  671. minWidth: 350,
  672. sortable: false,
  673. },
  674. {
  675. prop: "payMethod",
  676. label: "支付方式",
  677. minWidth: 100,
  678. sortable: false,
  679. },
  680. {
  681. prop: "createTime",
  682. label: "支付时间",
  683. minWidth: 100,
  684. sortable: false,
  685. },
  686. { prop: "applyAmount", label: "金额", minWidth: 100, sortable: false },
  687. {
  688. prop: "fundUse",
  689. label: "资金用途",
  690. minWidth: 150,
  691. sortable: false,
  692. },
  693. {
  694. prop: "fundFen",
  695. label: "资金用途分项",
  696. minWidth: 150,
  697. sortable: false,
  698. },
  699. ],
  700. expendDialogVisible: false, //记录弹框显示状态
  701. expendPageResult: {
  702. //记录表格参数
  703. pageNo: 1,
  704. pageSize: 20,
  705. },
  706. invoiceId: "", //记录id
  707. num: 1,
  708. };
  709. },
  710. watch: {
  711. expendDialogVisible(n) {
  712. if (!n) {
  713. this.invoiceId = "";
  714. }
  715. },
  716. detailDialog(n) {
  717. if (!n) {
  718. this.formData = {
  719. revBankCardNum: "", //收入卡号
  720. outBankCardNum: "", //支出卡号
  721. biller: "", //开票员
  722. invoiceBy: "", //开票方
  723. invoiceMoney: 0, //开票金额
  724. invoiceNum: 1, //发票数
  725. invoiceSubjects: "", //开票科目
  726. invoiceTime: "", //开票日期
  727. invoiceType: "", //发票类型
  728. otherUnit: "", //对方单位
  729. payoutMoney: 0, //进账金额
  730. rate: 0, //税率
  731. payoutTime: "", //进账日期
  732. payMethod: [], //支付方式
  733. };
  734. //支出收入资金归属值清空
  735. this.affiliationData.forEach((item) => {
  736. item.profit = 0;
  737. });
  738. this.affiliationData2.forEach((item) => {
  739. item.profit = 0;
  740. });
  741. //支出收入资金归属值清空
  742. this.formDataId = "";
  743. this.$nextTick(() => {
  744. this.$refs.formData.clearValidate();
  745. });
  746. }
  747. },
  748. },
  749. methods: {
  750. /**
  751. * 撤销转账记录
  752. */
  753. handleTableRepeal(index) {
  754. let row = index.row;
  755. console.log(row);
  756. this.$confirm("确认撤销该 “"+row.revenueOutlayName+"” 记录吗?", "提示", {
  757. type: "warning",
  758. })
  759. .then(() => {
  760. this.$api.expense
  761. .accountOperateDelete(row.accountOperateId)
  762. .then((res) => {
  763. if (res.code == 200) {
  764. this.$message.success("撤销成功");
  765. this.getRecordData();
  766. } else {
  767. this.$message.error(res.msg);
  768. }
  769. });
  770. })
  771. .catch(() => {});
  772. },
  773. //记录弹框取消重置
  774. expendResetForm() {
  775. this.expendDialogVisible = false;
  776. },
  777. //获取记录列表
  778. getRecordData(data) {
  779. if (data && data.pageRequest) {
  780. this.expendPageResult.pageNo = data.pageRequest.pageNum;
  781. this.expendPageResult.pageSize = data.pageRequest.pageSize;
  782. }
  783. let obj = {
  784. pageNo: this.expendPageResult.pageNo,
  785. pageSize: this.expendPageResult.pageSize,
  786. invoiceId: this.invoiceId,
  787. };
  788. this.$api.expense
  789. .getAccountOperate(obj)
  790. .then((res) => {
  791. res.data.records.forEach((item) => {
  792. if (
  793. item.revenueOutlay != null &&
  794. item.revenueOutlay != undefined &&
  795. item.revenueOutlay != ""
  796. ) {
  797. item.revenueOutlayName =
  798. item.revenueOutlay == 0 ? "收入" : "支出";
  799. }
  800. });
  801. this.expendPageResult = {
  802. content: res.data.records,
  803. pageNo: res.data.current,
  804. pageSize: res.data.size,
  805. totalPages: res.data.pages,
  806. totalSize: res.data.total,
  807. };
  808. })
  809. .then(data != null ? data.callback : "");
  810. },
  811. //点击记录方法
  812. handleTableDetail(e) {
  813. let row = e.row;
  814. this.expendDialogVisible = true;
  815. this.invoiceId = row.invoiceId;
  816. if (this.num > 1) {
  817. //第一次渲染页面表格组件会自动调用列表方法,所以给个值判断是否是第一次渲染页面只让执行一次
  818. this.getRecordData();
  819. }
  820. this.num++;
  821. },
  822. //转换
  823. businessZh(data, label, value) {
  824. let obj = data.find((item) => item[value] == label);
  825. if (obj) {
  826. return obj;
  827. } else {
  828. return {};
  829. }
  830. },
  831. //获取归属数据
  832. getAffiliationData() {
  833. this.$api.expense.getList().then((res) => {
  834. if (res.code == 200) {
  835. res.data.forEach((item) => {
  836. item.profit = 0;
  837. });
  838. this.affiliationData = JSON.parse(JSON.stringify(res.data));
  839. this.affiliationData2 = JSON.parse(JSON.stringify(res.data));
  840. } else {
  841. this.$message.error(res.msg);
  842. }
  843. });
  844. },
  845. //导出开票记录
  846. expentData() {
  847. let params = {
  848. ...JSON.parse(JSON.stringify(this.pageRequest)),
  849. };
  850. if (params.invoiceTime != null && params.invoiceTime.length > 0) {
  851. params.invoiceTimeStart = params.invoiceTime[0];
  852. params.invoiceTimeEnd = params.invoiceTime[1];
  853. }
  854. if (params.applyTime != null && params.applyTime.length > 0) {
  855. params.applyTimeStart = params.applyTime[0];
  856. params.applyTimeEnd = params.applyTime[1];
  857. }
  858. delete params.applyTime;
  859. delete params.invoiceTime;
  860. delete params.pageNo;
  861. delete params.pageSize;
  862. this.$api.expense.invAccountExcel(params).then((res) => {
  863. if (res.code == 200) {
  864. if (res.data == null) {
  865. this.$message.error("暂无导出数据,请重试!");
  866. return;
  867. }
  868. let url = process.env.BASE_URL + "/upload/" + res.data; // 3.创建一个临时的url指向blob对象
  869. // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
  870. let a = document.createElement("a");
  871. a.href = url;
  872. a.download = "导出文件.xlsx";
  873. a.click();
  874. // 5.释放这个临时的对象url
  875. window.URL.revokeObjectURL(url);
  876. } else {
  877. this.$message.error(res.msg);
  878. }
  879. });
  880. },
  881. //获取资金用途树数据
  882. getTreeList() {
  883. this.$api.expense.getAccountExpensesTreeList().then((res) => {
  884. if (res.code == 200) {
  885. this.fundFlowData = res.data;
  886. this.fundFlowSet();
  887. } else {
  888. this.$message.error(res.msg);
  889. }
  890. });
  891. },
  892. //资金用途数据转换 如果最后一项child数组长度为0把值变为null
  893. fundFlowSet(data) {
  894. data = data || this.fundFlowData;
  895. for (var i = 0; i < data.length; i++) {
  896. if (data[i].child.length) {
  897. this.fundFlowSet(data[i].child);
  898. } else {
  899. data[i].child = null;
  900. }
  901. }
  902. },
  903. //撤销开票数据
  904. handleTableDelete(index) {
  905. let row = index.row;
  906. this.$confirm("确认撤销该记录吗?", "提示", {
  907. type: "warning",
  908. })
  909. .then(() => {
  910. this.$api.expense
  911. .deleteInvAccountIncoice(row.invoiceId)
  912. .then((res) => {
  913. if (res.code == 200) {
  914. this.$message.success("撤销成功");
  915. this.findPage();
  916. } else {
  917. this.$message.error(res.msg);
  918. }
  919. });
  920. })
  921. .catch(() => {});
  922. },
  923. //选择开票方change事件
  924. companyChange(item) {
  925. this.formData.revBankCardNum = item.bankCardNum;
  926. this.formData.biller = item.biller;
  927. this.formData.accountId = item.accountId;
  928. },
  929. //选择开票方change事件
  930. outherChange(item) {
  931. this.formData.outBankCardNum = item.bankCardNum;
  932. },
  933. //获取所有内部账户信息
  934. getAllUser() {
  935. this.$api.expense.getAccountByAccountName().then((res) => {
  936. if (res.code == 200) {
  937. let arr = [];
  938. res.data.forEach((item, index) => {
  939. if (item.invAccountCardList != null) {
  940. item.invAccountCardList.forEach((it) => {
  941. it = { ...it, ...item };
  942. it.name =
  943. (it.outerFlag == 0 ? "内部用户" : "外部用户") +
  944. " " +
  945. (it.accountQuality == 0 ? "公户" : "私户") +
  946. " " +
  947. it.accountName +
  948. " " +
  949. it.bankCardNum +
  950. " " +
  951. it.bank;
  952. it.nameValue = it.name;
  953. // it.nameValue =
  954. // it.accountName + " " + it.bankCardNum + " " + it.bank;
  955. arr.push(it);
  956. });
  957. }
  958. });
  959. let outArr = arr.filter((item) => item.outerFlag == 0);
  960. this.allCollectionData = arr;
  961. this.collectionData = outArr;
  962. }
  963. });
  964. },
  965. //数据字典
  966. business(typeName) {
  967. this.$api.dict.findByLableName(typeName).then((res) => {
  968. this[typeName + "Data"] = res.data;
  969. if (
  970. (typeName == "account_quality" || typeName == "invoice_type") &&
  971. this.pageResult.content.length == 0
  972. ) {
  973. this.findPage();
  974. }
  975. });
  976. },
  977. //新增开票
  978. addPayment() {
  979. this.title = "开票新增";
  980. this.detailDialog = true;
  981. },
  982. //新增编辑开票信息
  983. submitInfo() {
  984. let params = JSON.parse(JSON.stringify(this.formData));
  985. this.$refs.formData.validate((valid) => {
  986. if (valid) {
  987. //进账
  988. if (this.formDataId && this.typeStatus == 2) {
  989. //转化资金归属
  990. params.entProfit = {};
  991. params.outProfit = {};
  992. this.affiliationData.forEach((item) => {
  993. params.entProfit[item.profitEng] =
  994. item.profit == null ? 0 : item.profit;
  995. });
  996. this.affiliationData2.forEach((item) => {
  997. params.outProfit[item.profitEng] =
  998. item.profit == 0 || item.profit == null ? 0 : item.profit * -1;
  999. });
  1000. // this.affiliationData.forEach((item) => {
  1001. // params.entProfit[item.profitEng] = item.profit;
  1002. // });
  1003. // this.affiliationData2.forEach((item) => {
  1004. // params.outProfit[item.profitEng] = item.profit * -1;
  1005. // });
  1006. //转化资金归属
  1007. let obj = {
  1008. invoiceId: this.formDataId, //id
  1009. payoutMoney: this.formData.payoutMoney, //进账金额
  1010. fundFlow:
  1011. params.otherUnit.nameValue +
  1012. "→" +
  1013. this.formData.invoiceBy.nameValue, //资金流向
  1014. payMethod: params.payMethod.join(","), //支付方式
  1015. fundUse: this.formData.fundUse[this.formData.fundUse.length - 2], //资金用途
  1016. fundFen: this.formData.fundUse[this.formData.fundUse.length - 1], //资金用途分项
  1017. payoutTime: params.payoutTime, //进账日期
  1018. entProfit: params.entProfit, //收入方资金归属
  1019. outProfit: params.outProfit, //支出方资金归属
  1020. };
  1021. this.$api.expense.putInvAccountIncoice(obj).then((res) => {
  1022. if (res.code == 200) {
  1023. this.detailDialog = false;
  1024. this.findPage();
  1025. } else {
  1026. this.$message.error(res.msg);
  1027. }
  1028. });
  1029. //编辑
  1030. } else if (this.formDataId && this.typeStatus == 1) {
  1031. params.invoiceBy = this.formData.invoiceBy.nameValue; //开票方
  1032. // params.bigApplyAmount = toChies(params.invoiceMoney); //大写金额
  1033. params.invoiceSubjects =
  1034. params.invoiceSubjects1 + "*" + params.invoiceSubjects2; //开票科目
  1035. params.otherUnit = params.otherUnit.nameValue; //对方单位名称
  1036. params.company = params.otherUnit; //单位
  1037. delete params.payMethod;
  1038. delete params.payoutTime;
  1039. this.$api.expense.updateIncoice(params).then((res) => {
  1040. if (res.code == 200) {
  1041. this.detailDialog = false;
  1042. this.findPage();
  1043. } else {
  1044. this.$message.error(res.msg);
  1045. }
  1046. });
  1047. //新增
  1048. } else {
  1049. params.invoiceBy = this.formData.invoiceBy.nameValue; //开票方
  1050. // params.bigApplyAmount = toChies(params.invoiceMoney); //大写金额
  1051. params.invoiceSubjects =
  1052. params.invoiceSubjects1 + "*" + params.invoiceSubjects2; //开票科目
  1053. params.otherUnit = params.otherUnit.nameValue; //对方单位名称
  1054. params.company = params.otherUnit; //单位
  1055. delete params.payMethod;
  1056. delete params.payoutTime;
  1057. this.$api.expense.addInvAccountIncoice(params).then((res) => {
  1058. if (res.code == 200) {
  1059. this.detailDialog = false;
  1060. this.findPage();
  1061. } else {
  1062. this.$message.error(res.msg);
  1063. }
  1064. });
  1065. }
  1066. } else {
  1067. return false;
  1068. }
  1069. });
  1070. },
  1071. //选择时间区间
  1072. dateChange(e) {
  1073. if (e == null) {
  1074. this.pageRequest.createTimeStart = "";
  1075. this.pageRequest.createTimeEnd = "";
  1076. } else {
  1077. this.pageRequest.createTimeStart = e[0];
  1078. this.pageRequest.createTimeEnd = e[1];
  1079. }
  1080. },
  1081. // 换页刷新
  1082. refreshPageRequest: function (pageNum) {
  1083. this.detailParams.pageNo = pageNum;
  1084. this.getDetailData();
  1085. },
  1086. // 每页条数发生改变
  1087. handleSizeChange(pageSize) {
  1088. this.detailParams.pageSize = pageSize;
  1089. this.getDetailData();
  1090. },
  1091. //取消隐藏弹框
  1092. resetForm() {
  1093. this.detailDialog = false;
  1094. this.detailParams.pageNo = 1;
  1095. this.detailParams.pageSize = 20;
  1096. },
  1097. //编辑按钮
  1098. handleDetail(index, type) {
  1099. this.typeStatus = type;
  1100. let row = index.row;
  1101. if (row.invoiceMoney < 0) {
  1102. this.$message.error("对冲票据,无法进账");
  1103. return;
  1104. }
  1105. this.formDataId = row.invoiceId;
  1106. this.title = type == 1 ? "开票编辑" : "开票进账";
  1107. this.getDetailData(row.invoiceId);
  1108. this.detailDialog = true;
  1109. },
  1110. // 详情接口
  1111. getDetailData(id) {
  1112. this.$api.expense.detailInvAccountIncoice(id).then((res) => {
  1113. if (res.code == 200) {
  1114. let obj = this.collectionData.find(
  1115. (item) => item.bankCardNum == res.data.revBankCardNum
  1116. );
  1117. let obj2 = this.collectionData.find(
  1118. (item) => item.bankCardNum == res.data.outBankCardNum
  1119. );
  1120. if (obj) {
  1121. res.data.invoiceBy = obj;
  1122. }
  1123. if (obj2) {
  1124. res.data.otherUnit = obj2;
  1125. }
  1126. if (this.typeStatus == 1) {
  1127. res.data.invoiceSubjects1 = res.data.invoiceSubjects.split("*")[0];
  1128. res.data.invoiceSubjects2 = res.data.invoiceSubjects.split("*")[1];
  1129. }
  1130. this.formData = JSON.parse(JSON.stringify(res.data));
  1131. } else {
  1132. this.$message.error(res.msg);
  1133. }
  1134. });
  1135. },
  1136. //获取页面数据
  1137. findPage(data) {
  1138. this.loading = true;
  1139. if (data && data.pageRequest) {
  1140. this.pageRequest.pageNo = data.pageRequest.pageNum;
  1141. this.pageRequest.pageSize = data.pageRequest.pageSize;
  1142. }
  1143. let params = JSON.parse(JSON.stringify(this.pageRequest));
  1144. if (params.invoiceTime != null && params.invoiceTime.length > 0) {
  1145. params.invoiceTimeStart = params.invoiceTime[0];
  1146. params.invoiceTimeEnd = params.invoiceTime[1];
  1147. }
  1148. if (params.applyTime != null && params.applyTime.length > 0) {
  1149. params.applyTimeStart = params.applyTime[0];
  1150. params.applyTimeEnd = params.applyTime[1];
  1151. }
  1152. delete params.invoiceTime;
  1153. delete params.applyTime;
  1154. this.$api.expense
  1155. .getInvAccountIncoice(params)
  1156. .then((res) => {
  1157. if (res.code == 200) {
  1158. res.data.records.forEach((item) => {
  1159. item.clearFlagName = item.clearFlag == 0 ? "未清" : "已清";
  1160. item.invoiceTypeName = this.businessZh(
  1161. this.invoice_typeData,
  1162. item.invoiceType,
  1163. "value"
  1164. )
  1165. ? this.businessZh(
  1166. this.invoice_typeData,
  1167. item.invoiceType,
  1168. "value"
  1169. ).label
  1170. : "";
  1171. });
  1172. this.pageResult = {
  1173. content: res.data.records,
  1174. pageNum: res.data.current,
  1175. pageSize: res.data.size,
  1176. totalPages: res.data.pages,
  1177. totalSize: res.data.total,
  1178. };
  1179. this.allNumObj = {
  1180. invoiceMoneySum: res.data.invoiceMoneySum,
  1181. invoiceNumSum: res.data.invoiceNumSum,
  1182. noHasTaxSum: res.data.noHasTaxSum,
  1183. notPayoutMoneySum: res.data.notPayoutMoneySum,
  1184. payoutMoneySum: res.data.payoutMoneySum,
  1185. taxSum: res.data.taxSum,
  1186. };
  1187. this.loading = false;
  1188. } else {
  1189. this.$message.error(res.msg);
  1190. }
  1191. })
  1192. .then(data != null ? data.callback : "");
  1193. },
  1194. // 查询
  1195. queryStaffInfo() {
  1196. this.pageRequest.pageNo = 1;
  1197. this.pageRequest.pageSize = 20;
  1198. this.findPage();
  1199. },
  1200. },
  1201. };
  1202. </script>
  1203. <style scoped>
  1204. .operation {
  1205. margin-left: 14px !important;
  1206. margin-top: 15px !important ;
  1207. }
  1208. .form {
  1209. display: flex;
  1210. align-items: center;
  1211. margin-top: 14px;
  1212. flex-wrap: wrap;
  1213. height: 100px;
  1214. }
  1215. .el-pagination {
  1216. font-weight: normal;
  1217. }
  1218. .el-card__body {
  1219. padding: 12px !important;
  1220. }
  1221. .footer .footerdiv {
  1222. display: flex;
  1223. align-items: center;
  1224. }
  1225. .container .el-form-item {
  1226. margin-bottom: -14px !important;
  1227. }
  1228. .form .el-form-item__label {
  1229. font-size: 15px !important;
  1230. font-weight: 600 !important;
  1231. }
  1232. .ktTable {
  1233. margin-top: 20px;
  1234. }
  1235. .el-row {
  1236. margin-top: 18px;
  1237. }
  1238. .top {
  1239. margin-top: 0px;
  1240. }
  1241. .el-date-editor--daterange.el-input__inner {
  1242. width: 300px;
  1243. }
  1244. .data_form >>> .el-select--small,
  1245. .data_form >>> .el-cascader--small {
  1246. width: 100%;
  1247. }
  1248. .frame {
  1249. width: 100%;
  1250. background-color: #fff;
  1251. padding: 20px;
  1252. -webkit-box-sizing: border-box;
  1253. box-sizing: border-box;
  1254. margin-bottom: 15px;
  1255. border-radius: 6px;
  1256. border: 1px solid #ebeef5;
  1257. -webkit-transition: all 0.2s ease-in-out;
  1258. transition: all 0.2s ease-in-out;
  1259. -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  1260. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  1261. }
  1262. .dialog__body {
  1263. height: 450px;
  1264. }
  1265. .addremove-box {
  1266. width: 100%;
  1267. display: flex;
  1268. justify-content: center;
  1269. align-items: center;
  1270. font-size: 25px;
  1271. margin-top: 10px;
  1272. }
  1273. .addremove-box > i {
  1274. cursor: pointer;
  1275. }
  1276. .data_form >>> .el-date-editor {
  1277. width: 100%;
  1278. }
  1279. .detailtTable >>> .bottomFixed {
  1280. position: relative !important;
  1281. }
  1282. .detailtTable >>> .el-table__body-wrapper {
  1283. overflow-y: auto;
  1284. height: 500px;
  1285. }
  1286. .detailtTable >>> .el-dialog {
  1287. margin-top: 10vh !important;
  1288. }
  1289. .data_form >>> .el-input-number--small {
  1290. width: 100%;
  1291. }
  1292. .invoic >>> .el-input {
  1293. width: 45%;
  1294. }
  1295. .profit_box .el-form-item {
  1296. margin-bottom: 15px !important;
  1297. }
  1298. .expendDialog >>> .el-dialog__body {
  1299. overflow-y: auto;
  1300. height: 500px;
  1301. }
  1302. .expendDialog >>> .cell .el-button {
  1303. width: auto;
  1304. }
  1305. .expendTable >>> .bottomFixed {
  1306. position: static;
  1307. margin-top: 20px;
  1308. }
  1309. .expendTable >>> .el-table {
  1310. height: 400px !important;
  1311. }
  1312. .ktTable >>> .el-button span {
  1313. margin-left: 0 !important;
  1314. }
  1315. </style>