index.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. :inline="true"
  6. v-show="showSearch"
  7. label-width="120px"
  8. >
  9. <el-form-item label="申请编号" prop="fBillno">
  10. <el-input
  11. v-model="queryParams.fBillno"
  12. disabled
  13. size="small"
  14. style="width: 200px"
  15. >
  16. </el-input>
  17. </el-form-item>
  18. <el-form-item label="客户名称" prop="fCtrlcorpid">
  19. <el-select
  20. v-model="queryParams.fCtrlcorpid"
  21. filterable
  22. remote
  23. clearable
  24. disabled
  25. size="small"
  26. style="width: 200px"
  27. :remote-method="corpsRemoteMethod"
  28. >
  29. <el-option
  30. v-for="(dict, index) in fMblnoOptions"
  31. :key="index.fId"
  32. :label="dict.fName"
  33. :value="dict.fId"
  34. ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="开票单位" prop="fCorpidName">
  38. <el-select
  39. v-model="queryParams.fCorpidName"
  40. filterable
  41. remote
  42. clearable
  43. disabled
  44. size="small"
  45. style="width: 200px"
  46. :remote-method="corpsRemoteMethod"
  47. >
  48. <el-option
  49. v-for="(dict, index) in fMblnoOptions"
  50. :key="index.fId"
  51. :label="dict.fName"
  52. :value="dict.fId"
  53. ></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item label="申请人" prop="createBy">
  57. <el-input
  58. disabled
  59. v-model="queryParams.createBy"
  60. clearable
  61. style="width: 200px"
  62. size="small"
  63. />
  64. </el-form-item>
  65. <el-form-item label="金额合计(元)" prop="fAmtdr">
  66. <el-input
  67. disabled
  68. v-model="queryParams.fAmtdr"
  69. clearable
  70. style="width: 200px"
  71. size="small"
  72. >
  73. </el-input>
  74. </el-form-item>
  75. <el-form-item label="申请日期" prop="createTime">
  76. <el-input
  77. disabled
  78. v-model="queryParams.createTime"
  79. clearable
  80. size="small"
  81. style="width: 200px"
  82. />
  83. </el-form-item>
  84. <el-form-item label="税率(%)" prop="fTaxrate">
  85. <el-input
  86. disabled
  87. v-model="queryParams.fTaxrate"
  88. clearable
  89. size="small"
  90. style="width: 200px"
  91. />
  92. </el-form-item>
  93. <el-form-item label="备注" prop="remark">
  94. <el-input
  95. disabled
  96. v-model="queryParams.remark"
  97. clearable
  98. size="small"
  99. style="width: 200px"
  100. />
  101. </el-form-item>
  102. </el-form>
  103. <el-row :gutter="10" class="mb8">
  104. <el-col :span="1.5">
  105. <el-button
  106. type="primary"
  107. @click=""
  108. size="small"
  109. :disabled="doNot"
  110. >请核</el-button
  111. >
  112. </el-col>
  113. <div class="tabSetting">
  114. <right-toolbar
  115. :showSearch.sync="showSearch"
  116. ></right-toolbar>
  117. <div style="margin: 0 12px">
  118. <el-button
  119. icon="el-icon-setting"
  120. size="mini"
  121. circle
  122. @click="feeInfo ? showSetting = !showSetting : showSetting2 = !showSetting2"
  123. ></el-button>
  124. </div>
  125. </div>
  126. </el-row>
  127. <el-dialog
  128. title="自定义列显示"
  129. :visible.sync="feeInfo ? showSetting :showSetting2"
  130. width="700px"
  131. v-dialogDrag
  132. >
  133. <template slot="title">
  134. <div class="avue-crud__dialog__header">
  135. <span class="el-dialog__title">
  136. <span
  137. style="
  138. display: inline-block;
  139. width: 3px;
  140. height: 20px;
  141. margin-right: 5px;
  142. float: left;
  143. margin-top: 2px;
  144. "
  145. ></span>
  146. </span>
  147. </div>
  148. </template>
  149. <div>配置排序列数据(拖动调整顺序)</div>
  150. <div style="margin-left: 17px">
  151. <el-checkbox
  152. v-model="feeInfo ? allCheck : allCheck2"
  153. label="全选"
  154. @change="feeInfo ? allChecked : allChecked2"
  155. ></el-checkbox>
  156. </div>
  157. <div style="padding: 4px; display: flex; justify-content: center">
  158. <draggable
  159. v-model="feeInfo ? setRowList : setRowList2"
  160. group="site"
  161. animation="300"
  162. @start="onStart"
  163. @end="onEnd"
  164. handle=".indraggable"
  165. >
  166. <transition-group>
  167. <div
  168. v-for="item in feeInfo ? setRowList : setRowList2"
  169. :key="item.surface"
  170. class="listStyle"
  171. >
  172. <div style="width: 500px" class="indraggable">
  173. <div class="progress" :style="{ width: item.width + 'px' }">
  174. <el-checkbox
  175. :label="item.name"
  176. v-model="item.checked"
  177. :true-label="0"
  178. :false-label="1"
  179. >{{ item.name }}
  180. </el-checkbox>
  181. </div>
  182. </div>
  183. <el-input-number
  184. v-model.number="item.width"
  185. controls-position="right"
  186. :min="1"
  187. :max="500"
  188. size="mini"
  189. ></el-input-number>
  190. </div>
  191. </transition-group>
  192. </draggable>
  193. </div>
  194. <span slot="footer" class="dialog-footer">
  195. <el-button @click="feeInfo ? showSetting = false : showSetting2 = false">取 消</el-button>
  196. <el-button @click="delRow" type="danger">重 置</el-button>
  197. <el-button type="primary" @click="feeInfo ? save() : save2()">确 定</el-button>
  198. </span>
  199. </el-dialog>
  200. <el-menu
  201. :default-active="activeIndex"
  202. class="el-menu-demo"
  203. mode="horizontal"
  204. @select="handleSelect"
  205. text-color="#000"
  206. active-text-color="#ffd04b"
  207. style="display: flex;"
  208. >
  209. <div style="display: flex;">
  210. <el-menu-item index="1">费用信息</el-menu-item>
  211. <el-menu-item index="2">发票信息</el-menu-item>
  212. </div>
  213. </el-menu>
  214. <div style="margin:10px">
  215. <el-button
  216. type="success"
  217. size="small"
  218. @click="addList"
  219. v-if="invoiceInfo"
  220. >新行</el-button
  221. >
  222. <el-button
  223. type="success"
  224. size="small"
  225. @click="openSearch"
  226. v-if="feeInfo"
  227. :disabled="doNot"
  228. >添加</el-button
  229. >
  230. </div>
  231. <el-table
  232. v-if="feeInfo"
  233. v-loading="loading"
  234. :data="feeList"
  235. @selection-change="handleSelectionChange_s"
  236. >
  237. <el-table-column type="selection" width="55" align="center"/>
  238. <el-table-column label="序号" type="index" align="center" fixed/>
  239. <el-table-column
  240. v-for="(item, index) in getRowList"
  241. :key="index"
  242. :label="item.name"
  243. :width="item.width"
  244. :prop="item.label"
  245. align="center"
  246. :show-overflow-tooltip="true"
  247. sortable
  248. :fixed="item.fixed"
  249. />
  250. <el-table-column
  251. label="操作"
  252. align="center"
  253. class-name="small-padding fixed-width"
  254. >
  255. <template slot-scope="scope">
  256. <el-button
  257. size="mini"
  258. type="text"
  259. icon="el-icon-delete"
  260. @click.native.prevent="deleteRow(scope.$index, feeList)"
  261. >删除
  262. </el-button>
  263. </template>
  264. </el-table-column>
  265. </el-table>
  266. <el-table
  267. v-if="invoiceInfo"
  268. v-loading="loading"
  269. :data="invoiceList"
  270. @selection-change="handleSelectionChange_s"
  271. >
  272. <el-table-column type="selection" width="55" align="center"/>
  273. <el-table-column label="序号" type="index" align="center" />
  274. <el-table-column
  275. v-for="(item, index) in getRowList2"
  276. :key="index"
  277. :label="item.name"
  278. :width="item.width"
  279. :prop="item.label"
  280. align="center"
  281. sortable
  282. :fixed="item.fixed"
  283. >
  284. <template slot-scope="scope">
  285. <el-select v-model="scope.row.fFeeName" @change="changeId" v-if="item.label == 'fFeeName'">
  286. <el-option
  287. v-for="dict in fDNameOptions"
  288. :key="dict.fId"
  289. :label="dict.fName"
  290. :value="dict.fId"
  291. ></el-option>
  292. </el-select>
  293. <el-input v-model="scope.row.fModel" v-if="item.label == 'fModel'"/>
  294. <el-select v-model="scope.row.fSbu" v-if="item.label == 'fSbu'">
  295. <el-option
  296. v-for="dict in unitOptions"
  297. :key="dict.dictValue"
  298. :label="dict.dictLabel"
  299. :value="dict.dictValue"/>
  300. </el-select>
  301. <el-input v-model="scope.row.fNumber" @change="priceTotal" v-if="item.label == 'fNumber'"/>
  302. <el-input v-model="scope.row.fUnitprice" @change="priceTotal" v-if="item.label == 'fUnitprice'"/>
  303. <el-input v-model="scope.row.fMoney" disabled v-if="item.label == 'fMoney'"/>
  304. <el-input v-model="scope.row.fTaxrate" @change="priceTotal" v-if="item.label == 'fTaxrate'"/>
  305. <el-input v-model="scope.row.fTax" disabled v-if="item.label == 'fTax'"/>
  306. <el-input v-model="scope.row.fAmount" disabled v-if="item.label == 'fAmount'"/>
  307. <el-select v-model="scope.row.fStatus" v-if="item.label == 'fStatus'">
  308. <el-option label="是" value="0"/>
  309. <el-option label="否" value="1"/>
  310. </el-select>
  311. <el-input v-model="scope.row.remarks" v-if="item.label == 'remarks'"/>
  312. <el-input v-model="scope.row.createBy" disabled v-if="item.label == 'createBy'"/>
  313. <el-date-picker v-model="scope.row.createTime" style="width:100%" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-if="item.label == 'createTime'"/>
  314. <el-input v-model="scope.row.updateBy" disabled v-if="item.label == 'updateBy' && scope.row.fStatus == '0'"/>
  315. <el-date-picker v-model="scope.row.updateTime" style="width:100%" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-if="item.label == 'updateTime' && scope.row.fStatus == '0'"/>
  316. </template>
  317. </el-table-column>
  318. <el-table-column
  319. label="操作"
  320. align="center"
  321. class-name="small-padding fixed-width"
  322. >
  323. <template slot-scope="scope">
  324. <el-button
  325. size="mini"
  326. type="text"
  327. icon="el-icon-delete"
  328. @click.native.prevent="deleteRoww(scope.$index, invoiceList)"
  329. >删除
  330. </el-button>
  331. </template>
  332. </el-table-column>
  333. </el-table>
  334. <div slot="footer" class="dialog-footer" style="margin:20px;float: right">
  335. <el-button type="primary" :disabled="doNot" @click="submit">保 存</el-button>
  336. </div>
  337. </div>
  338. </template>
  339. <script>
  340. import Vue from 'vue'
  341. import Cookies from 'js-cookie'
  342. import { getVoyageName, getVesselName,getcontrastList,listChange,addPreservation } from '@/api/finance/applyForInvoice/feeDetail'
  343. import { addSet, select } from '@/api/system/set'
  344. import draggable from "vuedraggable";
  345. import { getFName, listFees } from '@/api/kaihe/domesticTrade/orderInformation'
  346. import { listCorps } from '@/api/finance/applyForInvoice/invoiceInformation'
  347. import { queryUserVal } from '@/api/warehouseBusiness/agreement'
  348. Vue.directive("dialogDrag", {
  349. bind(el, binding, vnode, oldVnode) {
  350. const dialogHeaderEl = el.querySelector(".el-dialog__header");
  351. const dragDom = el.querySelector(".el-dialog");
  352. const enlarge = el.querySelector(".enlarge");
  353. dialogHeaderEl.style.cursor = "move";
  354. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  355. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  356. if (enlarge) {
  357. enlarge.onclick = (e) => {
  358. dragDom.style.top = "0px";
  359. dragDom.style.left = "0px";
  360. };
  361. }
  362. dialogHeaderEl.onmousedown = (e) => {
  363. // 鼠标按下,计算当前元素距离可视区的距离
  364. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  365. const disY = e.clientY - dialogHeaderEl.offsetTop;
  366. // 获取到的值带px 正则匹配替换
  367. let styL, styT;
  368. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  369. if (sty.left.includes("%")) {
  370. styL =
  371. +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
  372. styT =
  373. +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
  374. } else {
  375. styL = +sty.left.replace(/\px/g, "");
  376. styT = +sty.top.replace(/\px/g, "");
  377. }
  378. document.onmousemove = function (e) {
  379. // 通过事件委托,计算移动的距离
  380. const l = e.clientX - disX;
  381. const t = e.clientY - disY;
  382. // 移动当前元素
  383. if (t + styT >= 0) {
  384. dragDom.style.top = `${t + styT}px`;
  385. }
  386. dragDom.style.left = `${l + styL}px`;
  387. // 将此时的位置传出去
  388. // binding.value({x:e.pageX,y:e.pageY})
  389. };
  390. document.onmouseup = function (e) {
  391. document.onmousemove = null;
  392. document.onmouseup = null;
  393. };
  394. };
  395. },
  396. });
  397. export default {
  398. name: 'feeDetail',
  399. components:{
  400. draggable
  401. },
  402. data(){
  403. return{
  404. Lander:null,
  405. unitOptions:[],
  406. fMblnoOptions: [],
  407. empty: [],
  408. nothing: [],
  409. pass: {
  410. fAmtdr: "", //应收合计
  411. fMblno: "", //提单号
  412. fName: "", //货权方
  413. },
  414. businessTypeOptions:[],
  415. fDNameOptions: [],
  416. nameOptions:[],
  417. doNot:false,
  418. tableDate: [
  419. {
  420. surface: "1",
  421. label: "srcBillNo",
  422. name: "业务编号",
  423. checked: 0,
  424. fixed: "left",
  425. width: 100,
  426. },
  427. {
  428. surface: "2",
  429. label: "boatName",
  430. name: "船名",
  431. checked: 0,
  432. fixed: "left",
  433. width: 100,
  434. },
  435. {
  436. surface: "3",
  437. label: "voyageName",
  438. name: "航次",
  439. checked: 0,
  440. width: 100,
  441. },
  442. {
  443. surface: "4",
  444. label: "fMblno",
  445. name: "提单号",
  446. checked: 0,
  447. width: 100,
  448. },
  449. {
  450. surface: "5",
  451. label: "fFeeName",
  452. name: "费用名称",
  453. checked: 0,
  454. width: 100,
  455. },
  456. {
  457. surface: "6",
  458. label: "fCurrency",
  459. name: "币别",
  460. checked: 0,
  461. width: 100,
  462. },
  463. {
  464. surface: "7",
  465. label: "fAmtdr",
  466. name: "金额",
  467. checked: 0,
  468. width: 100,
  469. },
  470. {
  471. surface: "8",
  472. label: "fExrate",
  473. name: "汇率",
  474. checked: 0,
  475. width: 100,
  476. },
  477. {
  478. surface: "9",
  479. label: "fBilltype",
  480. name: "业务类型",
  481. checked: 0,
  482. width: 100,
  483. },
  484. {
  485. surface: "10",
  486. label: "fStatusName",
  487. name: "状态",
  488. checked: 0,
  489. width: 100,
  490. },
  491. {
  492. surface: "11",
  493. label: "updateTime",
  494. name: "审核日期",
  495. checked: 0,
  496. width: 100,
  497. },
  498. {
  499. surface: "12",
  500. label: "remark",
  501. name: "备注",
  502. checked: 0,
  503. width: 100,
  504. }
  505. ],
  506. tableDate2: [
  507. {
  508. surface: "1",
  509. label: "fFeeName",
  510. name: "货物或应税劳务、服务名称",
  511. checked: 0,
  512. width: 100,
  513. },
  514. {
  515. surface: "2",
  516. label: "fModel",
  517. name: "规格型号",
  518. checked: 0,
  519. width: 100,
  520. },
  521. {
  522. surface: "3",
  523. label: "fSbu",
  524. name: "单位",
  525. checked: 0,
  526. width: 100,
  527. },
  528. {
  529. surface: "4",
  530. label: "fNumber",
  531. name: "数量",
  532. checked: 0,
  533. width: 100,
  534. },
  535. {
  536. surface: "5",
  537. label: "fUnitprice",
  538. name: "单价(含税)",
  539. checked: 0,
  540. width: 100,
  541. },
  542. {
  543. surface: "6",
  544. label: "fMoney",
  545. name: "金额(含税)",
  546. checked: 0,
  547. width: 100,
  548. },
  549. {
  550. surface: "7",
  551. label: "fTaxrate",
  552. name: "税率(%)",
  553. checked: 0,
  554. width: 100,
  555. },
  556. {
  557. surface: "8",
  558. label: "fTax",
  559. name: "税额",
  560. checked: 0,
  561. width: 100,
  562. },
  563. {
  564. surface: "9",
  565. label: "fAmount",
  566. name: "合计金额(元)",
  567. checked: 0,
  568. width: 100,
  569. },
  570. {
  571. surface: "10",
  572. label: "fStatus",
  573. name: "作废状态",
  574. checked: 0,
  575. width: 100,
  576. },
  577. {
  578. surface: "11",
  579. label: "remarks",
  580. name: "备注",
  581. checked: 0,
  582. width: 100,
  583. },
  584. {
  585. surface: "12",
  586. label: "createBy",
  587. name: "录入人",
  588. checked: 0,
  589. width: 100,
  590. },
  591. {
  592. surface: "13",
  593. label: "createTime",
  594. name: "录入时间",
  595. checked: 0,
  596. width: 100,
  597. },
  598. {
  599. surface: "14",
  600. label: "updateBy",
  601. name: "作废人",
  602. checked: 0,
  603. width: 100,
  604. },
  605. {
  606. surface: "15",
  607. label: "updateTime",
  608. name: "作废时间",
  609. checked: 0,
  610. width: 100,
  611. },
  612. ],
  613. setRowList: [],
  614. getRowList: [],
  615. setRowList2: [],
  616. getRowList2: [],
  617. allCheck2: false,
  618. showSetting2: false,
  619. allCheck: false,
  620. showSetting: false,
  621. queryParameter:{
  622. fCorpid:null,
  623. fMblno:null,
  624. timeExamine:null,
  625. fBusinessType:null,
  626. fVslid:null,
  627. fVoyid:null,
  628. fDc:'D',
  629. fFeeid:null,
  630. createTimeList:null
  631. },
  632. //打开内部弹窗
  633. innerVisible: false,
  634. //全屏放大
  635. dialogFull: false,
  636. // 遮罩层
  637. loading: false,
  638. activeIndex:"1",
  639. showSearch: true,
  640. feeList:[],
  641. invoiceList:[],
  642. invoiceInfo:false,
  643. feeInfo:true,
  644. queryParams:{},
  645. Fee: [],
  646. }
  647. },
  648. created(){
  649. this.setRowList = this.tableDate;
  650. this.getRowList = this.tableDate;
  651. this.setRowList2 = this.tableDate2;
  652. this.getRowList2 = this.tableDate2;
  653. this.getDicts("data_billType").then((response) => {
  654. if (response.data) {
  655. this.businessTypeOptions = response.data
  656. }
  657. });
  658. this.getDicts("data_unitfees").then((response) => {
  659. if (response.data) {
  660. this.unitOptions = response.data
  661. }
  662. });
  663. queryUserVal().then((response) => {
  664. this.Lander = response.user.userName;
  665. });
  666. this.getRow();
  667. this.nameRemoteMethod()
  668. this.corpsRemoteMethod()
  669. this.getRow2();
  670. this.feeName()
  671. },
  672. activated() {
  673. if(this.$route.query.data){
  674. let data = JSON.parse(this.$route.query.data)
  675. if(data.Num === 0){
  676. this.doNot = true
  677. }else{
  678. this.doNot = false
  679. }
  680. listChange(data.fId).then(response=>{
  681. if(response.data.tFee){
  682. this.queryParams = response.data.tFee
  683. this.$set(this.queryParams,'createTime',this.queryParams.createTime.slice(0,10))
  684. }
  685. if(response.data.feeDoList){
  686. this.feeList = response.data.feeDoList
  687. }
  688. if(response.data.tFeeInvoiceList){
  689. this.invoiceList = response.data.tFeeInvoiceList
  690. for(let item in response.data.tFeeInvoiceList){
  691. for(let li in this.invoiceList){
  692. if(this.invoiceList[li].fId == response.data.tFeeInvoiceList[item].fId){
  693. this.invoiceList[li].fSbu = response.data.tFeeInvoiceList[item].fSbu + ''
  694. }
  695. }
  696. }
  697. for(let li in this.fDNameOptions){
  698. for(let item in this.invoiceList){
  699. if(this.invoiceList[item].fFeeName == this.fDNameOptions[li].fName){
  700. this.invoiceList[item].fFeeid = this.fDNameOptions[li].fId
  701. }
  702. }
  703. }
  704. }
  705. })
  706. }
  707. },
  708. methods:{
  709. changeId(){
  710. for(let item in this.invoiceList){
  711. this.invoiceList[item].fFeeid = this.invoiceList[item].fFeeName
  712. }
  713. },
  714. //获取服务费名称
  715. feeName(){
  716. let query = { pageNum: 1, fDc: "D" };
  717. listFees(query).then((response) => {
  718. this.fDNameOptions = response.rows;
  719. });
  720. },
  721. //金额(含税)
  722. priceTotal(){
  723. for(let li in this.invoiceList){
  724. if(this.invoiceList[li].fNumber || this.invoiceList[li].fUnitprice){
  725. this.$set(this.invoiceList[li],'fMoney',(this.invoiceList[li].fNumber * this.invoiceList[li].fUnitprice).toFixed(2))
  726. }
  727. if(this.invoiceList[li].fTaxrate && this.invoiceList[li].fNumber
  728. || this.invoiceList[li].fTaxrate && this.invoiceList[li].fUnitprice
  729. || this.invoiceList[li].fNumber && this.invoiceList[li].fUnitprice){
  730. this.$set(this.invoiceList[li],'fTax',(this.invoiceList[li].fMoney * (this.invoiceList[li].fTaxrate/100)/ (1 + this.invoiceList[li].fTaxrate/100) ).toFixed(2))
  731. if(this.invoiceList[li].fMoney && this.invoiceList[li].fTax){
  732. this.$set(this.invoiceList[li],'fAmount',(this.invoiceList[li].fMoney - this.invoiceList[li].fTax).toFixed(2))
  733. }
  734. }
  735. }
  736. },
  737. /** 远程模糊查询用户 */
  738. corpsRemoteMethod(name) {
  739. if (name == null || name === "") {
  740. return false;
  741. }
  742. let queryParams = { fName: name };
  743. listCorps(queryParams).then((response) => {
  744. this.fMblnoOptions = response;
  745. });
  746. },
  747. changeTime(){
  748. this.queryParameter.createTimeList[0] = this.queryParameter.createTimeList[0]+" 00:00:00"
  749. this.queryParameter.createTimeList[1] = this.queryParameter.createTimeList[1]+" 23:59:59"
  750. },
  751. timeMethods(){
  752. this.queryParameter.timeExamine[0] = this.queryParameter.timeExamine[0]+" 00:00:00"
  753. this.queryParameter.timeExamine[1] = this.queryParameter.timeExamine[1]+" 23:59:59"
  754. },
  755. openSearch(){
  756. let res = {}
  757. let fSrcpid = []
  758. let fSrcid = []
  759. console.log(this.feeList)
  760. for(let li in this.feeList){
  761. fSrcpid.push(this.feeList[li].fSrcpid)
  762. fSrcpid = Array.from(new Set(fSrcpid))
  763. fSrcid.push(this.feeList[li].fSrcid)
  764. }
  765. res = {
  766. fSrcid:fSrcid,
  767. fSrcpid:fSrcpid,
  768. fCorpid:this.queryParams.fCorpidName,
  769. billsType:this.queryParams.fBilltype,
  770. fId:this.queryParams.fId
  771. }
  772. this.$router.push({
  773. path:'/finance/generalLedger',
  774. query:{ data:JSON.stringify(res) }
  775. })
  776. },
  777. //获取客户名称下拉
  778. nameRemoteMethod(){
  779. let queryParams = { pageNum: 1 }
  780. getFName(queryParams).then(response=>{
  781. this.nameOptions = response.data
  782. })
  783. },
  784. submit(){
  785. if(this.invoiceList[0].fTaxrate){
  786. this.queryParams.fTaxrate = this.invoiceList[0].fTaxrate
  787. }
  788. let formData = new window.FormData()
  789. formData.append('tFee',JSON.stringify(this.queryParams))
  790. formData.append('tFeeDo',JSON.stringify(this.feeList))
  791. formData.append('billsType',this.queryParams.fBilltype)
  792. formData.append('tFeeInvoice',JSON.stringify(this.invoiceList))
  793. addPreservation(formData).then(response=>{
  794. this.$message.success("操作成功")
  795. })
  796. },
  797. //列设置全选
  798. allChecked() {
  799. if (this.allCheck == true) {
  800. this.setRowList.map((e) => {
  801. return (e.checked = 0);
  802. });
  803. } else {
  804. this.setRowList.map((e) => {
  805. return (e.checked = 1);
  806. });
  807. }
  808. },
  809. //查询列数据
  810. getRow() {
  811. let that = this;
  812. this.data = {
  813. tableName: "费用信息",
  814. userId: Cookies.get("userName"),
  815. };
  816. select(this.data).then((res) => {
  817. if (res.data.length != 0) {
  818. this.getRowList = res.data.filter((e) => e.checked == 0);
  819. this.setRowList = res.data;
  820. this.setRowList = this.setRowList.reduce((res, item) => {
  821. res.push({
  822. surface: item.surface,
  823. label: item.label,
  824. name: item.name,
  825. checked: item.checked,
  826. width: item.width,
  827. fixed: item.fixed,
  828. });
  829. return res;
  830. }, []);
  831. }
  832. });
  833. },
  834. //保存列设置
  835. save() {
  836. this.showSetting = false;
  837. this.data = {
  838. tableName: "费用信息",
  839. userId: Cookies.get("userName"),
  840. sysTableSetList: this.setRowList,
  841. };
  842. addSet(this.data).then((res) => {
  843. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  844. });
  845. },
  846. //重置列表
  847. delRow() {
  848. this.data = {
  849. tableName: "费用信息",
  850. userId: Cookies.get("userName"),
  851. };
  852. resetModule(this.data).then((res) => {
  853. if (res.code == 200) {
  854. this.showSetting = false;
  855. this.setRowList = this.tableDate;
  856. this.getRowList = this.tableDate;
  857. }
  858. });
  859. },
  860. //列设置全选
  861. allChecked2() {
  862. if (this.allCheck2 == true) {
  863. this.setRowList2.map((e) => {
  864. return (e.checked = 0);
  865. });
  866. } else {
  867. this.setRowList2.map((e) => {
  868. return (e.checked = 1);
  869. });
  870. }
  871. },
  872. //查询列数据
  873. getRow2() {
  874. let that = this;
  875. this.data = {
  876. tableName: "发票信息",
  877. userId: Cookies.get("userName"),
  878. };
  879. select(this.data).then((res) => {
  880. if (res.data.length != 0) {
  881. this.getRowList2 = res.data.filter((e) => e.checked == 0);
  882. this.setRowList2 = res.data;
  883. this.setRowList2 = this.setRowList2.reduce((res, item) => {
  884. res.push({
  885. surface: item.surface,
  886. label: item.label,
  887. name: item.name,
  888. checked: item.checked,
  889. width: item.width,
  890. fixed: item.fixed,
  891. });
  892. return res;
  893. }, []);
  894. }
  895. });
  896. },
  897. //保存列设置
  898. save2() {
  899. this.showSetting2 = false;
  900. this.data = {
  901. tableName: "发票信息",
  902. userId: Cookies.get("userName"),
  903. sysTableSetList: this.setRowList2,
  904. };
  905. addSet(this.data).then((res) => {
  906. this.getRowList2 = this.setRowList2.filter((e) => e.checked == 0);
  907. });
  908. },
  909. //重置列表
  910. delRow2() {
  911. this.data = {
  912. tableName: "发票信息",
  913. userId: Cookies.get("userName"),
  914. };
  915. resetModule(this.data).then((res) => {
  916. if (res.code == 200) {
  917. this.showSetting2 = false;
  918. this.setRowList2 = this.tableDate2;
  919. this.getRowList2 = this.tableDate2;
  920. }
  921. });
  922. },
  923. //开始拖拽事件
  924. onStart() {
  925. this.drag = true;
  926. },
  927. //拖拽结束事件
  928. onEnd() {
  929. this.drag = false;
  930. },
  931. //sheet切换
  932. handleSelect(key, keyPath) {
  933. if(key === '1') {
  934. this.feeInfo = true
  935. this.invoiceInfo = false
  936. }else{
  937. this.feeInfo = false
  938. this.invoiceInfo = true
  939. }
  940. },
  941. //发票信息新行
  942. addList(){
  943. this.invoiceList.push({
  944. fModel:null,
  945. fSbu:'1',
  946. fNumber:null,
  947. fUnitprice:null,
  948. fMoney:null,
  949. fTaxrate:null,
  950. fTax:null,
  951. fAmount:null,
  952. fStatus:'1',
  953. remarks:null,
  954. createBy:this.Lander,
  955. createTime:null,
  956. updateBy:this.Lander,
  957. updateTime:null,
  958. })
  959. },
  960. // 导入多选框
  961. handleSelectionChange_s(selection) {
  962. this.totAL = 0;
  963. this.Ttime = 0;
  964. this.selection = selection;
  965. if (this.selection.length == 0) {
  966. for (let item in this.chargeList_s) {
  967. this.totAL += Number(this.chargeList_s[item].fAmt);
  968. this.Ttime += Number(this.chargeList_s[item].fAmtdr);
  969. }
  970. } else {
  971. for (let index in selection) {
  972. this.totAL += Number(selection[index].fAmt);
  973. this.Ttime += Number(selection[index].fAmtdr);
  974. }
  975. }
  976. // this.getSummaries()
  977. },
  978. //清空一行
  979. deleteRow(index, rows) {
  980. rows.splice(index, 1);
  981. },
  982. deleteRoww(index, rows) {
  983. rows.splice(index, 1);
  984. },
  985. }
  986. }
  987. </script>
  988. <style lang="scss" scoped>
  989. .tabSetting {
  990. display: flex;
  991. justify-content: flex-end;
  992. }
  993. .listStyle {
  994. display: flex;
  995. border-top: 1px solid #dcdfe6;
  996. border-left: 1px solid #dcdfe6;
  997. border-right: 1px solid #dcdfe6;
  998. }
  999. .listStyle:last-child {
  1000. border-bottom: 1px solid #dcdfe6;
  1001. }
  1002. .progress {
  1003. display: flex;
  1004. align-items: center;
  1005. padding: 2px;
  1006. background-color: rgba(0, 0, 0, 0.05);
  1007. height: 100%;
  1008. }
  1009. </style>
  1010. <style lang="scss">
  1011. .el-table {
  1012. .el-table__body-wrapper {
  1013. z-index: 2;
  1014. }
  1015. }
  1016. </style>