index.vue 37 KB

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