index.vue 17 KB

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