index.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183
  1. <template>
  2. <div>
  3. <basic-container v-show="isShow">
  4. <avue-crud
  5. :option="option"
  6. :table-loading="loading"
  7. :data="data"
  8. :page.sync="page"
  9. :permission="permissionList"
  10. id="out-table"
  11. :header-cell-class-name="headerClassName"
  12. :before-open="beforeOpen"
  13. v-model="form"
  14. ref="crud"
  15. @row-update="rowUpdate"
  16. @row-save="rowSave"
  17. @row-del="rowDel"
  18. @search-change="searchChange"
  19. @search-reset="searchReset"
  20. @selection-change="selectionChange"
  21. @current-change="currentChange"
  22. @size-change="sizeChange"
  23. @refresh-change="refreshChange"
  24. :search.sync="search"
  25. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 314)"
  26. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 314)"
  27. @on-load="onLoad"
  28. @expand-change="expandChange"
  29. >
  30. <template slot="expand" slot-scope="{ row }">
  31. <!-- <finstlbillsitems :tableData="row.finStlBillsItemsList" :brfalse="false"></finstlbillsitems> -->
  32. <avue-crud :data="row.finStlBillsItemsList" :option="itemOption" :cell-style="cellStyle" class="itemTable"></avue-crud>
  33. </template>
  34. <tempalte slot="feeCnNameSearch">
  35. <dic-select
  36. v-model="search.feeCnName"
  37. placeholder="费用名称"
  38. key="id"
  39. label="cnName"
  40. res="records"
  41. url="/blade-los/bfees/list"
  42. :filterable="true"
  43. :remote="true"
  44. dataName="cnName"
  45. ></dic-select>
  46. </tempalte>
  47. <template slot="menuLeft">
  48. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  49. <el-tab-pane label="草稿" :name="0"></el-tab-pane>
  50. <el-tab-pane label="处理中" :name="2"></el-tab-pane>
  51. <el-tab-pane label="已完成" :name="3"></el-tab-pane>
  52. <el-tab-pane label="已结算" :name="4"></el-tab-pane>
  53. </el-tabs>
  54. <el-button type="success" size="small" icon="el-icon-plus" plain @click="newbillFun">新建账单 </el-button>
  55. <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">一键删除 </el-button>
  56. </template>
  57. <template slot="menu" slot-scope="{ row }">
  58. <el-button type="text" size="small" @click="editFun(row)">编辑 </el-button>
  59. <!--:disabled="saberUserInfo.role_name.indexOf('允许修改他人业务') == -1?saberUserInfo.user_id != row.createUser:false"-->
  60. <el-button
  61. type="text"
  62. size="small"
  63. v-if="
  64. saberUserInfo.role_name.indexOf('admin') == -1
  65. ? saberUserInfo.role_name.indexOf('允许修改他人业务') == -1
  66. ? saberUserInfo.user_id == row.createUser
  67. : true
  68. : true
  69. "
  70. :disabled="row.status != 0"
  71. @click="rowDel(row)"
  72. >删除
  73. </el-button>
  74. </template>
  75. <template slot-scope="{ row }" slot="billNo">
  76. <span class="pointerClick" @click="editFun(row)">{{ row.billNo }} </span>
  77. </template>
  78. <template slot-scope="{ row }" slot="billStatus">
  79. <span v-if="row.billStatus == 1" style="color: #7fbb41">是</span>
  80. <span v-if="row.billStatus == 0" style="color: #d2983c">否</span>
  81. </template>
  82. </avue-crud>
  83. </basic-container>
  84. <finstlbillsDetails
  85. ref="finstlbillsDetails"
  86. v-if="!isShow"
  87. :editSave="editSave"
  88. @goBack="goBack"
  89. @toAddEdit="toAddEdit"
  90. :key="datekey"
  91. :pageIds="pageIds"
  92. >
  93. </finstlbillsDetails>
  94. </div>
  95. </template>
  96. <script>
  97. import { finstlbillsList, finstlbillsDetail, finstlbillsSubmit, finstlbillsRemove, finstlbillsitemsList } from "@/api/iosBasicData/finstlbills";
  98. import { mapGetters } from "vuex";
  99. import finstlbillsDetails from "@/views/iosBasicData/finstlbills/finstlbillsDetails.vue";
  100. import { getWorkDicts } from "@/api/system/dictbiz";
  101. import finstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
  102. import dicSelect from "@/components/dicSelect/main";
  103. export default {
  104. components: { finstlbillsitems, finstlbillsDetails, dicSelect },
  105. data() {
  106. return {
  107. activeName: 0,
  108. pageIds: [],
  109. datekey: Date.now(),
  110. search: {},
  111. // 详情页面和列表切换
  112. isShow: true,
  113. form: {},
  114. query: {},
  115. loading: true,
  116. page: {
  117. pageSize: 10,
  118. currentPage: 1,
  119. total: 0
  120. },
  121. selectionList: [],
  122. option: {},
  123. optionBack: {
  124. height: "auto",
  125. calcHeight: 30,
  126. tip: false,
  127. searchShow: true,
  128. searchMenuSpan: 6,
  129. border: true,
  130. index: true,
  131. viewBtn: true,
  132. selection: true,
  133. dialogClickModal: false,
  134. menuWidth: 100,
  135. expand: true,
  136. rowKey: "id",
  137. searchIcon: true,
  138. searchIndex: 3,
  139. column: [
  140. {
  141. label: "客户名称",
  142. prop: "corpCnName",
  143. search: true,
  144. width: "120",
  145. searchOrder: 1,
  146. overHidden: true
  147. },
  148. {
  149. label: "MB/L NO",
  150. prop: "mblno",
  151. search: true,
  152. searchOrder: 2,
  153. overHidden: true
  154. },
  155. {
  156. label: "JOB NO",
  157. prop: "businessNo",
  158. width: "120",
  159. search: true,
  160. searchOrder: 3,
  161. overHidden: true
  162. },
  163. {
  164. label: "HB/L NO",
  165. prop: "hblno",
  166. search: true,
  167. searchOrder: 4,
  168. overHidden: true
  169. },
  170. {
  171. label: "ACCT NO",
  172. prop: "accountNo",
  173. width: "100",
  174. search: true,
  175. searchOrder: 5,
  176. overHidden: true
  177. },
  178. {
  179. label: "业务类型",
  180. prop: "businessType",
  181. overHidden: true
  182. },
  183. {
  184. label: "单据编号",
  185. prop: "billNo",
  186. search: true,
  187. overHidden: true
  188. },
  189. {
  190. label: "对账日期",
  191. prop: "billDate",
  192. overHidden: true,
  193. width: "150"
  194. },
  195. {
  196. label: "业务开始日期",
  197. prop: "businessDateStart",
  198. search: true,
  199. overHidden: true,
  200. hide: true,
  201. searchLabelWidth: "100",
  202. type: "date",
  203. format: "yyyy-MM-dd",
  204. valueFormat: "yyyy-MM-dd HH:mm:ss"
  205. },
  206. {
  207. label: "业务结束日期",
  208. prop: "businessDateEnd",
  209. search: true,
  210. overHidden: true,
  211. hide: true,
  212. searchLabelWidth: "100",
  213. type: "date",
  214. format: "yyyy-MM-dd",
  215. valueFormat: "yyyy-MM-dd HH:mm:ss"
  216. },
  217. {
  218. label: "客户英文名称",
  219. prop: "corpEnName",
  220. width: "120",
  221. overHidden: true
  222. },
  223. {
  224. label: "对账单号",
  225. prop: "checkNo",
  226. search: true,
  227. width: "100",
  228. searchOrder: 6,
  229. overHidden: true
  230. },
  231. {
  232. label: "船名",
  233. prop: "vesselCnName",
  234. search: true,
  235. searchOrder: 7,
  236. overHidden: true
  237. },
  238. {
  239. label: "航次",
  240. prop: "voyageNo",
  241. search: true,
  242. searchOrder: 8,
  243. overHidden: true
  244. },
  245. // {
  246. // label: "客户是否已签约",
  247. // prop: "corpIsSigned",
  248. // width:"120",
  249. // dicData:[],
  250. // props: {
  251. // label: "dictValue",
  252. // value: "dictKey"
  253. // },
  254. // overHidden:true,
  255. // },
  256. {
  257. label: "客户约号",
  258. prop: "corpArgreementNo",
  259. overHidden: true
  260. },
  261. // {
  262. // label: "客户账期备注",
  263. // prop: "corpAccRemarks",
  264. // width:"120",
  265. // overHidden:true,
  266. // },
  267. {
  268. label: "业务类型",
  269. prop: "businessType",
  270. width: "120",
  271. overHidden: true,
  272. type: "select",
  273. multiple: true,
  274. dicData: [
  275. {
  276. label: "海运出口",
  277. value: "SE"
  278. },
  279. {
  280. label: "海运进口",
  281. value: "SI"
  282. }
  283. ]
  284. },
  285. {
  286. label: "本位币应收(CNY)",
  287. prop: "amountDr",
  288. width: "160"
  289. },
  290. {
  291. label: "本位币应付(CNY)",
  292. prop: "amountCr",
  293. width: "160"
  294. },
  295. // {
  296. // label: "综合 USD 应收(USD) - 非 USD 外币转换为 USD",
  297. // prop: "amountDrUsd",
  298. // width: "160"
  299. // },
  300. // {
  301. // label: "综合 USD 应付(USD) - 非 USD 外币转换为 USD",
  302. // prop: "amountCrUsd",
  303. // width: "160"
  304. // },
  305. {
  306. label: "合计本位币应收(CNY)",
  307. prop: "amountDrLoc",
  308. width: "160"
  309. },
  310. {
  311. label: "合计本位币应付(CNY)",
  312. prop: "amountCrLoc",
  313. width: "160"
  314. },
  315. {
  316. label: "本位币税后应收(CNY)",
  317. prop: "amountDrNet",
  318. width: "160"
  319. },
  320. {
  321. label: "本位币税后应付(CNY)",
  322. prop: "amountCrNet",
  323. width: "160"
  324. },
  325. // {
  326. // label: "综合 USD 税后应收(USD) - 非 USD 外币转换为 USD",
  327. // prop: "amountDrUsdNet",
  328. // width: "160"
  329. // },
  330. // {
  331. // label: "综合 USD 税后应付(USD) - 非 USD 外币转换为 USD",
  332. // prop: "amountCrUsdNet",
  333. // width: "160"
  334. // },
  335. {
  336. label: "合计本位币税后应收(CNY)",
  337. prop: "amountDrLocNet",
  338. width: "170"
  339. },
  340. {
  341. label: "合计本位币税后应付(CNY)",
  342. prop: "amountCrLocNet",
  343. width: "170"
  344. },
  345. {
  346. label: "业务单据编号",
  347. prop: "businessNo",
  348. width: "120",
  349. overHidden: true
  350. },
  351. {
  352. label: "账单编号",
  353. prop: "accountNo",
  354. width: "100",
  355. overHidden: true
  356. },
  357. // {
  358. // label: "对账单编号",
  359. // prop: "checkNo",
  360. // width: "100",
  361. // overHidden: true,
  362. // },
  363. // {
  364. // label: "业务所在部门",
  365. // prop: "deptName",
  366. // width: "120",
  367. // overHidden: true,
  368. // },
  369. // {
  370. // label: "业务操作",
  371. // prop: "operatorName",
  372. // width: "100",
  373. // overHidden: true,
  374. // },
  375. // {
  376. // label: "业务员",
  377. // prop: "salesName",
  378. // overHidden: true,
  379. // },
  380. // {
  381. // label: "费用收付",
  382. // prop: "dc",
  383. // search: true,
  384. // overHidden: true,
  385. // },
  386. // {
  387. // label: "币种",
  388. // prop: "curCode",
  389. // overHidden: true,
  390. // },
  391. // {
  392. // label: "中文船名",
  393. // prop: "vesselCnName",
  394. // overHidden: true,
  395. // },
  396. // {
  397. // label: "英文船名",
  398. // prop: "vesselEnName",
  399. // overHidden: true,
  400. // },
  401. // {
  402. // label: "航次",
  403. // prop: "voyageNo",
  404. // overHidden: true,
  405. // },
  406. // {
  407. // label: "财务开始日期",
  408. // prop: "accountDateFrom",
  409. // width: "140",
  410. // overHidden: true,
  411. // },
  412. // {
  413. // label: "财务结束日期",
  414. // prop: "accountDateTo",
  415. // width: "140",
  416. // overHidden: true,
  417. // },
  418. // {
  419. // label: "审核开始日期",
  420. // prop: "auditDateFrom",
  421. // width: "140",
  422. // overHidden: true,
  423. // },
  424. // {
  425. // label: "审核结束日期",
  426. // prop: "auditDateTo",
  427. // width: "140",
  428. // overHidden: true,
  429. // },
  430. // {
  431. // label: "发票号",
  432. // prop: "invoiceNo",
  433. // overHidden: true,
  434. // },
  435. // {
  436. // label: "检验检疫 NO",
  437. // prop: "iqNo",
  438. // width: "140",
  439. // overHidden: true,
  440. // },
  441. // {
  442. // label: "费用中文名称",
  443. // prop: "feeCode",
  444. // width: "140",
  445. // overHidden:true,
  446. // },
  447. // {
  448. // label: "费用名称",
  449. // prop: "feeCnName",
  450. // searchLabelWidth: "100",
  451. // width: "140",
  452. // search: true,
  453. // overHidden: true,
  454. // },
  455. // {
  456. // label: "费用英文名称",
  457. // prop: "feeEnName",
  458. // width: "140",
  459. // overHidden: true,
  460. // },
  461. {
  462. label: "是否审核",
  463. prop: "isApproved",
  464. dicData: [],
  465. props: {
  466. label: "dictValue",
  467. value: "dictKey"
  468. },
  469. overHidden: true
  470. },
  471. // {
  472. // label: "是否签收",
  473. // prop: "isSignfor",
  474. // dicData: [],
  475. // props: {
  476. // label: "dictValue",
  477. // value: "dictKey"
  478. // },
  479. // overHidden: true
  480. // },
  481. // {
  482. // label: "是否对账",
  483. // prop: "isChecked",
  484. // dicData: [],
  485. // props: {
  486. // label: "dictValue",
  487. // value: "dictKey"
  488. // },
  489. // overHidden: true
  490. // },
  491. {
  492. label: "是否生成对账",
  493. prop: "billStatus",
  494. width:100,
  495. dicData: [],
  496. props: {
  497. label: "dictValue",
  498. value: "dictKey"
  499. },
  500. overHidden: true
  501. },
  502. // {
  503. // label: "是否销账",
  504. // prop: "isCleared",
  505. // dicData: [],
  506. // props: {
  507. // label: "dictValue",
  508. // value: "dictKey"
  509. // },
  510. // overHidden: true
  511. // },
  512. // {
  513. // label: "是否开发票",
  514. // prop: "isInvoice",
  515. // dicData: [],
  516. // props: {
  517. // label: "dictValue",
  518. // value: "dictKey"
  519. // },
  520. // width: "140",
  521. // overHidden: true
  522. // },
  523. {
  524. label: "是否含税价计算",
  525. prop: "isTax",
  526. dicData: [],
  527. props: {
  528. label: "dictValue",
  529. value: "dictKey"
  530. },
  531. width: "140",
  532. overHidden: true
  533. },
  534. // {
  535. // label: "凭证类型",
  536. // prop: "voucherType",
  537. // overHidden: true,
  538. // },
  539. // {
  540. // label: "凭证号",
  541. // prop: "voucherNo",
  542. // overHidden: true,
  543. // },
  544. // {
  545. // label: "凭证日期",
  546. // prop: "voucherDate",
  547. // overHidden: true,
  548. // },
  549. {
  550. label: "备注",
  551. prop: "remarks",
  552. overHidden: true
  553. }
  554. ]
  555. },
  556. itemOption: {
  557. height: "300",
  558. header: false,
  559. index: true,
  560. menu:false,
  561. align: "center",
  562. column: [
  563. {
  564. label: "原业务编号",
  565. prop: "billNo",
  566. width: 120,
  567. overHidden: true
  568. },
  569. {
  570. label: "发票号",
  571. prop: "invoiceNo",
  572. width: 80,
  573. overHidden: true
  574. },
  575. {
  576. label: "结算单位",
  577. prop: "corpCnName",
  578. width: 120,
  579. overHidden: true
  580. },
  581. {
  582. label: "MB/L NO",
  583. prop: "mblno",
  584. width: 100,
  585. overHidden: true
  586. },
  587. {
  588. label: "本次签收CNY",
  589. prop: "currentStlAmountRMB",
  590. width: 100,
  591. overHidden: true
  592. },
  593. {
  594. label: "本次签收USD",
  595. prop: "currentStlAmountUSD",
  596. width: 100,
  597. overHidden: true
  598. },
  599. {
  600. label: "币种",
  601. prop: "currentStlCurCode",
  602. width: 60,
  603. overHidden: true
  604. },
  605. {
  606. label: "汇率",
  607. prop: "currentStlExrate",
  608. width: 80,
  609. overHidden: true
  610. },
  611. {
  612. label: "对账",
  613. prop: "isChecked",
  614. width: 60,
  615. overHidden: true,
  616. type: "select",
  617. dicData: [
  618. {
  619. label: "否",
  620. value: 0
  621. },
  622. {
  623. label: "是",
  624. value: 1
  625. }
  626. ]
  627. },
  628. {
  629. label: "签收",
  630. prop: "isSignfor",
  631. width: 60,
  632. overHidden: true,
  633. type: "select",
  634. dicData: [
  635. {
  636. label: "否",
  637. value: 0
  638. },
  639. {
  640. label: "是",
  641. value: 1
  642. }
  643. ]
  644. },
  645. {
  646. label: "发票状态",
  647. prop: "isInvoice",
  648. width: 80,
  649. type: "select",
  650. dicData: [
  651. {
  652. label: "待开发票",
  653. value: 1
  654. },
  655. {
  656. label: "确认开票",
  657. value: 2
  658. },
  659. {
  660. label: "不开发票",
  661. value: 3
  662. }
  663. ],
  664. overHidden: true
  665. },
  666. {
  667. label: "ETD",
  668. prop: "etd",
  669. width: 100,
  670. overHidden: true
  671. },
  672. {
  673. label: "账单编号",
  674. prop: "accBillNo",
  675. width: 100,
  676. overHidden: true
  677. },
  678. {
  679. label: "签收人",
  680. prop: "signforName",
  681. width: 80,
  682. overHidden: true
  683. },
  684. {
  685. label: "签收日期",
  686. prop: "signforDate",
  687. width: 100,
  688. overHidden: true
  689. },
  690. {
  691. label: "操作人",
  692. prop: "operatorName",
  693. width: 80,
  694. overHidden: true
  695. },
  696. {
  697. label: "BOOKINGNO",
  698. prop: "bookingNo",
  699. width: 100,
  700. overHidden: true
  701. },
  702. {
  703. label: "HB/L NO",
  704. prop: "hblno",
  705. width: 100,
  706. overHidden: true
  707. },
  708. {
  709. label: "船名",
  710. prop: "vesselCnName",
  711. width: 80,
  712. overHidden: true
  713. },
  714. {
  715. label: "航次",
  716. prop: "voyageNo",
  717. width: 80,
  718. overHidden: true
  719. },
  720. {
  721. label: "发票CNY",
  722. prop: "currentInvoiceAmountRMB",
  723. width: 80,
  724. overHidden: true
  725. },
  726. {
  727. label: "发票USD",
  728. prop: "currentInvoiceAmountUSD",
  729. width: 80,
  730. overHidden: true
  731. },
  732. {
  733. label: "箱量",
  734. prop: "quantityCntrTypesDescr",
  735. width: 80,
  736. overHidden: true
  737. },
  738. {
  739. label: "收付",
  740. prop: "dc",
  741. width: 60,
  742. type: "select",
  743. dicData: [
  744. {
  745. label: "收",
  746. value: "D"
  747. },
  748. {
  749. label: "付",
  750. value: "C"
  751. }
  752. ],
  753. overHidden: true
  754. },
  755. {
  756. label: "账单CNY",
  757. prop: "unsettledAmountRMB",
  758. width: 100,
  759. overHidden: true
  760. },
  761. {
  762. label: "账单USD",
  763. prop: "unsettledAmountUSD",
  764. width: 100,
  765. overHidden: true
  766. },
  767. {
  768. label: "已签收CNY",
  769. prop: "reconciliationAmount",
  770. width: 100,
  771. overHidden: true
  772. },
  773. {
  774. label: "已签收USD",
  775. prop: "reconciliationAmountUsd",
  776. width: 100,
  777. overHidden: true
  778. },
  779. {
  780. label: "已结算CNY",
  781. prop: "stlAmountDr",
  782. width: 90,
  783. overHidden: true
  784. },
  785. {
  786. label: "已结算USD",
  787. prop: "stlAmountDrUSD",
  788. width: 90,
  789. overHidden: true
  790. },
  791. {
  792. label: "业务员",
  793. prop: "srcCnName",
  794. width: 80,
  795. overHidden: true
  796. },
  797. {
  798. label: "备注",
  799. prop: "remarkss",
  800. width: 120,
  801. overHidden: true
  802. }
  803. ]
  804. },
  805. data: [],
  806. editSave: false, // 编辑保存打印状态
  807. saberUserInfo: {} // 当前登录人个人信息
  808. };
  809. },
  810. computed: {
  811. ...mapGetters(["permission"]),
  812. permissionList() {
  813. return {
  814. addBtn: this.vaildData(this.permission.finstlbills_add, false),
  815. viewBtn: this.vaildData(this.permission.finstlbills_view, false),
  816. delBtn: this.vaildData(this.permission.finstlbills_delete, false),
  817. editBtn: this.vaildData(this.permission.finstlbills_edit, false)
  818. };
  819. },
  820. ids() {
  821. let ids = [];
  822. this.selectionList.forEach(ele => {
  823. ids.push(ele.id);
  824. });
  825. return ids.join(",");
  826. }
  827. },
  828. async created() {
  829. // 获取当前登录人个人信息
  830. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
  831. this.option = await this.getColumnData(this.getColumnName(314), this.optionBack);
  832. if (this.$route.query.billId) {
  833. // 从审批里查看跳进来的
  834. this.editFun({ id: this.$route.query.billId });
  835. }
  836. this.$store.commit("DZZXF_IN_DETAIL");
  837. this.dictionaryfun(); // 获取字典数据
  838. },
  839. activated() {
  840. if (this.$route.query.id) {
  841. setTimeout(() => {
  842. this.editFun({ id: this.$route.query.id });
  843. }, 200);
  844. }
  845. },
  846. methods: {
  847. handleClick() {
  848. this.page.currentPage = 1;
  849. this.onLoad(this.page, this.query);
  850. },
  851. // 展开行
  852. expandChange(row, expendList) {
  853. finstlbillsitemsList(1, 20, { pid: row.id }).then(res => {
  854. console.log(res.data.data.records, 476);
  855. this.data[row.$index].finStlBillsItemsList = res.data.data.records.map(item => {
  856. if (item.curCode == "CNY") {
  857. this.$set(item, "amountRMB", item.amount);
  858. this.$set(item, "currentInvoiceAmountRMB", item.currentInvoiceAmount);
  859. this.$set(item, "unsettledAmountRMB", item.unsettledAmount);
  860. this.$set(item, "stlTtlAmountRMB", item.stlTtlAmount);
  861. this.$set(item, "currentStlAmountRMB", item.currentStlAmount);
  862. } else {
  863. this.$set(item, "amountUSD", item.amount);
  864. this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
  865. this.$set(item, "unsettledAmountUSD", item.unsettledAmount);
  866. this.$set(item, "stlTtlAmountUSD", item.stlTtlAmount);
  867. this.$set(item, "currentStlAmountUSD", item.currentStlAmount);
  868. }
  869. return item;
  870. });
  871. });
  872. },
  873. // 新建账单
  874. newbillFun() {
  875. this.pageIds = [];
  876. this.isShow = false;
  877. this.editSave = false;
  878. // this.$refs.finstlbillsDetails
  879. },
  880. toAddEdit() {
  881. this.datekey = Date.now();
  882. this.isShow = false;
  883. this.editSave = false;
  884. },
  885. // 编辑
  886. editFun(row) {
  887. this.pageIds = [];
  888. this.data.forEach(item => {
  889. this.pageIds.push(item.id);
  890. });
  891. this.isShow = false;
  892. this.editSave = true;
  893. this.$nextTick(() => {
  894. this.$refs.finstlbillsDetails.finstlbillsDetailfun(row.id);
  895. });
  896. },
  897. // 详情的返回列表
  898. goBack() {
  899. // 初始化数据
  900. this.pageIds = [];
  901. // this.detailData = this.$options.data().detailData;
  902. if (JSON.stringify(this.$route.query) != "{}") {
  903. this.$router.$avueRouter.closeTag();
  904. this.$router.push({
  905. path: "/iosBasicData/finstlbills/index"
  906. });
  907. }
  908. this.isShow = true;
  909. this.onLoad(this.page, this.search);
  910. },
  911. // 添加
  912. rowSave(row, done, loading) {
  913. finstlbillsSubmit(row).then(
  914. () => {
  915. this.onLoad(this.page);
  916. this.$message({
  917. type: "success",
  918. message: "操作成功!"
  919. });
  920. done();
  921. },
  922. error => {
  923. loading();
  924. window.console.log(error);
  925. }
  926. );
  927. },
  928. // 保存
  929. rowUpdate(row, index, done, loading) {
  930. finstlbillsSubmit(row).then(
  931. () => {
  932. this.onLoad(this.page);
  933. this.$message({
  934. type: "success",
  935. message: "操作成功!"
  936. });
  937. done();
  938. },
  939. error => {
  940. loading();
  941. console.log(error);
  942. }
  943. );
  944. },
  945. // 删除
  946. rowDel(row) {
  947. this.$confirm("确定将选择数据删除?", {
  948. confirmButtonText: "确定",
  949. cancelButtonText: "取消",
  950. type: "warning"
  951. })
  952. .then(() => {
  953. return finstlbillsRemove(row.id);
  954. })
  955. .then(() => {
  956. this.onLoad(this.page);
  957. this.$message({
  958. type: "success",
  959. message: "操作成功!"
  960. });
  961. });
  962. },
  963. // 批量删除
  964. handleDelete() {
  965. if (this.selectionList.length === 0) {
  966. this.$message.warning("请选择至少一条数据");
  967. return;
  968. }
  969. // 判断是否可以编辑别人业务 true 就没有权限
  970. if (this.ModifyOthersfun()) return;
  971. // 已经提交请核的提示不让删除
  972. let sumArr = [];
  973. const h = this.$createElement;
  974. for (let item of this.selectionList) {
  975. if (item.billStatus == 1) {
  976. sumArr.push(h("p", `序号${item.$index + 1}的数据已经确认对账请勿删除`));
  977. }
  978. }
  979. if (sumArr.length != 0) {
  980. this.$confirm("提示", {
  981. message: h("div", sumArr),
  982. confirmButtonText: "确定",
  983. cancelButtonText: "取消",
  984. type: "warning"
  985. });
  986. return;
  987. }
  988. this.$confirm("确定将选择数据删除?", {
  989. confirmButtonText: "确定",
  990. cancelButtonText: "取消",
  991. type: "warning"
  992. })
  993. .then(() => {
  994. return finstlbillsRemove(this.ids);
  995. })
  996. .then(() => {
  997. this.onLoad(this.page);
  998. this.$message({
  999. type: "success",
  1000. message: "操作成功!"
  1001. });
  1002. this.$refs.crud.toggleSelection();
  1003. });
  1004. },
  1005. // 判断是否可以编辑别人业务
  1006. ModifyOthersfun() {
  1007. let sumArr = [];
  1008. const h = this.$createElement;
  1009. // 判断是否有权限
  1010. if (this.saberUserInfo.role_name.indexOf("允许修改他人业务") != -1) return false;
  1011. // 当前登录人和选择的创建人对比是不是一个人
  1012. for (let item of this.selectionList) {
  1013. if (this.saberUserInfo.user_id != item.createUser) {
  1014. sumArr.push(h("p", `你没有"允许修改他人业务"权限,请重新选择数据`));
  1015. }
  1016. }
  1017. if (sumArr.length != 0) {
  1018. this.$confirm("提示", {
  1019. message: h("div", sumArr),
  1020. confirmButtonText: "确定",
  1021. cancelButtonText: "取消",
  1022. type: "warning"
  1023. }).catch(err => {});
  1024. return true;
  1025. }
  1026. },
  1027. // 详情
  1028. beforeOpen(done, type) {
  1029. if (["edit", "view"].includes(type)) {
  1030. finstlbillsDetail(this.form.id).then(res => {
  1031. this.form = res.data.data;
  1032. });
  1033. }
  1034. done();
  1035. },
  1036. searchReset() {
  1037. this.query = {};
  1038. this.onLoad(this.page);
  1039. },
  1040. // 搜索
  1041. searchChange(params, done) {
  1042. this.query = params;
  1043. this.page.currentPage = 1;
  1044. this.onLoad(this.page, params);
  1045. done();
  1046. },
  1047. selectionChange(list) {
  1048. this.selectionList = list;
  1049. },
  1050. selectionClear() {
  1051. this.selectionList = [];
  1052. this.$refs.crud.toggleSelection();
  1053. this.$refs.crud.refreshTable();
  1054. },
  1055. currentChange(currentPage) {
  1056. this.page.currentPage = currentPage;
  1057. },
  1058. sizeChange(pageSize) {
  1059. this.page.pageSize = pageSize;
  1060. },
  1061. refreshChange() {
  1062. this.onLoad(this.page, this.query);
  1063. },
  1064. onLoad(page, params = {}) {
  1065. let obj = {
  1066. ...Object.assign(params, this.query),
  1067. businessType: "CHK",
  1068. status: this.activeName != 4 ? this.activeName : "",
  1069. billStatus: this.activeName == 4 ? 1 : ""
  1070. };
  1071. this.loading = true;
  1072. finstlbillsList(page.currentPage, page.pageSize, obj).then(res => {
  1073. res.data.data.records.forEach(item => {
  1074. item.finStlBillsItemsList = [];
  1075. });
  1076. const data = res.data.data;
  1077. this.page.total = data.total;
  1078. this.data = data.records.map(item => {
  1079. item.isApproved = item.isApproved + "";
  1080. item.isSignfor = item.isSignfor + "";
  1081. item.isChecked = item.isChecked + "";
  1082. item.billStatus = item.billStatus + "";
  1083. item.isCleared = item.isCleared + "";
  1084. item.isInvoice = item.isInvoice + "";
  1085. item.isTax = item.isTax + "";
  1086. item.corpIsSigned = item.corpIsSigned + "";
  1087. return item;
  1088. });
  1089. this.loading = false;
  1090. this.selectionClear();
  1091. });
  1092. },
  1093. // 获取字典数据
  1094. dictionaryfun() {
  1095. // 全部是否
  1096. getWorkDicts("ifInvoice").then(res => {
  1097. this.findObject(this.option.column, "isApproved").dicData = res.data.data;
  1098. this.findObject(this.option.column, "isSignfor").dicData = res.data.data;
  1099. this.findObject(this.option.column, "isCleared").dicData = res.data.data;
  1100. this.findObject(this.option.column, "billStatus").dicData = res.data.data;
  1101. });
  1102. // 对账状态字典
  1103. getWorkDicts("los_check_status").then(res => {
  1104. this.findObject(this.option.column, "isChecked").dicData = res.data.data;
  1105. });
  1106. // 是否开发票
  1107. getWorkDicts("invoice_los").then(res => {
  1108. this.findObject(this.option.column, "isInvoice").dicData = res.data.data;
  1109. });
  1110. // 是否
  1111. getWorkDicts("ifInvoice").then(res => {
  1112. // this.findObject(this.option.column, "corpIsSigned").dicData = res.data.data
  1113. this.findObject(this.option.column, "isTax").dicData = res.data.data;
  1114. });
  1115. },
  1116. //自定义列保存
  1117. async saveColumnTwo(ref, option, optionBack, code) {
  1118. /**
  1119. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1120. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1121. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1122. */
  1123. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1124. if (inSave) {
  1125. this.$message.success("保存成功");
  1126. //关闭窗口
  1127. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1128. }
  1129. },
  1130. //自定义列重置
  1131. async resetColumnTwo(ref, option, optionBack, code) {
  1132. this[option] = this[optionBack];
  1133. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1134. if (inSave) {
  1135. this.$message.success("重置成功");
  1136. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1137. }
  1138. },
  1139. // 更改表格颜色
  1140. headerClassName(tab) {
  1141. //颜色间隔
  1142. let back = "";
  1143. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  1144. if (tab.columnIndex % 2 === 0) {
  1145. back = "back-one";
  1146. } else if (tab.columnIndex % 2 === 1) {
  1147. back = "back-two";
  1148. }
  1149. }
  1150. return back;
  1151. }
  1152. }
  1153. };
  1154. </script>
  1155. <style scoped>
  1156. ::v-deep#out-table .back-one {
  1157. background: #ecf5ff !important;
  1158. text-align: center;
  1159. }
  1160. ::v-deep#out-table .back-two {
  1161. background: #ecf5ff !important;
  1162. text-align: center;
  1163. }
  1164. /deep/ .el-col-md-8 {
  1165. width: 24.33333%;
  1166. }
  1167. .pointerClick {
  1168. cursor: pointer;
  1169. color: #1e9fff;
  1170. }
  1171. ::v-deep .el-table__expanded-cell[class*="cell"] {
  1172. padding: 0px 0px 0px 136px !important;
  1173. }
  1174. </style>