index.vue 19 KB

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