index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  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. {
  306. surface: "1",
  307. label: "mdLoadDate",
  308. name: "装卸日期",
  309. checked: 0,
  310. width: 100,
  311. },
  312. {
  313. surface: "2",
  314. label: "billType",
  315. name: "贸易方式",
  316. checked: 0,
  317. width: 100,
  318. },
  319. {
  320. surface: "3",
  321. label: "transType",
  322. name: "运输方式",
  323. checked: 0,
  324. width: 100,
  325. },
  326. {
  327. surface: "4",
  328. label: "corpId",
  329. name: "托运人",
  330. checked: 0,
  331. width: 100,
  332. },
  333. {
  334. surface: "5",
  335. label: "ysl",
  336. name: "船名",
  337. checked: 0,
  338. width: 100,
  339. },
  340. {
  341. surface: "6",
  342. label: "voy",
  343. name: "航次",
  344. checked: 0,
  345. width: 100,
  346. },
  347. {
  348. surface: "8",
  349. label: "cntrQty",
  350. name: "柜量",
  351. checked: 0,
  352. width: 100,
  353. },
  354. {
  355. surface: "9",
  356. label: "cntrId",
  357. name: "柜型",
  358. checked: 0,
  359. width: 100,
  360. },
  361. {
  362. surface: "10",
  363. label: "goodsId",
  364. name: "品名",
  365. checked: 0,
  366. width: 100,
  367. },
  368. {
  369. surface: "11",
  370. label: "cntrWeight",
  371. name: "重量",
  372. checked: 0,
  373. width: 100,
  374. },
  375. {
  376. surface: "12",
  377. label: "polId",
  378. name: "起运港",
  379. checked: 0,
  380. width: 100,
  381. },
  382. {
  383. surface: "13",
  384. label: "podId",
  385. name: "目的港",
  386. checked: 0,
  387. width: 100,
  388. },
  389. {
  390. surface: "14",
  391. label: "loadAddr",
  392. name: "提箱场站",
  393. checked: 0,
  394. width: 100,
  395. },
  396. {
  397. surface: "15",
  398. label: "mdLoadAddr",
  399. name: "装货地",
  400. checked: 0,
  401. width: 100,
  402. },
  403. {
  404. surface: "16",
  405. label: "unLoadAddr",
  406. name: "卸货地",
  407. checked: 0,
  408. width: 100,
  409. },
  410. {
  411. surface: "17",
  412. label: "carregNo",
  413. name: "车号",
  414. checked: 0,
  415. width: 100,
  416. },
  417. {
  418. surface: "18",
  419. label: "driverName",
  420. name: "司机",
  421. checked: 0,
  422. width: 100,
  423. },
  424. {
  425. surface: "19",
  426. label: "orderNo",
  427. name: "运单号",
  428. checked: 0,
  429. width: 100,
  430. },
  431. {
  432. surface: "20",
  433. label: "driverTel",
  434. name: "司机电话",
  435. checked: 0,
  436. width: 100,
  437. },
  438. {
  439. surface: "21",
  440. label: "orderName",
  441. name: "状态",
  442. checked: 0,
  443. width: 100,
  444. },
  445. {
  446. surface: "22",
  447. label: "acceptDate",
  448. name: "接单日期",
  449. checked: 0,
  450. width: 100,
  451. },
  452. {
  453. surface: "23",
  454. label: "loadDate",
  455. name: "提箱日期",
  456. checked: 0,
  457. width: 100,
  458. },
  459. {
  460. surface: "24",
  461. label: "unLoadDate",
  462. name: "还柜日期",
  463. checked: 0,
  464. width: 100,
  465. },
  466. {
  467. surface: "25",
  468. label: "oilAmt",
  469. name: "油气费",
  470. checked: 0,
  471. width: 100,
  472. },
  473. {
  474. surface: "26",
  475. label: "driverbonus",
  476. name: "单趟提成",
  477. checked: 0,
  478. width: 100,
  479. },
  480. {
  481. surface: "27",
  482. label: "costOth",
  483. name: "其他费用",
  484. checked: 0,
  485. width: 100,
  486. },
  487. {
  488. surface: "28",
  489. label: "costRemarks",
  490. name: "备注",
  491. checked: 0,
  492. width: 100,
  493. },
  494. {
  495. surface: "29",
  496. label: "costomAmt05",
  497. name: "港杂费",
  498. checked: 0,
  499. width: 100,
  500. },
  501. {
  502. surface: "30",
  503. label: "costomAmt06",
  504. name: "提箱费",
  505. checked: 0,
  506. width: 100,
  507. },
  508. {
  509. surface: "31",
  510. label: "costomAmt03",
  511. name: "修洗费",
  512. checked: 0,
  513. width: 100,
  514. },
  515. {
  516. surface: "32",
  517. label: "costomAmt04",
  518. name: "吊装费",
  519. checked: 0,
  520. width: 100,
  521. },
  522. {
  523. surface: "33",
  524. label: "costomAmt01",
  525. name: "出口其他费用",
  526. checked: 0,
  527. width: 100,
  528. },
  529. {
  530. surface: "34",
  531. label: "costomStr01",
  532. name: "出口费用备注",
  533. checked: 0,
  534. width: 100,
  535. },
  536. {
  537. surface: "35",
  538. label: "costomAmt02",
  539. name: "进口其他费用",
  540. checked: 0,
  541. width: 100,
  542. },
  543. {
  544. surface: "36",
  545. label: "costomStr02",
  546. name: "进口费用备注",
  547. checked: 0,
  548. width: 100,
  549. },
  550. {
  551. surface: "37",
  552. label: "mBillNo",
  553. name: "主单号",
  554. checked: 0,
  555. width: 100,
  556. },
  557. {
  558. surface: "38",
  559. label: "billKind",
  560. name: "单据类型",
  561. checked: 0,
  562. width: 100,
  563. },
  564. {
  565. surface: "39",
  566. label: "amtDr",
  567. name: "应收结算金额",
  568. checked: 0,
  569. width: 100,
  570. },
  571. {
  572. surface: "40",
  573. label: "amtCr",
  574. name: "应付结算金额",
  575. checked: 0,
  576. width: 100,
  577. },
  578. {
  579. surface: "41",
  580. label: "stlAmtDr",
  581. name: "已收结算金额",
  582. checked: 0,
  583. width: 100,
  584. },
  585. {
  586. surface: "42",
  587. label: "stlAmtCr",
  588. name: "已付结算金额",
  589. checked: 0,
  590. width: 100,
  591. },
  592. {
  593. surface: "43",
  594. label: "profitBill",
  595. name: "业务利润",
  596. checked: 0,
  597. width: 100,
  598. },
  599. {
  600. surface: "44",
  601. label: "profitCar",
  602. name: "车利润",
  603. checked: 0,
  604. width: 100,
  605. },
  606. ],
  607. setRowList: [],
  608. getRowList: [],
  609. tabularData: [],
  610. corpsOptions: [],
  611. showSetting: false,
  612. };
  613. },
  614. // 使用子组件
  615. components: {
  616. AddOrUpdate,
  617. draggable,
  618. },
  619. created() {
  620. this.setRowList = this.tableDate;
  621. this.getRowList = this.tableDate;
  622. this.getList();
  623. this.getRow();
  624. listCorps().then((response) => {
  625. this.corpsOptions = response.rows;
  626. });
  627. },
  628. methods: {
  629. //列设置全选
  630. allChecked() {
  631. if (this.allCheck == true) {
  632. this.setRowList.map((e) => {
  633. return (e.checked = 0);
  634. });
  635. } else {
  636. this.setRowList.map((e) => {
  637. return (e.checked = 1);
  638. });
  639. }
  640. },
  641. //查询列数据
  642. getRow() {
  643. let that = this;
  644. this.data = {
  645. tableName: "陆运台账",
  646. userId: Cookies.get("userName"),
  647. };
  648. select(this.data).then((res) => {
  649. if (res.data.length != 0) {
  650. this.getRowList = res.data.filter((e) => e.checked == 0);
  651. this.setRowList = res.data;
  652. this.setRowList = this.setRowList.reduce((res, item) => {
  653. res.push({
  654. surface: item.surface,
  655. label: item.label,
  656. name: item.name,
  657. checked: item.checked,
  658. width: item.width,
  659. fixed: item.fixed,
  660. });
  661. return res;
  662. }, []);
  663. }
  664. });
  665. },
  666. //重置列表
  667. delRow() {
  668. this.data = {
  669. tableName: "计划下达",
  670. userId: Cookies.get("userName"),
  671. };
  672. resetModule(this.data).then((res) => {
  673. if (res.code == 200) {
  674. this.showSetting = false;
  675. this.setRowList = this.tableDate;
  676. this.getRowList = this.tableDate;
  677. }
  678. });
  679. },
  680. //保存列设置
  681. save() {
  682. this.showSetting = false;
  683. this.data = {
  684. tableName: "计划下达",
  685. userId: Cookies.get("userName"),
  686. sysTableSetList: this.setRowList,
  687. };
  688. addSet(this.data).then((res) => {
  689. if (res.code == 200) {
  690. this.showSetting = false;
  691. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  692. }
  693. });
  694. },
  695. //开始拖拽事件
  696. onStart() {
  697. this.drag = true;
  698. },
  699. //拖拽结束事件
  700. onEnd() {
  701. this.drag = false;
  702. },
  703. /** 查询订单主列表 */
  704. getList() {
  705. this.loading = true;
  706. /*if (this.queryParams.acceptDateList) {
  707. this.queryParams.acceptDateList[0] = this.queryParams.acceptDateList + ' 00:00:00'
  708. this.queryParams.acceptDateList[1] = this.queryParams.acceptDateList + ' 23:59:59'
  709. }
  710. if (this.queryParams.accchkDateList) {
  711. this.queryParams.accchkDateList[0] = this.queryParams.accchkDateList + ' 00:00:00'
  712. this.queryParams.accchkDateList[1] = this.queryParams.accchkDateList + ' 23:59:59'
  713. }*/
  714. queryLedgerList(this.queryParams).then((response) => {
  715. this.tabularData = response.rows;
  716. this.total = response.total;
  717. this.loading = false;
  718. });
  719. },
  720. // 表单重置
  721. reset() {
  722. this.resetForm("form");
  723. },
  724. /** 导出按钮操作 */
  725. handleExport() {
  726. const queryParams = this.queryParams;
  727. this.$confirm("是否确认导出所有订单主数据项?", "警告", {
  728. confirmButtonText: "确定",
  729. cancelButtonText: "取消",
  730. type: "warning",
  731. })
  732. .then(function () {
  733. return ledgerListExport(queryParams);
  734. })
  735. .then((response) => {
  736. this.download(response.msg);
  737. });
  738. },
  739. /** 搜索按钮操作 */
  740. handleQuery() {
  741. this.queryParams.pageNum = 1;
  742. this.getList();
  743. },
  744. /** 重置按钮操作 */
  745. resetQuery() {
  746. this.resetForm("queryForm");
  747. this.queryParams = {
  748. pageNum: 1,
  749. pageSize: 10,
  750. stlStatus: null,
  751. accchkStatus: null,
  752. invStatus: null,
  753. };
  754. this.handleQuery();
  755. },
  756. },
  757. };
  758. </script>
  759. <style lang="scss" scoped>
  760. .tabSetting {
  761. display: flex;
  762. justify-content: flex-end;
  763. }
  764. .listStyle {
  765. display: flex;
  766. border-top: 1px solid #dcdfe6;
  767. border-left: 1px solid #dcdfe6;
  768. border-right: 1px solid #dcdfe6;
  769. }
  770. .listStyle:last-child {
  771. border-bottom: 1px solid #dcdfe6;
  772. }
  773. .progress {
  774. display: flex;
  775. align-items: center;
  776. padding: 2px;
  777. background-color: rgba(0, 0, 0, 0.05);
  778. height: 100%;
  779. }
  780. </style>