index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. label-width="100px"
  7. size="mini"
  8. >
  9. <el-row>
  10. <el-col :span="6">
  11. <el-form-item label-width="100px" label="结算状态" prop="mblno">
  12. <el-select
  13. v-model="queryParams.stlStatus"
  14. placeholder="请选择对账状态"
  15. clearable
  16. size="small"
  17. filterable
  18. @keyup.enter.native="handleQuery"
  19. >
  20. <el-option
  21. v-for="(dict, index) in stlStatusOptions"
  22. :key="index.id"
  23. :label="dict.name"
  24. :value="dict.id"
  25. />
  26. </el-select>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="6">
  30. <el-form-item label="对账状态" prop="corpId">
  31. <el-select
  32. v-model="queryParams.accchkStatus"
  33. placeholder="请选择对账状态"
  34. clearable
  35. size="small"
  36. filterable
  37. >
  38. <el-option
  39. v-for="(dict, index) in accchkOptions"
  40. :key="index.id"
  41. :label="dict.name"
  42. :value="dict.id"
  43. />
  44. </el-select>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="6">
  48. <el-form-item label-width="100px" label="开票状态" prop="billType">
  49. <el-select
  50. v-model="queryParams.invStatus"
  51. placeholder="请选择开票状态"
  52. clearable
  53. size="small"
  54. >
  55. <el-option
  56. v-for="(dict, index) in invOptions"
  57. :key="index.id"
  58. :label="dict.name"
  59. :value="dict.id"
  60. />
  61. </el-select>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="6">
  65. <el-form-item label-width="100px" label="接单时间">
  66. <el-date-picker type="date" placeholder="选择日期">
  67. </el-date-picker>
  68. </el-form-item>
  69. </el-col>
  70. </el-row>
  71. <el-row>
  72. <el-col :span="6">
  73. <el-form-item label-width="100px" label="结算中心">
  74. <el-select placeholder="请选择">
  75. <!-- <el-option
  76. v-for="item in options"
  77. :key="item.value"
  78. :label="item.label"
  79. :value="item.value"
  80. >
  81. </el-option> -->
  82. </el-select>
  83. </el-form-item>
  84. </el-col>
  85. <el-col :span="6">
  86. <el-form-item label="对账时间">
  87. <el-date-picker type="date" placeholder="选择日期">
  88. </el-date-picker>
  89. </el-form-item>
  90. </el-col>
  91. </el-row>
  92. </el-form>
  93. <el-row :gutter="10" class="mb8">
  94. <el-col :span="1.5">
  95. <el-button
  96. type="warning"
  97. icon="el-icon-download"
  98. size="mini"
  99. @click="handleExport"
  100. v-hasPermi="['fleet:ftmsorderbills:export']"
  101. >导出</el-button
  102. >
  103. </el-col>
  104. <div class="tabSetting">
  105. <div style="margin-right: 20px">
  106. <el-button
  107. type="cyan"
  108. icon="el-icon-search"
  109. size="mini"
  110. @click="handleQuery"
  111. >搜索</el-button
  112. >
  113. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  114. >重置</el-button
  115. >
  116. </div>
  117. <right-toolbar @queryTable="getList"></right-toolbar>
  118. <div style="margin: 0 12px">
  119. <el-tooltip
  120. class="item"
  121. effect="dark"
  122. content="列设置"
  123. placement="top"
  124. >
  125. <el-button
  126. icon="el-icon-setting"
  127. size="mini"
  128. circle
  129. @click="showSetting = !showSetting"
  130. ></el-button>
  131. </el-tooltip>
  132. </div>
  133. </div>
  134. </el-row>
  135. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
  136. <div>配置排序列数据(拖动调整顺序)</div>
  137. <div style="margin-left: 17px">
  138. <el-checkbox
  139. v-model="allCheck"
  140. label="全选"
  141. @change="allChecked"
  142. ></el-checkbox>
  143. </div>
  144. <div style="padding: 4px; display: flex; justify-content: center">
  145. <draggable
  146. v-model="setRowList"
  147. group="site"
  148. animation="300"
  149. @start="onStart"
  150. @end="onEnd"
  151. handle=".indraggable"
  152. >
  153. <transition-group>
  154. <div
  155. v-for="item in setRowList"
  156. :key="item.surface"
  157. class="listStyle"
  158. >
  159. <div style="width: 500px" class="indraggable">
  160. <div class="progress" :style="{ width: item.width + 'px' }">
  161. <el-checkbox
  162. :label="item.name"
  163. v-model="item.checked"
  164. :true-label="0"
  165. :false-label="1"
  166. >{{ item.name }}
  167. </el-checkbox>
  168. </div>
  169. </div>
  170. <el-input-number
  171. v-model.number="item.width"
  172. controls-position="right"
  173. :min="1"
  174. :max="500"
  175. size="mini"
  176. ></el-input-number>
  177. </div>
  178. </transition-group>
  179. </draggable>
  180. </div>
  181. <span slot="footer" class="dialog-footer">
  182. <el-button @click="showSetting = false">取 消</el-button>
  183. <el-button @click="delRow" type="danger">重 置</el-button>
  184. <el-button type="primary" @click="save">确 定</el-button>
  185. </span>
  186. </el-dialog>
  187. <el-table v-loading="loading" :data="tabularData" id="out-table">
  188. <el-table-column type="selection" width="55" align="center" />
  189. <el-table-column
  190. label="提单号"
  191. width="180"
  192. align="center"
  193. :show-overflow-tooltip="true"
  194. sortable
  195. fixed="left"
  196. >
  197. <template slot-scope="scope">
  198. <el-link :underline="false" type="primary"
  199. ><div @click="handleUpdate(scope.row)">
  200. {{ scope.row.mblno }}
  201. </div></el-link
  202. >
  203. </template>
  204. </el-table-column>
  205. <el-table-column
  206. v-for="(item, index) in getRowList"
  207. :key="index"
  208. :label="item.name"
  209. :width="item.width"
  210. :prop="item.label"
  211. align="center"
  212. :show-overflow-tooltip="true"
  213. sortable
  214. :fixed="item.fixed"
  215. />
  216. </el-table>
  217. <pagination
  218. v-show="total > 0"
  219. :total="total"
  220. :page.sync="queryParams.pageNum"
  221. :limit.sync="queryParams.pageSize"
  222. @pagination="getList"
  223. />
  224. </div>
  225. </template>
  226. <script>
  227. import { addSet, select, resetModule } from "@/api/system/set";
  228. import { queryLedgerList, ledgerListExport } from "@/api/fleet/fleetStatistics";
  229. import Cookies from "js-cookie";
  230. import draggable from "vuedraggable";
  231. import AddOrUpdate from "../scheduling/AddOrUpdate";
  232. export default {
  233. name: "plans",
  234. data() {
  235. return {
  236. // 总条数
  237. total: 0,
  238. show: false,
  239. allCheck: false,
  240. stlStatusOptions: [
  241. {
  242. id: "T",
  243. name: "已结算",
  244. },
  245. {
  246. id: "F",
  247. name: "未结算",
  248. },
  249. ],
  250. accchkOptions: [
  251. {
  252. id: "T",
  253. name: "已对账",
  254. },
  255. {
  256. id: "F",
  257. name: "未对账",
  258. },
  259. ],
  260. invOptions: [
  261. {
  262. id: "T",
  263. name: "已开票",
  264. },
  265. {
  266. id: "F",
  267. name: "未开票",
  268. },
  269. ],
  270. drag: false,
  271. loading: false,
  272. // 查询参数
  273. queryParams: {
  274. pageNum: 1,
  275. pageSize: 10,
  276. stlStatus: null,
  277. accchkStatus: null,
  278. invStatus: null,
  279. },
  280. tableDate: [
  281. {
  282. surface: "1",
  283. label: "mdLoadDate",
  284. name: "装卸日期",
  285. checked: 0,
  286. width: 100,
  287. },
  288. {
  289. surface: "2",
  290. label: "billType",
  291. name: "贸易方式",
  292. checked: 0,
  293. width: 100,
  294. },
  295. {
  296. surface: "3",
  297. label: "transType",
  298. name: "运输方式",
  299. checked: 0,
  300. width: 100,
  301. },
  302. {
  303. surface: "4",
  304. label: "corpId",
  305. name: "托运人",
  306. checked: 0,
  307. width: 100,
  308. },
  309. {
  310. surface: "5",
  311. label: "ysl",
  312. name: "船名",
  313. checked: 0,
  314. width: 100,
  315. },
  316. {
  317. surface: "6",
  318. label: "voy",
  319. name: "航次",
  320. checked: 0,
  321. width: 100,
  322. },
  323. {
  324. surface: "8",
  325. label: "cntrQty",
  326. name: "柜量",
  327. checked: 0,
  328. width: 100,
  329. },
  330. {
  331. surface: "9",
  332. label: "cntrId",
  333. name: "柜型",
  334. checked: 0,
  335. width: 100,
  336. },
  337. {
  338. surface: "10",
  339. label: "goodsId",
  340. name: "品名",
  341. checked: 0,
  342. width: 100,
  343. },
  344. {
  345. surface: "11",
  346. label: "cntrWeight",
  347. name: "重量",
  348. checked: 0,
  349. width: 100,
  350. },
  351. {
  352. surface: "12",
  353. label: "polId",
  354. name: "起运港",
  355. checked: 0,
  356. width: 100,
  357. },
  358. {
  359. surface: "13",
  360. label: "podId",
  361. name: "目的港",
  362. checked: 0,
  363. width: 100,
  364. },
  365. {
  366. surface: "14",
  367. label: "loadAddr",
  368. name: "提箱场站",
  369. checked: 0,
  370. width: 100,
  371. },
  372. {
  373. surface: "15",
  374. label: "mdLoadAddr",
  375. name: "装货地",
  376. checked: 0,
  377. width: 100,
  378. },
  379. {
  380. surface: "16",
  381. label: "unLoadAddr",
  382. name: "卸货地",
  383. checked: 0,
  384. width: 100,
  385. },
  386. {
  387. surface: "17",
  388. label: "carregNo",
  389. name: "车号",
  390. checked: 0,
  391. width: 100,
  392. },
  393. {
  394. surface: "18",
  395. label: "driverName",
  396. name: "司机",
  397. checked: 0,
  398. width: 100,
  399. },
  400. {
  401. surface: "19",
  402. label: "orderNo",
  403. name: "运单号",
  404. checked: 0,
  405. width: 100,
  406. },
  407. {
  408. surface: "20",
  409. label: "driverTel",
  410. name: "司机电话",
  411. checked: 0,
  412. width: 100,
  413. },
  414. {
  415. surface: "21",
  416. label: "orderName",
  417. name: "状态",
  418. checked: 0,
  419. width: 100,
  420. },
  421. {
  422. surface: "22",
  423. label: "acceptDate",
  424. name: "接单日期",
  425. checked: 0,
  426. width: 100,
  427. },
  428. {
  429. surface: "23",
  430. label: "loadDate",
  431. name: "提箱日期",
  432. checked: 0,
  433. width: 100,
  434. },
  435. {
  436. surface: "24",
  437. label: "unLoadDate",
  438. name: "还柜日期",
  439. checked: 0,
  440. width: 100,
  441. },
  442. {
  443. surface: "25",
  444. label: "oilAmt",
  445. name: "油气费",
  446. checked: 0,
  447. width: 100,
  448. },
  449. {
  450. surface: "26",
  451. label: "driverbonus",
  452. name: "单趟提成",
  453. checked: 0,
  454. width: 100,
  455. },
  456. {
  457. surface: "27",
  458. label: "costOth",
  459. name: "其他费用",
  460. checked: 0,
  461. width: 100,
  462. },
  463. {
  464. surface: "28",
  465. label: "costRemarks",
  466. name: "备注",
  467. checked: 0,
  468. width: 100,
  469. },
  470. {
  471. surface: "29",
  472. label: "costomAmt05",
  473. name: "港杂费",
  474. checked: 0,
  475. width: 100,
  476. },
  477. {
  478. surface: "30",
  479. label: "costomAmt06",
  480. name: "提箱费",
  481. checked: 0,
  482. width: 100,
  483. },
  484. {
  485. surface: "31",
  486. label: "costomAmt03",
  487. name: "修洗费",
  488. checked: 0,
  489. width: 100,
  490. },
  491. {
  492. surface: "32",
  493. label: "costomAmt04",
  494. name: "吊装费",
  495. checked: 0,
  496. width: 100,
  497. },
  498. {
  499. surface: "33",
  500. label: "costomAmt01",
  501. name: "出口其他费用",
  502. checked: 0,
  503. width: 100,
  504. },
  505. {
  506. surface: "34",
  507. label: "costomStr01",
  508. name: "出口费用备注",
  509. checked: 0,
  510. width: 100,
  511. },
  512. {
  513. surface: "35",
  514. label: "costomAmt02",
  515. name: "进口其他费用",
  516. checked: 0,
  517. width: 100,
  518. },
  519. {
  520. surface: "36",
  521. label: "costomStr02",
  522. name: "进口费用备注",
  523. checked: 0,
  524. width: 100,
  525. },
  526. {
  527. surface: "37",
  528. label: "mBillNo",
  529. name: "主单号",
  530. checked: 0,
  531. width: 100,
  532. },
  533. {
  534. surface: "38",
  535. label: "billKind",
  536. name: "单据类型",
  537. checked: 0,
  538. width: 100,
  539. },
  540. {
  541. surface: "39",
  542. label: "amtDr",
  543. name: "应收结算金额",
  544. checked: 0,
  545. width: 100,
  546. },
  547. {
  548. surface: "40",
  549. label: "amtCr",
  550. name: "应付结算金额",
  551. checked: 0,
  552. width: 100,
  553. },
  554. {
  555. surface: "41",
  556. label: "stlAmtDr",
  557. name: "已收结算金额",
  558. checked: 0,
  559. width: 100,
  560. },
  561. {
  562. surface: "42",
  563. label: "stlAmtCr",
  564. name: "已付结算金额",
  565. checked: 0,
  566. width: 100,
  567. },
  568. {
  569. surface: "43",
  570. label: "profitBill",
  571. name: "业务利润",
  572. checked: 0,
  573. width: 100,
  574. },
  575. {
  576. surface: "44",
  577. label: "profitCar",
  578. name: "车利润",
  579. checked: 0,
  580. width: 100,
  581. },
  582. ],
  583. setRowList: [],
  584. getRowList: [],
  585. tabularData: [],
  586. showSetting: false,
  587. };
  588. },
  589. // 使用子组件
  590. components: {
  591. AddOrUpdate,
  592. draggable,
  593. },
  594. created() {
  595. this.setRowList = this.tableDate;
  596. this.getRowList = this.tableDate;
  597. this.getList();
  598. this.getRow();
  599. },
  600. methods: {
  601. //列设置全选
  602. allChecked() {
  603. if (this.allCheck == true) {
  604. this.setRowList.map((e) => {
  605. return (e.checked = 0);
  606. });
  607. } else {
  608. this.setRowList.map((e) => {
  609. return (e.checked = 1);
  610. });
  611. }
  612. },
  613. //查询列数据
  614. getRow() {
  615. let that = this;
  616. this.data = {
  617. tableName: "陆运台账",
  618. userId: Cookies.get("userName"),
  619. };
  620. select(this.data).then((res) => {
  621. if (res.data.length != 0) {
  622. this.getRowList = res.data.filter((e) => e.checked == 0);
  623. this.setRowList = res.data;
  624. this.setRowList = this.setRowList.reduce((res, item) => {
  625. res.push({
  626. surface: item.surface,
  627. label: item.label,
  628. name: item.name,
  629. checked: item.checked,
  630. width: item.width,
  631. fixed: item.fixed,
  632. });
  633. return res;
  634. }, []);
  635. }
  636. });
  637. },
  638. //重置列表
  639. delRow() {
  640. this.data = {
  641. tableName: "计划下达",
  642. userId: Cookies.get("userName"),
  643. };
  644. resetModule(this.data).then((res) => {
  645. if (res.code == 200) {
  646. this.showSetting = false;
  647. this.setRowList = this.tableDate;
  648. this.getRowList = this.tableDate;
  649. }
  650. });
  651. },
  652. //保存列设置
  653. save() {
  654. this.showSetting = false;
  655. this.data = {
  656. tableName: "计划下达",
  657. userId: Cookies.get("userName"),
  658. sysTableSetList: this.setRowList,
  659. };
  660. addSet(this.data).then((res) => {
  661. if (res.code == 200) {
  662. this.showSetting = false;
  663. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  664. }
  665. });
  666. },
  667. //开始拖拽事件
  668. onStart() {
  669. this.drag = true;
  670. },
  671. //拖拽结束事件
  672. onEnd() {
  673. this.drag = false;
  674. },
  675. /** 查询订单主列表 */
  676. getList() {
  677. this.loading = true;
  678. queryLedgerList(this.queryParams).then((response) => {
  679. this.tabularData = response.rows;
  680. this.total = response.total;
  681. this.loading = false;
  682. });
  683. },
  684. // 表单重置
  685. reset() {
  686. this.resetForm("form");
  687. },
  688. /** 导出按钮操作 */
  689. handleExport() {
  690. const queryParams = this.queryParams;
  691. this.$confirm("是否确认导出所有订单主数据项?", "警告", {
  692. confirmButtonText: "确定",
  693. cancelButtonText: "取消",
  694. type: "warning",
  695. })
  696. .then(function () {
  697. return ledgerListExport(queryParams);
  698. })
  699. .then((response) => {
  700. this.download(response.msg);
  701. });
  702. },
  703. /** 搜索按钮操作 */
  704. handleQuery() {
  705. this.queryParams.pageNum = 1;
  706. this.getList();
  707. },
  708. /** 重置按钮操作 */
  709. resetQuery() {
  710. this.resetForm("queryForm");
  711. this.queryParams = {
  712. pageNum: 1,
  713. pageSize: 10,
  714. stlStatus: null,
  715. accchkStatus: null,
  716. invStatus: null,
  717. };
  718. this.handleQuery();
  719. },
  720. },
  721. };
  722. </script>
  723. <style lang="scss" scoped>
  724. .tabSetting {
  725. display: flex;
  726. justify-content: flex-end;
  727. }
  728. .listStyle {
  729. display: flex;
  730. border-top: 1px solid #dcdfe6;
  731. border-left: 1px solid #dcdfe6;
  732. border-right: 1px solid #dcdfe6;
  733. }
  734. .listStyle:last-child {
  735. border-bottom: 1px solid #dcdfe6;
  736. }
  737. .progress {
  738. display: flex;
  739. align-items: center;
  740. padding: 2px;
  741. background-color: rgba(0, 0, 0, 0.05);
  742. height: 100%;
  743. }
  744. </style>