index.vue 46 KB

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