index.vue 45 KB

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