index.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351
  1. <template>
  2. <div class="app-container">
  3. <basic-container>
  4. <avue-crud
  5. ref="crud"
  6. :option="option"
  7. :data="receivableList"
  8. :search.sync="queryParams"
  9. @resetColumn="resetColumn('crud','option','optionList',181)"
  10. @saveColumn="saveColumn('crud','option','optionList',181)"
  11. >
  12. <template slot="menuLeft">
  13. <el-button
  14. type="warning"
  15. icon="el-icon-download"
  16. size="mini"
  17. @click="handleExport"
  18. v-hasPermi="['warehouseBusiness:profit:export']"
  19. >导出
  20. </el-button>
  21. </template>
  22. </avue-crud>
  23. </basic-container>
  24. <span v-if="false">
  25. <div v-if="login == 3">
  26. <kaihe-profitGeneralLedger/>
  27. </div>
  28. <div v-else>
  29. <el-form
  30. :model="queryParams"
  31. ref="queryForm"
  32. v-show="showSearch"
  33. label-width="80px"
  34. >
  35. <el-row>
  36. <el-col :span="6">
  37. <el-form-item label="客户" prop="corpid">
  38. <el-select
  39. v-model="queryParams.corpid"
  40. filterable
  41. remote
  42. clearable
  43. size="small"
  44. @keyup.enter.native="handleQuery"
  45. :remote-method="corpsRemoteMethod"
  46. placeholder="请选择客户"
  47. >
  48. <el-option
  49. v-for="(dict, index) in mblnoOptions"
  50. :key="index.id"
  51. :label="dict.name"
  52. :value="dict.id"
  53. ></el-option>
  54. </el-select>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="6">
  58. <el-form-item label="提单号" prop="mblno">
  59. <el-input
  60. v-model="queryParams.mblno"
  61. placeholder="请输入提单号"
  62. clearable
  63. size="small"
  64. style="width: 200px"
  65. @keyup.enter.native="handleQuery"
  66. />
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="6">
  70. <el-form-item label="审核区间" prop="timeExamine">
  71. <!-- 如果需要固定某一年加 :picker-options="pickerOptions0"-->
  72. <el-date-picker
  73. type="monthrange"
  74. range-separator="至"
  75. start-placeholder="开始月份"
  76. end-placeholder="结束月份"
  77. v-model="queryParams.timeExamine"
  78. value-format="yyyy-MM"
  79. unlink-panels
  80. :clearable="false"
  81. style="width: 200px"
  82. @keyup.enter.native="handleQuery"
  83. ></el-date-picker>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="6">
  87. <el-form-item label="货物名称" prop="productName">
  88. <el-select
  89. v-model="queryParams.productName"
  90. filterable
  91. remote
  92. clearable
  93. size="small"
  94. :remote-method="goodsRemoteMethod"
  95. @keyup.enter.native="handleQuery"
  96. placeholder="请选择货物名称"
  97. >
  98. <el-option
  99. v-for="(dict, index) in goodsOptions"
  100. :key="index.id"
  101. :label="dict.name"
  102. :value="dict.name"
  103. ></el-option>
  104. </el-select>
  105. </el-form-item>
  106. </el-col>
  107. </el-row>
  108. <el-collapse-transition>
  109. <div v-show="show">
  110. <el-row>
  111. <el-col :span="6">
  112. <el-form-item label="品牌" prop="marks">
  113. <el-input
  114. v-model="queryParams.marks"
  115. placeholder="请输入品牌"
  116. clearable
  117. size="small"
  118. style="width: 200px"
  119. @keyup.enter.native="handleQuery"
  120. />
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="6">
  124. <el-form-item label="结算状态" prop="reconciliation">
  125. <el-select
  126. v-model="queryParams.reconciliation"
  127. clearable
  128. size="small"
  129. @keyup.enter.native="handleQuery"
  130. >
  131. <el-option label="未收" value="0"/>
  132. <el-option label="全部" value="1"/>
  133. </el-select>
  134. </el-form-item>
  135. </el-col>
  136. <el-col :span="6">
  137. <el-form-item label="费用状态" prop="billstatus">
  138. <el-select
  139. v-model="queryParams.billstatus"
  140. clearable
  141. size="small"
  142. @keyup.enter.native="handleQuery"
  143. >
  144. <el-option label="录入" value="0"/>
  145. <el-option label="审核通过" value="1"/>
  146. </el-select>
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="6">
  150. <el-form-item label="作业类型" prop="businessType">
  151. <el-select
  152. multiple
  153. v-model="queryParams.businessType"
  154. filterable
  155. >
  156. <el-option
  157. v-for="(dict, index) in businessTypeOption"
  158. :key="index.dictValue"
  159. :label="dict.dictLabel"
  160. :value="dict.dictValue"
  161. ></el-option>
  162. </el-select>
  163. </el-form-item>
  164. </el-col>
  165. </el-row>
  166. <el-row>
  167. <el-col :span="6">
  168. <el-form-item label="费用名称" prop="feeid">
  169. <el-select
  170. multiple
  171. :remote-method="wRemoteMethod"
  172. v-model="queryParams.feeid"
  173. filterable
  174. >
  175. <el-option
  176. v-for="(dict, index) in wbuOptions"
  177. :key="index.id"
  178. :label="dict.name"
  179. :value="dict.id"
  180. ></el-option>
  181. </el-select>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="6">
  185. <el-form-item label="审核状态">
  186. <el-select
  187. v-model="queryParams.billProfits"
  188. placeholder="请选择状态"
  189. clearable
  190. size="small"
  191. filterable
  192. >
  193. <el-option label="全部" :value="1"></el-option>
  194. <el-option label="待审" :value="4"></el-option>
  195. <el-option label="审核通过" :value="6"></el-option>
  196. </el-select>
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="6">
  200. <el-form-item label="业务员" prop="salesmanId">
  201. <el-select
  202. v-model="queryParams.salesmanId"
  203. clearable
  204. filterable
  205. placeholder="请选择业务员"
  206. >
  207. <el-option
  208. v-for="(item, index) in salesmanOption"
  209. :key="index.userId"
  210. :label="item.userName"
  211. :value="item.userId"
  212. ></el-option>
  213. </el-select>
  214. </el-form-item>
  215. </el-col>
  216. <el-col :span="6">
  217. <el-form-item label="客户分组">
  218. <el-select
  219. v-model="queryParams.groupBy"
  220. filterable
  221. placeholder="请选择"
  222. >
  223. <el-option
  224. label="是"
  225. :value="1"
  226. ></el-option>
  227. <el-option
  228. label="否"
  229. :value="0"
  230. ></el-option>
  231. </el-select>
  232. </el-form-item>
  233. </el-col>
  234. </el-row>
  235. <el-row>
  236. <el-col :span="6">
  237. <el-form-item label="船名" prop="vslid" v-if="sysType == 3">
  238. <el-select
  239. v-model="queryParams.vslid"
  240. placeholder="请选择船名"
  241. clearable
  242. size="small"
  243. filterable
  244. >
  245. <el-option
  246. v-for="item in vesselOptions"
  247. :key="item.id"
  248. :label="item.name"
  249. :value="item.id"
  250. />
  251. </el-select>
  252. </el-form-item>
  253. </el-col>
  254. <el-col :span="6">
  255. <el-form-item label="航次" prop="voyid" v-if="sysType == 3">
  256. <el-select
  257. v-model="queryParams.voyid"
  258. placeholder="请选择航次"
  259. clearable
  260. size="small"
  261. filterable
  262. >
  263. <el-option
  264. v-for="item in voyageOptions"
  265. :key="item.id"
  266. :label="item.no"
  267. :value="item.id"
  268. />
  269. </el-select>
  270. </el-form-item>
  271. </el-col>
  272. </el-row>
  273. </div>
  274. </el-collapse-transition>
  275. <!-- <el-form-item label="结算单位" prop="toCorpid">-->
  276. <!-- <el-select-->
  277. <!-- v-model="queryParams.toCorpid"-->
  278. <!-- placeholder="请选择结算单位"-->
  279. <!-- filterable-->
  280. <!-- remote-->
  281. <!-- clearable-->
  282. <!-- style="width: 200px"-->
  283. <!-- size="small"-->
  284. <!-- @keyup.enter.native="handleQuery"-->
  285. <!-- :remote-method="corpsRemoteMethod"-->
  286. <!-- >-->
  287. <!-- <el-option-->
  288. <!-- v-for="(dict, index) in mblnoOptions"-->
  289. <!-- :key="index.id"-->
  290. <!-- :label="dict.name"-->
  291. <!-- :value="dict.id"-->
  292. <!-- ></el-option>-->
  293. <!-- </el-select>-->
  294. <!-- </el-form-item>-->
  295. </el-form>
  296. <el-row :gutter="10" class="mb8">
  297. <el-col :span="1.5">
  298. <el-button
  299. type="warning"
  300. icon="el-icon-download"
  301. size="mini"
  302. @click="handleExport"
  303. v-hasPermi="['warehouseBusiness:profit:export']"
  304. >导出
  305. </el-button>
  306. </el-col>
  307. <div class="tabSetting">
  308. <div style="margin-right: 20px">
  309. <el-button
  310. type="cyan"
  311. icon="el-icon-search"
  312. size="mini"
  313. @click="handleQuery"
  314. >搜索</el-button
  315. >
  316. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  317. >重置</el-button
  318. >
  319. <el-button
  320. v-show="show"
  321. @click="show = !show"
  322. icon="el-icon-arrow-up"
  323. size="mini"
  324. style="border: 1px dashed #afaeae"
  325. >展开</el-button
  326. >
  327. <el-button
  328. v-show="!show"
  329. @click="show = !show"
  330. icon="el-icon-arrow-down"
  331. size="mini"
  332. style="border: 1px dashed #afaeae"
  333. >展开</el-button
  334. >
  335. </div>
  336. <right-toolbar
  337. :showSearch.sync="showSearch"
  338. @queryTable="getList"
  339. ></right-toolbar>
  340. <div style="margin: 0 12px">
  341. <el-button
  342. icon="el-icon-setting"
  343. size="mini"
  344. circle
  345. @click="showSetting = !showSetting"
  346. ></el-button>
  347. </div>
  348. </div>
  349. </el-row>
  350. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
  351. <div>配置排序列数据(拖动调整顺序)</div>
  352. <div style="margin-left: 17px">
  353. <el-checkbox
  354. v-model="allCheck"
  355. label="全选"
  356. @change="allChecked"
  357. ></el-checkbox>
  358. </div>
  359. <div style="padding: 4px; display: flex; justify-content: center">
  360. <draggable
  361. v-model="setRowList"
  362. group="site"
  363. animation="300"
  364. @start="onStart"
  365. @end="onEnd"
  366. handle=".indraggable"
  367. >
  368. <transition-group>
  369. <div
  370. v-for="item in setRowList"
  371. :key="item.surface"
  372. class="listStyle"
  373. >
  374. <div style="width: 500px" class="indraggable">
  375. <div class="progress" :style="{ width: item.width + 'px' }">
  376. <el-checkbox
  377. :label="item.name"
  378. v-model="item.checked"
  379. :true-label="0"
  380. :false-label="1"
  381. >{{ item.name }}
  382. </el-checkbox>
  383. </div>
  384. </div>
  385. <el-input-number
  386. v-model.number="item.width"
  387. controls-position="right"
  388. :min="1"
  389. :max="500"
  390. size="mini"
  391. ></el-input-number>
  392. </div>
  393. </transition-group>
  394. </draggable>
  395. </div>
  396. <span slot="footer" class="dialog-footer">
  397. <el-button @click="showSetting = false">取 消</el-button>
  398. <el-button @click="delRow" type="danger">重 置</el-button>
  399. <el-button type="primary" @click="save()">确 定</el-button>
  400. </span>
  401. </el-dialog>
  402. <el-table
  403. v-loading="loading"
  404. :data="receivableList"
  405. show-summary
  406. :summary-method="getSum"
  407. @expand-change="expandChange"
  408. >
  409. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  410. <el-table-column type="expand" fixed="left" v-if="sysType == 3">
  411. <template slot-scope="props">
  412. <el-table :data="props.row.dataList" v-loading="props.row.loading">
  413. <el-table-column
  414. label="客户名称"
  415. prop="corpid"
  416. align="center"
  417. show-overflow-tooltip
  418. width="180"
  419. >
  420. <template slot-scope="scope">
  421. <span>{{ scope.row.corpid | nameFormat(nameOptions) }}</span>
  422. </template>
  423. </el-table-column>
  424. <el-table-column
  425. label="费用名称"
  426. prop="feeid"
  427. align="center"
  428. show-overflow-tooltip
  429. width="100"
  430. >
  431. <template slot-scope="scope">
  432. <span v-if="scope.row.dc == 'D'">
  433. {{ scope.row.feeid | dNameFormat(dNameOptions) }}
  434. </span>
  435. <span v-if="scope.row.dc == 'C'">
  436. {{ scope.row.feeid | dNameFormat(cNameOptions) }}
  437. </span>
  438. </template>
  439. </el-table-column>
  440. <el-table-column
  441. label="计价单位"
  442. prop="feeunitid"
  443. align="center"
  444. show-overflow-tooltip
  445. width="100"
  446. >
  447. <template slot-scope="scope">
  448. <span>{{
  449. scope.row.feeunitid | jFeetunitFormat(jFeetunitOptions)
  450. }}</span>
  451. </template>
  452. </el-table-column>
  453. <el-table-column
  454. label="数量"
  455. prop="qty"
  456. align="center"
  457. show-overflow-tooltip
  458. width="100"
  459. >
  460. </el-table-column>
  461. <el-table-column
  462. label="单价"
  463. prop="unitprice"
  464. align="center"
  465. show-overflow-tooltip
  466. width="100"
  467. >
  468. </el-table-column>
  469. <el-table-column
  470. label="金额"
  471. prop="amount"
  472. align="center"
  473. show-overflow-tooltip
  474. width="100"
  475. >
  476. </el-table-column>
  477. <el-table-column
  478. label="收付"
  479. prop="dc"
  480. align="center"
  481. show-overflow-tooltip
  482. width="100"
  483. >
  484. <template slot-scope="scope">
  485. <span v-if="scope.row.dc == 'D'">收款</span>
  486. <span v-if="scope.row.dc == 'C'">付款</span>
  487. </template>
  488. </el-table-column>
  489. </el-table>
  490. </template>
  491. </el-table-column>
  492. <el-table-column type="index" label="行号" align="center" width="100"/>
  493. <el-table-column
  494. v-for="(item, index) in getRowList"
  495. :key="index"
  496. :label="item.name"
  497. :width="item.width"
  498. :prop="item.label"
  499. align="center"
  500. :show-overflow-tooltip="true"
  501. sortable
  502. :fixed="item.fixed"
  503. />
  504. <!-- <el-table-column label="货权方" sortable align="center" prop="name" width="220"/>
  505. <el-table-column label="结算单位" sortable align="center" prop="feesName" width="220"/>
  506. <el-table-column label="提单号" sortable align="center" prop="mblno" width="216" show-overflow-tooltip/>
  507. <el-table-column label="货物名称" align="center" prop="productName" show-overflow-tooltip/>
  508. <el-table-column label="品牌" align="center" prop="marks" width="120"/>
  509. <el-table-column label="审核日期" align="center" prop="reviewDate">
  510. <template slot-scope="scope">
  511. <span>{{ parseTime(scope.row.reviewDate, '{y}-{m}-{d}') }}</span>
  512. </template>
  513. </el-table-column>
  514. <el-table-column label="应收金额" align="center" prop="amount"/>
  515. <el-table-column label="应付金额" align="center" prop="stlamount"/>
  516. <el-table-column label="利润" align="center" prop="nnfinished"/> -->
  517. </el-table>
  518. <pagination
  519. v-show="total > 0"
  520. :total="total"
  521. :page.sync="queryParams.pageNum"
  522. :limit.sync="queryParams.pageSize"
  523. :page-sizes="[50, 100, 200, 500, 1000]"
  524. @pagination="getList"
  525. />
  526. </div>
  527. </span>
  528. </div>
  529. </template>
  530. <script>
  531. // import {
  532. // listpayable,
  533. // listWhgenleg,
  534. // getWhgenleg,
  535. // delWhgenleg,
  536. // addWhgenleg,
  537. // updateWhgenleg,
  538. // exportWhgenleg,
  539. // selectListDC,
  540. // } from "@/api/reportManagement/profit";
  541. // import { listWarehouse } from "@/api/basicdata/warehouse";
  542. // import { listArea } from "@/api/basicdata/area";
  543. // import { listGoods } from "@/api/basicdata/goods";
  544. // import { listCorps } from "@/api/basicdata/corps";
  545. // import { listFees } from "@/api/basicdata/fees";
  546. // import { addSet, select, resetModule } from "@/api/system/set";
  547. import Cookies from "js-cookie";
  548. import draggable from "vuedraggable";
  549. // import { getVesselName } from "@/api/finance/applyForInvoice/chargeInvoice";
  550. // import { getVoyageName } from "@/api/finance/applyForInvoice/feeDetail";
  551. // import { getFName } from "@/api/kaihe/domesticTrade/orderInformation";
  552. // import { selectUserByRole } from "@/api/basicdata/warehouse";
  553. // import kaiheProfitGeneralLedger from "../kaihe-profitGeneralLedger/index.vue";
  554. export default {
  555. name: "profitGeneralLedger",
  556. components: {
  557. draggable,
  558. // kaiheProfitGeneralLedger
  559. },
  560. data() {
  561. return {
  562. option: {},
  563. optionList: {
  564. border: true,
  565. align: 'center',
  566. stripe: true,
  567. index: true,
  568. addBtn: false,
  569. editBtn: false,
  570. delBtn: false,
  571. menu: false,
  572. height: "auto",
  573. searchSpan: 8,
  574. searchIcon: true,
  575. searchIndex: 2,
  576. highlightCurrentRow: true,
  577. column: [
  578. {
  579. index: "1",
  580. prop: "name",
  581. label: "客户",
  582. width: 150,
  583. },
  584. // {
  585. // index: "2",
  586. // prop: "feesName",
  587. // label: "结算单位",
  588. // width: 120,
  589. // },
  590. {
  591. index: "3",
  592. prop: "mblno",
  593. label: "提单号",
  594. width: 150,
  595. },
  596. {
  597. index: "3",
  598. prop: "reviewDate",
  599. label: "年月",
  600. width: 150,
  601. },
  602. {
  603. index: "4",
  604. prop: "productName",
  605. label: "货物名称",
  606. width: 150,
  607. },
  608. {
  609. index: "5",
  610. prop: "marks",
  611. label: "品牌",
  612. width: 150,
  613. },
  614. {
  615. index: "6",
  616. prop: "reviewDate",
  617. label: "审核日期",
  618. width: 150,
  619. },
  620. {
  621. index: "7",
  622. prop: "amount",
  623. label: "应收金额",
  624. width: 120,
  625. },
  626. {
  627. index: "8",
  628. prop: "stlamount",
  629. label: "应付金额",
  630. width: 120,
  631. },
  632. {
  633. index: "9",
  634. prop: "nnfinished",
  635. label: "利润",
  636. width: 120,
  637. }, {
  638. index: "999",
  639. prop: "corpid",
  640. label: "客户",
  641. width: 120,
  642. hide: true,
  643. showColumn: false,
  644. search: true,
  645. }, {
  646. index: "999",
  647. prop: "mblno",
  648. label: "提单号",
  649. width: 120,
  650. hide: true,
  651. showColumn: false,
  652. search: true,
  653. }, {
  654. index: "999",
  655. prop: "timeExamine",
  656. label: "审核区间",
  657. unlinkPanels: true,
  658. searchRange: true,
  659. width: 120,
  660. hide: true,
  661. showColumn: false,
  662. type: "monthrange",
  663. search: true,
  664. }, {
  665. index: "999",
  666. prop: "productName",
  667. label: "货物名称",
  668. width: 120,
  669. hide: true,
  670. showColumn: false,
  671. search: true,
  672. },
  673. ]
  674. },
  675. show: false,
  676. login: Cookies.get("sysType"),
  677. pickerOptions: {
  678. shortcuts: [
  679. {
  680. text: "最近一周",
  681. onClick(picker) {
  682. const end = new Date();
  683. const start = new Date();
  684. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  685. picker.$emit("pick", [start, end]);
  686. },
  687. },
  688. {
  689. text: "最近一个月",
  690. onClick(picker) {
  691. const end = new Date();
  692. const start = new Date();
  693. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  694. picker.$emit("pick", [start, end]);
  695. },
  696. },
  697. {
  698. text: "最近三个月",
  699. onClick(picker) {
  700. const end = new Date();
  701. const start = new Date();
  702. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  703. picker.$emit("pick", [start, end]);
  704. },
  705. },
  706. ],
  707. },
  708. selectDate: null, // 时间选择后
  709. pickerOptions0: {
  710. disabledDate: time => {
  711. if (this.selectDate == null) {
  712. return false
  713. } else {
  714. return (this.selectDate.getFullYear() != time.getFullYear())
  715. }
  716. },
  717. onPick: date => {
  718. // 如果只选择一个则保存至selectDate 否则selectDate 为空
  719. if (date.minDate && !date.maxDate) {
  720. this.selectDate = date.minDate
  721. } else {
  722. this.selectDate = null
  723. }
  724. }
  725. },
  726. //费用名称
  727. wbuOptions: [],
  728. businessInTypeOption: [],
  729. businessOutTypeOption: [],
  730. businessTransTypeOption: [],
  731. businessTypeOption: [],
  732. salesmanOption: [],
  733. // 货权方(客户数据)
  734. mblnoOptions: [],
  735. // 贸易方式(数据字典),对应t_trademodels 字典
  736. trademodeidOptions: [],
  737. // 货物
  738. goodsOptions: [],
  739. // 仓库(仓库数据)
  740. warehouseOptions: [],
  741. kqhouseOptions: [],
  742. // 遮罩层
  743. loading: true,
  744. // 显示搜索条件
  745. showSearch: true,
  746. // 总条数
  747. total: 0,
  748. // 库存总账表格数据
  749. receivableList: [],
  750. // 弹出层标题
  751. title: "",
  752. // 是否显示弹出层
  753. open: false,
  754. // 查询参数
  755. queryParams: {
  756. pageNum: 1,
  757. pageSize: 50,
  758. corpid: null,
  759. mblno: null,
  760. timeExamine: null,
  761. toCorpid: null,
  762. productName: null,
  763. marks: null,
  764. reconciliation: null,
  765. billstatus: null,
  766. businessType: null,
  767. feeid: null,
  768. },
  769. // 表单参数
  770. form: {},
  771. // 表单校验
  772. rules: {
  773. marks: [{required: true, message: "唛头不能为空", trigger: "blur"}],
  774. },
  775. showSetting: false,
  776. drag: false,
  777. setRowList: [],
  778. getRowList: [],
  779. tableDate: [
  780. {
  781. surface: "1",
  782. label: "name",
  783. name: "客户",
  784. checked: 0,
  785. width: 150,
  786. },
  787. // {
  788. // surface: "2",
  789. // label: "feesName",
  790. // name: "结算单位",
  791. // checked: 0,
  792. // width: 120,
  793. // },
  794. {
  795. surface: "3",
  796. label: "mblno",
  797. name: "提单号",
  798. checked: 0,
  799. width: 150,
  800. },
  801. {
  802. surface: "3",
  803. label: "reviewDate",
  804. name: "年月",
  805. checked: 0,
  806. width: 150,
  807. },
  808. {
  809. surface: "4",
  810. label: "productName",
  811. name: "货物名称",
  812. checked: 0,
  813. width: 150,
  814. },
  815. {
  816. surface: "5",
  817. label: "marks",
  818. name: "品牌",
  819. checked: 0,
  820. width: 150,
  821. },
  822. {
  823. surface: "6",
  824. label: "reviewDate",
  825. name: "审核日期",
  826. checked: 0,
  827. width: 150,
  828. },
  829. {
  830. surface: "7",
  831. label: "amount",
  832. name: "应收金额",
  833. checked: 0,
  834. width: 120,
  835. },
  836. {
  837. surface: "8",
  838. label: "stlamount",
  839. name: "应付金额",
  840. checked: 0,
  841. width: 120,
  842. },
  843. {
  844. surface: "9",
  845. label: "nnfinished",
  846. name: "利润",
  847. checked: 0,
  848. width: 120,
  849. },
  850. ],
  851. allCheck: false,
  852. // 船名
  853. vesselOptions: [],
  854. // 航次
  855. voyageOptions: [],
  856. sysType: "",
  857. nameOptions: [],
  858. dNameOptions: [],
  859. cNameOptions: [],
  860. jFeetunitOptions: [],
  861. };
  862. },
  863. filters: {
  864. nameFormat(row, nameOptions) {
  865. let name;
  866. nameOptions.map((e) => {
  867. if (row == e.id) {
  868. name = e.name;
  869. }
  870. });
  871. return name;
  872. },
  873. dNameFormat(row, dNameOptions) {
  874. let name;
  875. dNameOptions.map((e) => {
  876. if (row == e.id) {
  877. name = e.name;
  878. }
  879. });
  880. return name;
  881. },
  882. cNameFormat(row, cNameOptions) {
  883. let name;
  884. cNameOptions.map((e) => {
  885. if (row == e.id) {
  886. name = e.name;
  887. }
  888. });
  889. return name;
  890. },
  891. jFeetunitFormat(row, jFeetunitOptions) {
  892. let label;
  893. jFeetunitOptions.map((e) => {
  894. if (row == e.dictValue) {
  895. label = e.dictLabel;
  896. }
  897. });
  898. return label;
  899. },
  900. },
  901. async created() {
  902. this.option = await this.getColumnData(this.getColumnName(181), this.optionList);
  903. this.$set(this.queryParams, 'groupBy', 1)
  904. this.sysType = Cookies.get("sysType");
  905. this.setRowList = this.tableDate;
  906. this.getRowList = this.tableDate;
  907. this.vessleRemthod();
  908. this.voyageRemthods();
  909. /* 远程模糊查询费用名称 */
  910. this.wRemoteMethod();
  911. let this_ = this;
  912. this_.getList();
  913. this_.getDicts("data_trademodes").then((response) => {
  914. this_.trademodeidOptions = response.data;
  915. });
  916. this_.getDicts("st_in_type").then((response) => {
  917. this_.businessInTypeOption = response.data;
  918. this_.getDicts("st_out_type").then((response) => {
  919. this_.businessOutTypeOption = response.data;
  920. this_.getDicts("st_trans_type").then((response) => {
  921. this_.businessTransTypeOption = response.data;
  922. this_.merge(
  923. this_.businessOutTypeOption,
  924. this_.businessInTypeOption,
  925. this_.businessTransTypeOption
  926. );
  927. });
  928. });
  929. });
  930. let queryParams = {pageNum: 1, dc: "C"};
  931. listFees(queryParams).then((response) => {
  932. this.cNameOptions = response.rows;
  933. });
  934. let query = {pageNum: 1, dc: "D"};
  935. listFees(query).then((response) => {
  936. this.dNameOptions = response.rows;
  937. });
  938. // 获取客户名称下拉
  939. getFName(queryParams).then((response) => {
  940. this.nameOptions = response.data;
  941. });
  942. // 业务员获取
  943. selectUserByRole().then((res) => {
  944. this.salesmanOption = res.rows;
  945. });
  946. this.getDicts("data_unitfees").then((response) => {
  947. if (response.data) {
  948. this.jFeetunitOptions = response.data;
  949. }
  950. });
  951. this.getRow();
  952. if (this.sysType == 3) {
  953. this.tableDate.push(
  954. {
  955. surface: "10",
  956. label: "vslid",
  957. name: "船名",
  958. checked: 0,
  959. width: 200,
  960. },
  961. {
  962. surface: "11",
  963. label: "voyid",
  964. name: "航次",
  965. checked: 0,
  966. width: 200,
  967. }
  968. );
  969. }
  970. },
  971. mounted() {
  972. },
  973. methods: {
  974. //自定义列保存
  975. async saveColumn(ref, option, optionBack, code) {
  976. /**
  977. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  978. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  979. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  980. */
  981. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  982. if (inSave) {
  983. this.$message.success("保存成功");
  984. //关闭窗口
  985. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  986. }
  987. },
  988. //自定义列重置
  989. async resetColumn(ref, option, optionBack, code) {
  990. this[option] = this[optionBack];
  991. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  992. if (inSave) {
  993. this.$message.success("重置成功");
  994. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  995. }
  996. },
  997. //列设置全选
  998. allChecked() {
  999. if (this.allCheck == true) {
  1000. this.setRowList.map((e) => {
  1001. return (e.checked = 0);
  1002. });
  1003. } else {
  1004. this.setRowList.map((e) => {
  1005. return (e.checked = 1);
  1006. });
  1007. }
  1008. },
  1009. //查询列数据
  1010. getRow() {
  1011. let that = this;
  1012. this.data = {
  1013. tableName: "利润总账",
  1014. userId: Cookies.get("userName"),
  1015. };
  1016. select(this.data).then((res) => {
  1017. if (res.data.length != 0) {
  1018. this.getRowList = res.data.filter((e) => e.checked == 0);
  1019. this.setRowList = res.data;
  1020. this.setRowList = this.setRowList.reduce((res, item) => {
  1021. res.push({
  1022. surface: item.surface,
  1023. label: item.label,
  1024. name: item.name,
  1025. checked: item.checked,
  1026. width: item.width,
  1027. fixed: item.fixed,
  1028. });
  1029. return res;
  1030. }, []);
  1031. }
  1032. });
  1033. },
  1034. delRow() {
  1035. this.data = {
  1036. tableName: "利润总账",
  1037. userId: Cookies.get("userName"),
  1038. };
  1039. resetModule(this.data).then((res) => {
  1040. if (res.code == 200) {
  1041. this.showSetting = false;
  1042. this.setRowList = this.tableDate;
  1043. this.getRowList = this.tableDate;
  1044. }
  1045. });
  1046. },
  1047. //保存列设置
  1048. save() {
  1049. this.showSetting = false;
  1050. this.data = {
  1051. tableName: "利润总账",
  1052. userId: Cookies.get("userName"),
  1053. sysTableSetList: this.setRowList,
  1054. };
  1055. addSet(this.data).then((res) => {
  1056. if (res.code == 200) {
  1057. this.showSetting = false;
  1058. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1059. }
  1060. });
  1061. },
  1062. //开始拖拽事件
  1063. onStart() {
  1064. this.drag = true;
  1065. },
  1066. //拖拽结束事件
  1067. onEnd() {
  1068. this.drag = false;
  1069. },
  1070. getSum(param) {
  1071. const {columns, data} = param;
  1072. const sums = [];
  1073. columns.forEach((column, index) => {
  1074. if (index === 0) {
  1075. sums[index] = "总计";
  1076. } else if (column.label == '应收金额' || column.label == '应付金额' || column.label == '利润') {
  1077. const values = data.map((item) => Number(item[column.property]));
  1078. if (!values.every((value) => isNaN(value))) {
  1079. sums[index] = values.reduce((prev, curr) => {
  1080. const value = Number(curr);
  1081. if (!isNaN(value)) {
  1082. return (Number(prev) + Number(curr)).toFixed(2);
  1083. } else {
  1084. return Number(prev).toFixed(2);
  1085. }
  1086. }, 0);
  1087. }
  1088. }
  1089. });
  1090. return sums;
  1091. },
  1092. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  1093. trademodeidFormat(row, column) {
  1094. return this.selectDictLabel(this.trademodeidOptions, row.trademodeid);
  1095. },
  1096. /* 远程模糊查询仓库 */
  1097. warehouseRemoteMethod(name) {
  1098. if (name == null || name === "") {
  1099. return false;
  1100. }
  1101. let queryParams = {pageNum: 1, pageSize: 10, name: name};
  1102. listWarehouse(queryParams).then((response) => {
  1103. this.warehouseOptions = response.rows;
  1104. });
  1105. },
  1106. /* 远程模糊查询费用名称 */
  1107. wRemoteMethod(name) {
  1108. // if (name == null || name === "") {
  1109. // return false;
  1110. // }
  1111. let queryParams = {pageNum: 1, name: name};
  1112. console.log(queryParams);
  1113. listFees(queryParams).then((response) => {
  1114. this.wbuOptions = response.rows;
  1115. console.log(response);
  1116. });
  1117. },
  1118. /* 远程模糊查询库区 */
  1119. kqhouseRemoteMethod(name) {
  1120. if (name == null || name === "") {
  1121. return false;
  1122. }
  1123. if (!this.queryParams.warehouseid) {
  1124. this.$message.error("请输入仓库!");
  1125. return false;
  1126. }
  1127. let queryParams = {
  1128. pageNum: 1,
  1129. pageSize: 10,
  1130. warehouseid: this.queryParams.warehouseid,
  1131. name: name,
  1132. };
  1133. listArea(queryParams).then((response) => {
  1134. this.kqhouseOptions = response.rows;
  1135. });
  1136. },
  1137. /* 远程模糊查询商品 */
  1138. goodsRemoteMethod(name) {
  1139. if (name == null || name === "") {
  1140. return false;
  1141. }
  1142. let queryParams = {pageNum: 1, pageSize: 10, name: name};
  1143. listGoods(queryParams).then((response) => {
  1144. this.goodsOptions = response.rows;
  1145. });
  1146. },
  1147. /* 远程模糊查询用户 */
  1148. corpsRemoteMethod(name) {
  1149. if (name == null || name === "") {
  1150. return false;
  1151. }
  1152. let queryParams = {pageNum: 1, pageSize: 10, name: name};
  1153. listCorps(queryParams).then((response) => {
  1154. this.mblnoOptions = response.rows;
  1155. this.KHblnoOptions = response.rows;
  1156. });
  1157. },
  1158. merge(index, list, err) {
  1159. this.businessTypeOption = this.businessTypeOption.concat(
  1160. index,
  1161. list,
  1162. err
  1163. );
  1164. },
  1165. /** 查询库存总账列表 */
  1166. getList() {
  1167. this.loading = true;
  1168. this.getDicts("approval_process").then((response) => {
  1169. this.options = response.data;
  1170. });
  1171. listpayable(this.queryParams).then((response) => {
  1172. this.receivableList = response.rows;
  1173. this.total = response.total;
  1174. if (this.sysType == 3) {
  1175. this.receivableList.forEach((item) => {
  1176. this.$set(item, "dataList", []);
  1177. this.$set(item, "loading", true);
  1178. });
  1179. }
  1180. this.loading = false;
  1181. });
  1182. },
  1183. // 取消按钮
  1184. cancel() {
  1185. this.open = false;
  1186. this.reset();
  1187. },
  1188. // 表单重置
  1189. reset() {
  1190. this.form = {
  1191. accyear: null,
  1192. id: null,
  1193. accmonth: null,
  1194. corpid: null,
  1195. mblno: null,
  1196. originalbillno: null,
  1197. warehouseLocationid: null,
  1198. goodsid: null,
  1199. trademodeid: null,
  1200. preqty: null,
  1201. pregrossweight: null,
  1202. prenetweight: null,
  1203. qtyd: null,
  1204. volumnd: null,
  1205. grossweightd: null,
  1206. netweightd: null,
  1207. volumnc: null,
  1208. qtyc: null,
  1209. qtyblc: null,
  1210. grossweightc: null,
  1211. netweightc: null,
  1212. grossweightblc: null,
  1213. netweightblc: null,
  1214. cntrno: null,
  1215. status: "0",
  1216. delFlag: null,
  1217. createBy: null,
  1218. marks: null,
  1219. createTime: null,
  1220. updateBy: null,
  1221. updateTime: null,
  1222. remark: null,
  1223. };
  1224. this.resetForm("form");
  1225. },
  1226. // 搜索重置
  1227. resetQueryParams() {
  1228. this.queryParams = {
  1229. pageNum: 1,
  1230. pageSize: 50,
  1231. corpid: null,
  1232. mblno: null,
  1233. timeExamine: null,
  1234. toCorpid: null,
  1235. productName: null,
  1236. marks: null,
  1237. reconciliation: null,
  1238. billstatus: null,
  1239. businessType: null,
  1240. feeid: null,
  1241. groupBy: 1,
  1242. };
  1243. },
  1244. /** 搜索按钮操作 */
  1245. handleQuery() {
  1246. this.queryParams.pageNum = 1;
  1247. this.getList();
  1248. },
  1249. /** 重置按钮操作 */
  1250. resetQuery() {
  1251. // this.resetForm('queryForm')
  1252. this.resetQueryParams();
  1253. this.handleQuery();
  1254. },
  1255. /** 新增按钮操作 */
  1256. handleAdd() {
  1257. this.reset();
  1258. this.open = true;
  1259. this.title = "添加库存总账";
  1260. },
  1261. /** 提交按钮 */
  1262. submitForm() {
  1263. this.$refs["form"].validate((valid) => {
  1264. if (valid) {
  1265. if (this.form.accyear != null) {
  1266. updateWhgenleg(this.form).then((response) => {
  1267. this.msgSuccess("修改成功");
  1268. this.open = false;
  1269. this.getList();
  1270. });
  1271. } else {
  1272. addWhgenleg(this.form).then((response) => {
  1273. this.msgSuccess("新增成功");
  1274. this.open = false;
  1275. this.getList();
  1276. });
  1277. }
  1278. }
  1279. });
  1280. },
  1281. /** 导出按钮操作 */
  1282. handleExport() {
  1283. const queryParams = this.queryParams;
  1284. this.$confirm("是否确认导出所有利润总账数据项?", "警告", {
  1285. confirmButtonText: "确定",
  1286. cancelButtonText: "取消",
  1287. type: "warning",
  1288. })
  1289. .then(function () {
  1290. return exportWhgenleg(queryParams);
  1291. })
  1292. .then((response) => {
  1293. this.download(response.msg);
  1294. });
  1295. },
  1296. //获取船名
  1297. vessleRemthod() {
  1298. getVesselName().then((response) => {
  1299. this.vesselOptions = response.rows;
  1300. });
  1301. },
  1302. // 获取航次
  1303. voyageRemthods() {
  1304. getVoyageName().then((response) => {
  1305. this.voyageOptions = response.rows;
  1306. });
  1307. },
  1308. // 表格展开
  1309. expandChange(row, index) {
  1310. console.log(row.mblno);
  1311. if (row.loading == true) {
  1312. selectListDC(row.mblno).then((res) => {
  1313. row.dataList = res.data;
  1314. row.loading = false;
  1315. });
  1316. }
  1317. },
  1318. },
  1319. };
  1320. </script>
  1321. <style lang="scss">
  1322. .tabSetting {
  1323. display: flex;
  1324. justify-content: flex-end;
  1325. }
  1326. .listStyle {
  1327. display: flex;
  1328. border-top: 1px solid #dcdfe6;
  1329. border-left: 1px solid #dcdfe6;
  1330. border-right: 1px solid #dcdfe6;
  1331. }
  1332. .listStyle:last-child {
  1333. border-bottom: 1px solid #dcdfe6;
  1334. }
  1335. .progress {
  1336. display: flex;
  1337. align-items: center;
  1338. padding: 2px;
  1339. background-color: rgba(0, 0, 0, 0.05);
  1340. height: 100%;
  1341. }
  1342. </style>