index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  1. <template>
  2. <div>
  3. <basic-container v-show="isShow">
  4. <div style="margin-top: 10px">
  5. <el-tabs type="card" v-model="tabsValue" @tab-click="handleClick">
  6. <el-tab-pane label="收费结算" name="CHK-D"> </el-tab-pane>
  7. <el-tab-pane label="对账付款" name="CHK-C"> </el-tab-pane>
  8. <el-tab-pane label="付费结算" name="FFSQ"> </el-tab-pane>
  9. <el-tab-pane label="销项发票" name="XXFP"> </el-tab-pane>
  10. <el-tab-pane label="其他结算" name="GZXZ"> </el-tab-pane>
  11. <el-tab-pane label="收付相抵" name="DCDD">
  12. <span slot="label">收付相抵</span>
  13. </el-tab-pane>
  14. <el-tab-pane label="业务单据" name="业务单据">
  15. <span slot="label" style="color: #4c9e44">处理中</span>
  16. </el-tab-pane>
  17. <el-tab-pane label="已完成" name="已完成"></el-tab-pane>
  18. </el-tabs>
  19. </div>
  20. <avue-crud
  21. :option="option"
  22. :table-loading="loading"
  23. :data="data"
  24. :page.sync="page"
  25. id="out-table"
  26. :header-cell-class-name="headerClassName"
  27. :before-open="beforeOpen"
  28. v-model="form"
  29. ref="crud"
  30. :search.sync="query"
  31. @row-update="rowUpdate"
  32. @row-save="rowSave"
  33. @row-del="rowDel"
  34. @search-change="searchChange"
  35. @search-reset="searchReset"
  36. @selection-change="selectionChange"
  37. @current-change="currentChange"
  38. @size-change="sizeChange"
  39. @refresh-change="refreshChange"
  40. @on-load="onLoad"
  41. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 324)"
  42. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 324)"
  43. >
  44. <template slot="menuLeft">
  45. <el-button
  46. v-if="
  47. tabsValue == 'CHK-D' || tabsValue == 'CHK-C' || tabsValue == 'FFSQ' || tabsValue == 'XXFP' || tabsValue == 'DCDD' || tabsValue == 'GZXZ'
  48. "
  49. type="primary"
  50. size="small"
  51. plain
  52. @click="chooseSettlement()"
  53. >选择结算
  54. </el-button>
  55. <el-button v-if="tabsValue == '业务单据'" type="primary" size="small" plain @click="addfun()">添加单据 </el-button>
  56. <el-button v-if="tabsValue == '业务单据'" type="danger" size="small" plain @click="handleDelete()">一键删除 </el-button>
  57. <span style="font-size: 24px;font-weight: 600;">
  58. <span style="color: #67C23A;margin-right: 10px;"> CNY:¥{{ amountSubSum.toFixed(2) }}元 </span>
  59. <span style="color: #E6A23C;"> USD:${{ amountSubUsdSum.toFixed(2) }}元 </span>
  60. </span>
  61. </template>
  62. <tempalte slot="feeCnNameSearch">
  63. <dic-select
  64. v-model="query.feeCnName"
  65. placeholder="费用名称"
  66. key="id"
  67. label="cnName"
  68. res="records"
  69. url="/blade-los/bfees/list"
  70. :filterable="true"
  71. :remote="true"
  72. dataName="cnName"
  73. ></dic-select>
  74. </tempalte>
  75. <template slot="menu" slot-scope="{ row }">
  76. <el-button
  77. v-if="tabsValue == 'DCDD'"
  78. type="text"
  79. size="small"
  80. :disabled="
  81. saberUserInfo.role_name.indexOf('admin') == -1
  82. ? saberUserInfo.role_name.indexOf('允许修改他人业务') == -1
  83. ? saberUserInfo.user_id != row.createUser
  84. : false
  85. : false
  86. "
  87. @click="revoke(row)"
  88. >驳回
  89. </el-button>
  90. <el-button
  91. v-if="
  92. tabsValue == 'CHK-D' || tabsValue == 'CHK-C' || tabsValue == 'FFSQ' || tabsValue == 'XXFP' || tabsValue == 'DCDD' || tabsValue == 'GZXZ'
  93. "
  94. type="text"
  95. size="small"
  96. :disabled="
  97. saberUserInfo.role_name.indexOf('admin') == -1
  98. ? saberUserInfo.role_name.indexOf('允许修改他人业务') == -1
  99. ? saberUserInfo.user_id != row.createUser
  100. : false
  101. : false
  102. "
  103. @click="settlementfun(row)"
  104. >结算
  105. </el-button>
  106. <el-button v-if="tabsValue == '业务单据' || tabsValue == '已完成'" type="text" size="small" @click="editfun(row)">编辑 </el-button>
  107. <!--:disabled="saberUserInfo.role_name.indexOf('允许修改他人业务') == -1?saberUserInfo.user_id != row.createUser:false"-->
  108. <el-button
  109. v-if="tabsValue == '业务单据'"
  110. type="text"
  111. size="small"
  112. :disabled="
  113. saberUserInfo.role_name.indexOf('admin') == -1
  114. ? saberUserInfo.role_name.indexOf('允许修改他人业务') == -1
  115. ? saberUserInfo.user_id != row.createUser
  116. : false
  117. : false
  118. "
  119. @click="rowDel(row)"
  120. >删除
  121. </el-button>
  122. </template>
  123. <template slot="billNo" slot-scope="{ row }">
  124. <span class="pointerClick" @click="editfun(row)">{{ row.billNo }} </span>
  125. </template>
  126. <!-- <template slot="requestNo" slot-scope="{row}">
  127. <span class="pointerClick" @click="editfun2(row)">{{ row.requestNo }}
  128. </span>
  129. </template> -->
  130. </avue-crud>
  131. </basic-container>
  132. <settlementDetails
  133. ref="settlementDetailsRef"
  134. v-if="!isShow"
  135. :editSave="editSave"
  136. @goBack="goBack"
  137. @toAddEdit="toAddEdit"
  138. :key="datekey"
  139. :pageIds="pageIds"
  140. >
  141. </settlementDetails>
  142. </div>
  143. </template>
  144. <script>
  145. import { fininvoicesList, generateFinStlBills } from "@/api/iosBasicData/fininvoices";
  146. import { finstlbillsList, finstlbillsRemove, revokeOffset } from "@/api/iosBasicData/finstlbills";
  147. import finstlbillsDetails from "@/views/iosBasicData/CollectionSettlement/finstlbillsDetails.vue";
  148. import settlementDetails from "@/views/iosBasicData/ComputationCenter/settlementDetails.vue";
  149. import { getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  150. import { bbusinesstypeList } from "@/api/iosBasicData/bbusinesstype";
  151. import dicSelect from "@/components/dicSelect/main";
  152. export default {
  153. components: { settlementDetails, dicSelect },
  154. data() {
  155. return {
  156. pageIds: [],
  157. amountSubSum: 0,
  158. amountSubUsdSum: 0,
  159. datekey: Date.now(),
  160. selectionList: [], // 多选的数据
  161. isShow: true,
  162. editSave: false, // 详情是否禁用
  163. tabsValue: "CHK", // tabs切换
  164. // 动画
  165. loading: false,
  166. // 分页
  167. page: {
  168. pageSize: 10,
  169. currentPage: 1,
  170. total: 0
  171. },
  172. query: {}, // 检索条件
  173. data: [], // 数据
  174. form: {},
  175. option: {},
  176. optionBack: {
  177. height: "auto",
  178. calcHeight: 30,
  179. tip: false,
  180. searchShow: true,
  181. searchMenuSpan: 24,
  182. searchLabelWidth: "100",
  183. border: true,
  184. index: true,
  185. selection: true,
  186. dialogClickModal: false,
  187. stripe: true,
  188. addBtn: false,
  189. viewBtn: false,
  190. delBtn: false,
  191. editBtn: false,
  192. searchIcon: true,
  193. searchIndex: 3,
  194. menuWidth: "100",
  195. column: [
  196. {
  197. label: "往来单位",
  198. prop: "corpCnName",
  199. search: true,
  200. overHidden: true,
  201. type: "select",
  202. filterable: true,
  203. remote: true,
  204. dicUrl: "/api/blade-los/bcorps/listByType?cnName={{key}}",
  205. dicData: [],
  206. searchOrder: 1,
  207. props: {
  208. label: "cnName",
  209. value: "cnName",
  210. res: "data.records"
  211. }
  212. },
  213. {
  214. label: "MB/L NO",
  215. prop: "mblno",
  216. search: true,
  217. searchOrder: 2,
  218. overHidden: true
  219. },
  220. {
  221. label: "JOB NO",
  222. prop: "businessNo",
  223. width: "120",
  224. search: true,
  225. searchOrder: 3,
  226. overHidden: true
  227. },
  228. {
  229. label: "HB/L NO",
  230. prop: "hblno",
  231. search: true,
  232. searchOrder: 4,
  233. overHidden: true
  234. },
  235. {
  236. label: "ACCT NO",
  237. prop: "accountNo",
  238. width: "100",
  239. search: true,
  240. searchOrder: 5,
  241. overHidden: true
  242. },
  243. {
  244. label: "业务类型",
  245. prop: "businessType",
  246. hide: false,
  247. overHidden: true,
  248. type: "select",
  249. dicData: [],
  250. props: {
  251. label: "cnName",
  252. value: "code"
  253. }
  254. },
  255. {
  256. label: "来源类型",
  257. prop: "srcType",
  258. overHidden: true
  259. },
  260. {
  261. label: "业务类型",
  262. prop: "type",
  263. hide: true,
  264. overHidden: true
  265. },
  266. {
  267. label: "单据编号",
  268. prop: "billNo",
  269. search: true,
  270. overHidden: true
  271. },
  272. {
  273. label: "来源单号",
  274. prop: "requestNo",
  275. search: true,
  276. overHidden: true
  277. },
  278. {
  279. label: "发票抬头",
  280. prop: "invCorpCnName",
  281. hide: true,
  282. overHidden: true
  283. },
  284. {
  285. label: "费用名称",
  286. prop: "feeCnName",
  287. search: true,
  288. overHidden: true
  289. },
  290. {
  291. label: "申请人",
  292. prop: "createUserName",
  293. overHidden: true
  294. },
  295. {
  296. label: "结算日期",
  297. prop: "billDate",
  298. overHidden: true,
  299. width: "150"
  300. },
  301. {
  302. label: "结算日期起",
  303. prop: "billDateStart",
  304. search: true,
  305. overHidden: true,
  306. hide: true,
  307. searchLabelWidth: "100",
  308. type: "date",
  309. format: "yyyy-MM-dd",
  310. valueFormat: "yyyy-MM-dd HH:mm:ss"
  311. },
  312. {
  313. label: "结算日期止",
  314. prop: "billDateEnd",
  315. search: true,
  316. overHidden: true,
  317. hide: true,
  318. searchLabelWidth: "100",
  319. type: "date",
  320. format: "yyyy-MM-dd",
  321. valueFormat: "yyyy-MM-dd HH:mm:ss"
  322. },
  323. {
  324. label: "单据开始日期",
  325. prop: "businessDateStart",
  326. search: true,
  327. overHidden: true,
  328. hide: true,
  329. searchLabelWidth: "100",
  330. type: "date",
  331. format: "yyyy-MM-dd",
  332. valueFormat: "yyyy-MM-dd HH:mm:ss"
  333. },
  334. {
  335. label: "单据结束日期",
  336. prop: "businessDateEnd",
  337. search: true,
  338. overHidden: true,
  339. hide: true,
  340. searchLabelWidth: "100",
  341. type: "date",
  342. format: "yyyy-MM-dd",
  343. valueFormat: "yyyy-MM-dd HH:mm:ss"
  344. },
  345. // {
  346. // label: "单据日期",
  347. // prop: "billDate",
  348. // search:true,
  349. // overHidden:true,
  350. // searchProp: 'billDateList',
  351. // type: "daterange",
  352. // searchRange: true,
  353. // searchDefaultTime: ["00:00:00", "23:59:59"],
  354. // format: "yyyy-MM-dd",
  355. // valueFormat: "yyyy-MM-dd HH:mm:ss"
  356. // },
  357. {
  358. label: "提交日期",
  359. prop: "auditDateFrom",
  360. width: "140",
  361. overHidden: true
  362. },
  363. {
  364. label: "审核日期",
  365. prop: "auditDateTo",
  366. width: "140",
  367. overHidden: true
  368. },
  369. {
  370. label: "收/付",
  371. prop: "dc",
  372. width: "140",
  373. search: true,
  374. type: "select",
  375. dicData: [
  376. {
  377. id: "C",
  378. name: "付款"
  379. },
  380. {
  381. id: "D",
  382. name: "收款"
  383. }
  384. ],
  385. props: {
  386. label: "name",
  387. value: "id"
  388. },
  389. overHidden: true
  390. },
  391. {
  392. label: "对账单号",
  393. prop: "checkNo",
  394. search: true,
  395. width: "100",
  396. searchOrder: 6,
  397. overHidden: true
  398. },
  399. {
  400. label: "船名",
  401. prop: "vesselCnName",
  402. search: true,
  403. searchOrder: 7,
  404. overHidden: true
  405. },
  406. {
  407. label: "航次",
  408. prop: "voyageNo",
  409. search: true,
  410. searchOrder: 8,
  411. overHidden: true
  412. },
  413. {
  414. label: "CNY",
  415. prop: "amountSub",
  416. overHidden: true
  417. },
  418. {
  419. label: "USD",
  420. prop: "amountSubUsd",
  421. overHidden: true
  422. },
  423. {
  424. label: "事由",
  425. prop: "remarks",
  426. overHidden: true
  427. }
  428. ]
  429. },
  430. saberUserInfo: {} // 当前登录人个人信息
  431. };
  432. },
  433. async created() {
  434. // 获取当前登录人个人信息
  435. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
  436. this.option = await this.getColumnData(this.getColumnName(324), this.optionBack);
  437. if (this.$route.query.billId) {
  438. // 从审批里查看跳进来的
  439. this.editFun({ id: this.$route.query.billId });
  440. }
  441. this.$store.commit("JSZX_IN_DETAIL");
  442. this.getBcorpslistByTypefun();
  443. this.bbusinesstypeListfun();
  444. },
  445. activated() {
  446. setTimeout(() => {
  447. if (this.$route.query.billNo) {
  448. this.isShow = false;
  449. this.$nextTick(() => {
  450. this.$refs.settlementDetailsRef.finstlbillsDetailfun(this.$route.query.billNo);
  451. });
  452. this.$store.commit("JSZX_IN_DETAIL");
  453. }
  454. }, 100);
  455. },
  456. methods: {
  457. // 获取业务类型
  458. bbusinesstypeListfun() {
  459. bbusinesstypeList(1, 50).then(res => {
  460. this.findObject(this.option.column, "businessType").dicData = res.data.data.records;
  461. });
  462. },
  463. // 获取往来单位数据
  464. getBcorpslistByTypefun() {
  465. getBcorpslistByType(1, 10).then(res => {
  466. this.findObject(this.option.column, "corpCnName").dicData = res.data.data.records;
  467. });
  468. },
  469. // 选择结算
  470. chooseSettlement() {
  471. if (this.selectionList.length === 0) {
  472. this.$message.warning("请选择至少一条数据");
  473. return;
  474. }
  475. this.$confirm("确定将选择数据结算?", {
  476. confirmButtonText: "确定",
  477. cancelButtonText: "取消",
  478. type: "warning"
  479. }).then(() => {
  480. let arrId = this.selectionList.map(item => {
  481. return item.id;
  482. });
  483. this.isShow = false;
  484. this.$nextTick(() => {
  485. this.$refs.settlementDetailsRef.generateFinStlBillsfun(
  486. arrId.join(","),
  487. this.tabsValue == "CHK-D" || this.tabsValue == "XXFP" || this.tabsValue == "GZXZ" ? "D" : "C",
  488. this.tabsValue
  489. );
  490. });
  491. });
  492. },
  493. revoke(row) {
  494. this.$confirm("是否撤销对抵?", {
  495. confirmButtonText: "确定",
  496. cancelButtonText: "取消",
  497. type: "warning"
  498. }).then(() => {
  499. let obj = {
  500. ...row,
  501. billDate: row.billDate ? row.billDate.slice(0, 10) + " 00:00:00" : null
  502. };
  503. revokeOffset(obj).then(res => {
  504. this.$message.success("操作成功");
  505. this.onLoad(this.page, this.search);
  506. });
  507. });
  508. },
  509. // 结算
  510. settlementfun(row) {
  511. this.isShow = false;
  512. // this.editSave = true
  513. this.$nextTick(() => {
  514. this.$refs.settlementDetailsRef.generateFinStlBillsfun(
  515. row.id,
  516. this.tabsValue == "CHK-D" || this.tabsValue == "XXFP" || this.tabsValue == "GZXZ" ? "D" : "C",
  517. this.tabsValue
  518. );
  519. });
  520. },
  521. // 添加
  522. addfun() {
  523. this.pageIds = [];
  524. this.isShow = false;
  525. this.editSave = false;
  526. },
  527. toAddEdit() {
  528. this.datekey = Date.now();
  529. this.isShow = false;
  530. this.editSave = false;
  531. },
  532. // 编辑
  533. editfun(row) {
  534. if (this.tabsValue == "FFSQ") {
  535. if (this.verifyTags("付费申请(F)")) {
  536. this.$router.push({
  537. path: `/iosBasicData/PaymentApplication/index`,
  538. query: {
  539. id: row.id
  540. }
  541. });
  542. }
  543. } else if (this.tabsValue == "CHK-D" || this.tabsValue == "CHK-C") {
  544. if (this.verifyTags("对账中心(F)")) {
  545. this.$router.push({
  546. path: `/iosBasicData/finstlbills/index`,
  547. query: {
  548. id: row.id
  549. }
  550. });
  551. }
  552. } else if (this.tabsValue == "DCDD") {
  553. if (this.verifyTags("收付相抵")) {
  554. this.$router.push({
  555. path: `/iosBasicData/dcOffset/index`,
  556. query: {
  557. id: row.id
  558. }
  559. });
  560. }
  561. } else if (this.tabsValue == "XXFP") {
  562. if (this.verifyTags("销项发票")) {
  563. this.$router.push({
  564. path: `/iosBasicData/fininvoicesOutput/index`,
  565. query: {
  566. id: row.id
  567. }
  568. });
  569. }
  570. } else if (this.tabsValue == "GZXZ") {
  571. if (this.verifyTags("挂账销账")) {
  572. this.$router.push({
  573. path: `/iosBasicData/writeOff/index`,
  574. query: {
  575. id: row.id
  576. }
  577. });
  578. }
  579. } else {
  580. this.pageIds = [];
  581. this.data.forEach(item => {
  582. this.pageIds.push(item.id);
  583. });
  584. this.isShow = false;
  585. this.editSave = true;
  586. this.$nextTick(() => {
  587. this.$refs.settlementDetailsRef.finstlbillsDetailfun(row.id);
  588. });
  589. }
  590. },
  591. // 编辑
  592. editfun2(row) {
  593. if (row.dc == "C") {
  594. if (this.$store.getters.payAppStatus) {
  595. this.$alert("付费申请页面已存在,请关闭付费申请再进行操作", "温馨提示", {
  596. confirmButtonText: "确定",
  597. type: "warning",
  598. callback: action => {}
  599. });
  600. } else {
  601. this.$router.push({
  602. path: `/iosBasicData/PaymentApplication/index`,
  603. query: {
  604. id: row.id
  605. }
  606. });
  607. }
  608. } else {
  609. if (this.$store.getters.finOutStatus) {
  610. this.$alert("销项发票页面已存在,请关闭销项发票再进行操作", "温馨提示", {
  611. confirmButtonText: "确定",
  612. type: "warning",
  613. callback: action => {}
  614. });
  615. } else {
  616. this.$router.push({
  617. path: `/iosBasicData/fininvoicesOutput/index`,
  618. query: {
  619. id: row.id
  620. }
  621. });
  622. }
  623. }
  624. },
  625. // 详情的返回列表
  626. goBack() {
  627. // 初始化数据
  628. // this.detailData = this.$options.data().detailData;
  629. if (JSON.stringify(this.$route.query) != "{}") {
  630. this.$router.$avueRouter.closeTag();
  631. this.$router.push({
  632. path: "/iosBasicData/ComputationCenter/index"
  633. });
  634. }
  635. this.isShow = true;
  636. this.onLoad(this.page, this.search);
  637. },
  638. // tabs 切换
  639. handleClick() {
  640. if (this.tabsValue == "FFSQ") {
  641. this.findObject(this.option.column, "invCorpCnName").hide = false;
  642. this.findObject(this.option.column, "type").hide = false;
  643. this.findObject(this.option.column, "businessType").hide = true;
  644. } else {
  645. this.findObject(this.option.column, "invCorpCnName").hide = true;
  646. this.findObject(this.option.column, "type").hide = true;
  647. this.findObject(this.option.column, "businessType").hide = false;
  648. }
  649. this.amountSubSum = 0;
  650. this.amountSubUsdSum = 0;
  651. // this.query = {};
  652. this.page.currentPage = 1;
  653. this.selectionList = [];
  654. this.$set(this.query, "billNo", "");
  655. this.$set(this.query, "corpCnName", "");
  656. this.$set(this.query, "businessDateStart", "");
  657. this.$set(this.query, "businessDateEnd", "");
  658. this.onLoad(this.page);
  659. },
  660. // 刷新回调
  661. refreshChange() {
  662. console.log("刷新回调");
  663. this.onLoad(this.page);
  664. },
  665. // 分页回调
  666. currentChange(currentPage) {
  667. console.log(currentPage, "分页回调");
  668. this.page.currentPage = currentPage;
  669. },
  670. sizeChange(pageSize) {
  671. console.log(pageSize, "分条回调");
  672. this.page.pageSize = pageSize;
  673. },
  674. // 多选回调
  675. selectionChange(list) {
  676. this.amountSubSum = 0;
  677. this.amountSubUsdSum = 0;
  678. if (list.length) {
  679. list.forEach(e => {
  680. this.amountSubSum += Number(e.amountSub);
  681. this.amountSubUsdSum += Number(e.amountSubUsd);
  682. });
  683. }
  684. this.selectionList = list;
  685. },
  686. // 清空回调
  687. searchReset() {
  688. console.log("清空回调");
  689. this.query = {};
  690. this.onLoad(this.page);
  691. },
  692. // 搜索回调
  693. searchChange(params, done) {
  694. console.log(params, "搜索回调");
  695. this.query = params;
  696. this.page.currentPage = 1;
  697. this.onLoad(this.page, params);
  698. done();
  699. },
  700. // 一键删除
  701. handleDelete() {
  702. if (this.selectionList.length === 0) {
  703. this.$message.warning("请选择至少一条数据");
  704. return;
  705. }
  706. // 判断是否可以编辑别人业务 true 就没有权限
  707. if (this.ModifyOthersfun()) return;
  708. this.$confirm("确定将选择数据删除?", {
  709. confirmButtonText: "确定",
  710. cancelButtonText: "取消",
  711. type: "warning"
  712. }).then(() => {
  713. let arrId = this.selectionList.map(item => {
  714. return item.id;
  715. });
  716. finstlbillsRemove(arrId.join(",")).then(res => {
  717. this.onLoad(this.page);
  718. this.$message({
  719. type: "success",
  720. message: "操作成功!"
  721. });
  722. });
  723. });
  724. },
  725. // 行删除回调
  726. rowDel(row) {
  727. console.log("行删除回调");
  728. this.$confirm("确定将选择数据删除?", {
  729. confirmButtonText: "确定",
  730. cancelButtonText: "取消",
  731. type: "warning"
  732. }).then(() => {
  733. finstlbillsRemove(row.id).then(res => {
  734. this.onLoad(this.page);
  735. this.$message({
  736. type: "success",
  737. message: "操作成功!"
  738. });
  739. });
  740. });
  741. },
  742. // 判断是否可以编辑别人业务
  743. ModifyOthersfun() {
  744. let sumArr = [];
  745. const h = this.$createElement;
  746. // 判断是否有权限
  747. if (this.saberUserInfo.role_name.indexOf("允许修改他人业务") != -1) return false;
  748. // 当前登录人和选择的创建人对比是不是一个人
  749. for (let item of this.selectionList) {
  750. if (this.saberUserInfo.user_id != item.createUser) {
  751. sumArr.push(h("p", `你没有"允许修改他人业务"权限,请重新选择数据`));
  752. }
  753. }
  754. if (sumArr.length != 0) {
  755. this.$confirm("提示", {
  756. message: h("div", sumArr),
  757. confirmButtonText: "确定",
  758. cancelButtonText: "取消",
  759. type: "warning"
  760. }).catch(err => {});
  761. return true;
  762. }
  763. },
  764. // 新增弹窗确认回调
  765. rowSave(row, done, loading) {
  766. console.log("新增弹窗确认回调");
  767. },
  768. // 编辑弹窗确认回调
  769. rowUpdate(row, index, done, loading) {
  770. console.log("编辑弹窗确认回调");
  771. done();
  772. loading();
  773. },
  774. // 打开弹窗的回调
  775. beforeOpen(done, type) {
  776. console.log(type, "打开弹窗的回调");
  777. done();
  778. },
  779. // 列表获取数据
  780. async onLoad(page, params = {}) {
  781. this.loading = true;
  782. let res = {};
  783. if (this.tabsValue == "CHK-D") {
  784. // 调用 付费申请数据
  785. res = await finstlbillsList(page.currentPage, page.pageSize, {
  786. ...Object.assign(params, this.query),
  787. businessType: "CHK",
  788. dc: "D",
  789. cashierStatus: 2,
  790. status: 3,
  791. billStatus: 0
  792. });
  793. } else if (this.tabsValue == "CHK-C") {
  794. // 调用 付费申请数据
  795. res = await finstlbillsList(page.currentPage, page.pageSize, {
  796. ...Object.assign(params, this.query),
  797. businessType: "CHK",
  798. dc: "C",
  799. cashierStatus: 2,
  800. status: 3,
  801. billStatus: 0
  802. });
  803. } else if (this.tabsValue == "FFSQ") {
  804. // 调用 销项发票业务数据
  805. res = await finstlbillsList(page.currentPage, page.pageSize, {
  806. ...Object.assign(params, this.query),
  807. businessType: "FFSQ",
  808. cashierStatus: 2,
  809. status: 3,
  810. billStatus: 0
  811. });
  812. } else if (this.tabsValue == "DCDD") {
  813. // 调用 销项发票业务数据
  814. res = await finstlbillsList(page.currentPage, page.pageSize, {
  815. ...Object.assign(params, this.query),
  816. businessType: "DCDD",
  817. status: 3,
  818. billStatus: 0
  819. });
  820. } else if (this.tabsValue == "XXFP") {
  821. // 调用 销项发票业务数据
  822. res = await fininvoicesList(page.currentPage, page.pageSize, {
  823. ...Object.assign(params, this.query),
  824. type: "销项",
  825. // cashierStatus: 2,
  826. status: 3,
  827. billStatus: 0
  828. });
  829. } else if (this.tabsValue == "GZXZ") {
  830. // 调用 销项发票业务数据
  831. res = await finstlbillsList(page.currentPage, page.pageSize, {
  832. ...Object.assign(params, this.query),
  833. businessType: "GZXZ",
  834. status: 3,
  835. billStatus: 0
  836. });
  837. } else if (this.tabsValue == "业务单据") {
  838. // 应收应付 业务数据
  839. res = await finstlbillsList(page.currentPage, page.pageSize, {
  840. ...Object.assign(params, this.query),
  841. businessType: "STL",
  842. status: 0
  843. });
  844. } else {
  845. // 应收应付 业务数据 已完成
  846. res = await finstlbillsList(page.currentPage, page.pageSize, {
  847. ...Object.assign(params, this.query),
  848. businessType: "STL",
  849. status: 3
  850. });
  851. }
  852. const data = res.data.data;
  853. this.page.total = data.total;
  854. this.data = data.records;
  855. this.loading = false;
  856. this.$refs.crud.refreshTable();
  857. },
  858. //自定义列保存
  859. async saveColumnTwo(ref, option, optionBack, code) {
  860. /**
  861. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  862. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  863. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  864. */
  865. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  866. if (inSave) {
  867. this.$message.success("保存成功");
  868. //关闭窗口
  869. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  870. }
  871. },
  872. //自定义列重置
  873. async resetColumnTwo(ref, option, optionBack, code) {
  874. this[option] = this[optionBack];
  875. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  876. if (inSave) {
  877. this.$message.success("重置成功");
  878. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  879. }
  880. },
  881. // 更改表格颜色
  882. headerClassName(tab) {
  883. //颜色间隔
  884. let back = "";
  885. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  886. if (tab.columnIndex % 2 === 0) {
  887. back = "back-one";
  888. } else if (tab.columnIndex % 2 === 1) {
  889. back = "back-two";
  890. }
  891. }
  892. return back;
  893. }
  894. }
  895. };
  896. </script>
  897. <style scoped>
  898. ::v-deep#out-table .back-one {
  899. background: #ecf5ff !important;
  900. text-align: center;
  901. }
  902. ::v-deep#out-table .back-two {
  903. background: #ecf5ff !important;
  904. text-align: center;
  905. }
  906. /deep/ .el-col-md-8 {
  907. width: 24.33333%;
  908. }
  909. .pointerClick {
  910. cursor: pointer;
  911. color: #1e9fff;
  912. }
  913. </style>