index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. <template>
  2. <div>
  3. <basic-container v-show="show">
  4. <div class="home-container">
  5. <div style="display: flex;justify-content: center;">
  6. <div class="content">
  7. <div class="content-item" @click="handleClick('')">
  8. <div class="card">
  9. <div class="card-title card-title1">
  10. <span>
  11. </span>
  12. </div>
  13. <div class="card-content">
  14. <span class="card-content-num">{{ totalData.all }}</span>
  15. <span class="card-content-text">全部</span>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="divider"/>
  20. <div class="content-item" @click="handleClick('0')">
  21. <div class="card">
  22. <div class="card-title card-title2">
  23. <span>
  24. </span>
  25. </div>
  26. <div class="card-content">
  27. <span class="card-content-num">{{ totalData.zero }}</span>
  28. <span class="card-content-text">未调度</span>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="divider"/>
  33. <div class="content-item" @click="handleClick('1')">
  34. <div class="card">
  35. <div class="card-title card-title3">
  36. <span>
  37. </span>
  38. </div>
  39. <div class="card-content">
  40. <span class="card-content-num">{{ totalData.one }}</span>
  41. <span class="card-content-text">未派车</span>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </basic-container>
  49. <basic-container v-show="show">
  50. <avue-crud
  51. :table-loading="loading"
  52. :data="dataList"
  53. :page.sync="page"
  54. ref="crud"
  55. :option="option"
  56. @on-load="onLoad"
  57. @row-del="rowDel"
  58. @resetColumn="resetColumn"
  59. @saveColumn="saveColumn"
  60. @search-criteria-switch="searchCriteriaSwitch"
  61. @search-change="searchChange">
  62. <!-- <template slot="menuLeft" slot-scope="{size}">-->
  63. <!-- <el-button type="primary" :size="size" @click="rowSave">新增</el-button>-->
  64. <!-- </template>-->
  65. <template slot="corpNameSearch" slot-scope="{ row,index}">
  66. <crop-select
  67. v-model="row.corpId"
  68. ></crop-select>
  69. </template>
  70. <template slot="addressDetail" slot-scope="{ row,index}">
  71. <el-tooltip class="item" effect="dark" placement="top">
  72. <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
  73. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{row.addressDetail}}</div>
  74. </el-tooltip>
  75. </template>
  76. <template slot="billNo" slot-scope="{row,index}">
  77. <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{row.billNo}}</span>
  78. </template>
  79. <template slot-scope="{row,index}" slot="menu">
  80. <el-button type="text"
  81. icon="el-icon-edit"
  82. size="small"
  83. @click.stop="rowCell(row,index)">编辑
  84. </el-button>
  85. <!-- <el-button type="text"-->
  86. <!-- icon="el-icon-delete"-->
  87. <!-- size="small"-->
  88. <!-- @click.stop="$refs.crud.rowDel(row,index)">删除</el-button>-->
  89. </template>
  90. <template slot="corpName" slot-scope="{row,index}">
  91. <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{ row.corpName }}</span>
  92. </template>
  93. <template slot="orderNo" slot-scope="{row,index}">
  94. <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{ row.orderNo }}</span>
  95. </template>
  96. </avue-crud>
  97. </basic-container>
  98. <detail-page v-if="!show" @backToList="backToList" :id="id"></detail-page>
  99. </div>
  100. </template>
  101. <script>
  102. import detailPage from './detailPage'
  103. import {removeDelegationList, selectInvoiceList, totalList} from "@/api/landTransportation";
  104. export default {
  105. name: "index",
  106. components: {
  107. detailPage
  108. },
  109. data() {
  110. return {
  111. id: '',
  112. show: true,
  113. loading: false,
  114. dataList: [],
  115. totalData: {},
  116. page: {
  117. pageSize: 10,
  118. currentPage: 1,
  119. total: 0,
  120. pageSizes: [10, 50, 100, 200, 300]
  121. },
  122. option: {},
  123. activeName: '',
  124. optionList: {
  125. stripe: true,
  126. align: 'center',
  127. menuWidth: 100,
  128. menu: false,
  129. index: true,
  130. addBtn: false,
  131. editBtn: false,
  132. delBtn: false,
  133. height: "auto",
  134. searchSpan: 8,
  135. searchIcon: true,
  136. column:[
  137. {
  138. label: '货运日期',
  139. prop: 'arrivalTime',
  140. overHidden: true,
  141. type: "date",
  142. searchRange: true,
  143. defaultTime:['00:00:00', '23:59:59'],
  144. format: "yyyy-MM-dd HH:mm:ss",
  145. valueFormat: "yyyy-MM-dd HH:mm:ss",
  146. index: 1,
  147. width: 150,
  148. search: true,
  149. }, {
  150. label: '业务员',
  151. index: 2,
  152. width: 150,
  153. prop: 'salesman',
  154. search: true,
  155. overHidden: true,
  156. type: "select",
  157. dicUrl: "/api/blade-user/userList",
  158. props: {
  159. label: "realName",
  160. value: "id"
  161. }
  162. }, {
  163. label: '货运地点',
  164. prop: 'addressDetail',
  165. index: 3,
  166. width: 140,
  167. search: true,
  168. }, {
  169. label: '提单号',
  170. prop: 'billNo',
  171. index: 4,
  172. overHidden: true,
  173. width: 140,
  174. search: true,
  175. }, {
  176. label: '场站',
  177. prop: 'station',
  178. overHidden: true,
  179. index: 5,
  180. width: 140,
  181. search: true,
  182. },{
  183. label: '计划箱量',
  184. prop: 'ctnDetail',
  185. overHidden: true,
  186. index: 6,
  187. width: 140
  188. },{
  189. label: '已派箱量',
  190. prop: 'dispatchCtnDetail',
  191. overHidden: true,
  192. index: 7,
  193. width: 140
  194. },{
  195. label: '受理箱量',
  196. prop: 'sendCtnDetail',
  197. overHidden: true,
  198. index: 8,
  199. width: 140
  200. },{
  201. label: '运费',
  202. index: 9,
  203. width: 140,
  204. prop: 'freight'
  205. },{
  206. label: '订单号',
  207. prop: 'orderNo',
  208. index: 10,
  209. overHidden: true,
  210. width: 160,
  211. search: true,
  212. }, {
  213. label: '状态',
  214. prop: 'itemStatusDetail',
  215. index: 11,
  216. overHidden: true,
  217. width: 140
  218. }, {
  219. label: '公司名称',
  220. prop: 'corpName',
  221. overHidden: true,
  222. index: 12,
  223. width: 140,
  224. search: true,
  225. }
  226. // , {
  227. // label: '所属公司',
  228. // prop: 'belongCompany',
  229. // overHidden: true,
  230. // index: 4,
  231. // width: 140,
  232. // search: true,
  233. // }
  234. // , {
  235. // label: '货物名称',
  236. // prop: 'goods',
  237. // overHidden: true,
  238. // index: 13,
  239. // width: 140,
  240. // search: true,
  241. // }
  242. ,{
  243. label: '船名航次',
  244. prop: 'factory',
  245. overHidden: true,
  246. index: 14,
  247. width: 140,
  248. search: true,
  249. }, {
  250. label: '制单日期',
  251. overHidden: true,
  252. prop: 'createTime',
  253. type: "date",
  254. searchRange: true,
  255. defaultTime:['00:00:00', '23:59:59'],
  256. format: "yyyy-MM-dd HH:mm:ss",
  257. valueFormat: "yyyy-MM-dd HH:mm:ss",
  258. index: 15,
  259. width: 140,
  260. search: true,
  261. }]
  262. }
  263. }
  264. },
  265. activated() {
  266. if (this.$route.query.orderId){
  267. this.rowCell({id:this.$route.query.orderId},0)
  268. }
  269. // if (this.$route.query.params){
  270. // this.rowCell({id:this.$route.query.params},0)
  271. // }
  272. },
  273. async created() {
  274. this.option = await this.getColumnData(this.getColumnName(86), this.optionList);
  275. let i = 0;
  276. this.option.column.forEach(item => {
  277. if (item.search) i++
  278. })
  279. if (i % 3 !== 0) {
  280. const num = 3 - Number(i % 3)
  281. this.option.searchMenuSpan = num * 8;
  282. this.option.searchMenuPosition = "right";
  283. }
  284. },
  285. methods: {
  286. //自定义列保存
  287. async saveColumn() {
  288. /**
  289. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  290. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  291. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  292. */
  293. const inSave = await this.saveColumnData(this.getColumnName(86), this.option);
  294. if (inSave) {
  295. this.$message.success("保存成功");
  296. //关闭窗口
  297. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  298. }
  299. },
  300. //自定义列重置
  301. async resetColumn() {
  302. this.option = this.optionList;
  303. const inSave = await this.delColumnData(this.getColumnName(86), this.optionList);
  304. if (inSave) {
  305. this.$message.success("重置成功");
  306. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  307. }
  308. },
  309. // 获得高度
  310. searchCriteriaSwitch(type) {
  311. if (type) {
  312. this.option.height = this.option.height - 138
  313. } else {
  314. this.option.height = this.option.height + 138
  315. }
  316. this.$refs.crud.getTableHeight()
  317. },
  318. onLoad(page, params) {
  319. totalList(2).then(res => {
  320. this.totalData = res.data.data
  321. })
  322. let queryParams = {
  323. size: page.pageSize,
  324. current: page.currentPage,
  325. itemStatus: this.activeName,
  326. kind: '2',
  327. ...params
  328. }
  329. this.loading = true;
  330. selectInvoiceList(queryParams).then(res => {
  331. this.dataList = res.data.data.records
  332. this.page.total = res.data.data.total
  333. this.option.height = window.innerHeight - 350;
  334. }).finally(() => {
  335. this.loading = false;
  336. })
  337. },
  338. //搜索
  339. searchChange(params, done) {
  340. let data = params
  341. if (params.arrivalTime) {
  342. data.beginArrivalTime = params.arrivalTime[0]
  343. data.endArrivalTime = params.arrivalTime[1]
  344. }
  345. if (params.createTime) {
  346. data.beginCrateTime = params.createTime[0]
  347. data.endCrateTime = params.createTime[1]
  348. }
  349. delete data.arrivalTime
  350. delete data.createTime
  351. this.onLoad(this.page, data)
  352. done();
  353. },
  354. //列表删除
  355. rowDel(row) {
  356. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  357. confirmButtonText: '确定',
  358. cancelButtonText: '取消',
  359. type: 'warning'
  360. }).then(() => {
  361. removeDelegationList({ids: row.id}).then(res => {
  362. this.$message.success('删除成功');
  363. this.onLoad(this.page)
  364. })
  365. }).catch(() => {
  366. this.$message({
  367. type: 'info',
  368. message: '已取消删除'
  369. });
  370. });
  371. },
  372. //行编辑
  373. rowCell(row, index) {
  374. this.id = row.id
  375. this.show = false
  376. },
  377. rowSave() {
  378. this.show = false
  379. },
  380. backToList() {
  381. this.show = true
  382. },
  383. //切换订单状态
  384. handleClick(tab) {
  385. this.activeName = tab
  386. this.onLoad(this.page)
  387. },
  388. ToBreak (val) {
  389. if (val)return val.replace(/\n/g, '<br/>')
  390. }
  391. }
  392. }
  393. </script>
  394. <style lang="scss" scoped>
  395. .home-container {
  396. padding: 0px 5px 5px 5px;
  397. box-sizing: border-box;
  398. height: 100%;
  399. ::v-deep .el-card__body {
  400. padding: 10px 15px;
  401. font-size: 14px;
  402. }
  403. &__card {
  404. width: 100%;
  405. height: 100%;
  406. }
  407. .title {
  408. display: flex;
  409. justify-content: space-between;
  410. .right {
  411. display: flex;
  412. align-items: center;
  413. &_but {
  414. margin-right: 10px;
  415. border: 1px solid #409eff;
  416. width: 80px;
  417. border-radius: 3px;
  418. display: flex;
  419. &_left {
  420. width: 40px;
  421. text-align: center;
  422. color: #409eff;
  423. cursor: pointer;
  424. }
  425. &_right {
  426. width: 40px;
  427. text-align: center;
  428. color: #409eff;
  429. cursor: pointer;
  430. }
  431. &_active {
  432. color: #fff;
  433. background-color: #409eff;
  434. }
  435. }
  436. }
  437. }
  438. }
  439. .content {
  440. display: flex;
  441. justify-content: center;
  442. align-items: center;
  443. height: 6vh !important;
  444. width: 80vw;
  445. .divider {
  446. display: block;
  447. height: 0px;
  448. width: 100%;
  449. border-top: 1px dashed #dcdfe6;
  450. }
  451. &-item {
  452. margin-left: 1vw;
  453. .card {
  454. width: 130px;
  455. display: flex;
  456. align-items: center;
  457. &-title {
  458. width: 40px;
  459. height: 40px;
  460. text-align: center;
  461. border-radius: 50%;
  462. font-size: 20px;
  463. font-weight: 600;
  464. display: flex;
  465. justify-content: center;
  466. align-items: center;
  467. span {
  468. line-height: 20px;
  469. }
  470. }
  471. &-title1 {
  472. color: #037fe1;
  473. background-color: rgba(3, 127, 225, 0.15);
  474. }
  475. &-title2 {
  476. color: #ffa21e;
  477. background-color: rgba(255, 162, 30, 0.15);
  478. }
  479. &-title3 {
  480. color: #fb5b60;
  481. background-color: rgba(251, 91, 96, 0.15);
  482. }
  483. &-title4 {
  484. color: #42bc6f;
  485. background-color: rgba(66, 188, 111, 0.15);
  486. }
  487. &-title5 {
  488. color: #14cde1;
  489. background-color: rgba(52, 149, 161, 0.15);
  490. }
  491. &-title6 {
  492. color: rgba(4, 66, 31, 0.63);
  493. background-color: rgba(66, 188, 111, 0.15);
  494. }
  495. &-content {
  496. padding-left: 1vw;
  497. display: flex;
  498. flex-direction: column;
  499. &-num {
  500. font-size: 20px;
  501. font-weight: 600;
  502. }
  503. &-text {
  504. color: #909399;
  505. }
  506. }
  507. }
  508. }
  509. }
  510. </style>
  511. <style lang="scss" scoped>
  512. .home-container {
  513. padding: 0px 5px 5px 5px;
  514. box-sizing: border-box;
  515. height: 100%;
  516. ::v-deep .el-card__body {
  517. padding: 10px 15px;
  518. font-size: 14px;
  519. }
  520. &__card {
  521. width: 100%;
  522. height: 100%;
  523. }
  524. .title {
  525. display: flex;
  526. justify-content: space-between;
  527. .right {
  528. display: flex;
  529. align-items: center;
  530. &_but {
  531. margin-right: 10px;
  532. border: 1px solid #409eff;
  533. width: 80px;
  534. border-radius: 3px;
  535. display: flex;
  536. &_left {
  537. width: 40px;
  538. text-align: center;
  539. color: #409eff;
  540. cursor: pointer;
  541. }
  542. &_right {
  543. width: 40px;
  544. text-align: center;
  545. color: #409eff;
  546. cursor: pointer;
  547. }
  548. &_active {
  549. color: #fff;
  550. background-color: #409eff;
  551. }
  552. }
  553. }
  554. }
  555. }
  556. .content {
  557. display: flex;
  558. justify-content: center;
  559. align-items: center;
  560. height: 15vh;
  561. width: 80vw;
  562. .divider {
  563. display: block;
  564. height: 0px;
  565. width: 100%;
  566. border-top: 1px dashed #dcdfe6;
  567. }
  568. &-item {
  569. margin-left: 1vw;
  570. .card {
  571. width: 130px;
  572. display: flex;
  573. align-items: center;
  574. &-title {
  575. width: 40px;
  576. height: 40px;
  577. text-align: center;
  578. border-radius: 50%;
  579. font-size: 20px;
  580. font-weight: 600;
  581. display: flex;
  582. justify-content: center;
  583. align-items: center;
  584. span {
  585. line-height: 20px;
  586. }
  587. }
  588. &-title1 {
  589. color: #037fe1;
  590. background-color: rgba(3, 127, 225, 0.15);
  591. }
  592. &-title2 {
  593. color: #ffa21e;
  594. background-color: rgba(255, 162, 30, 0.15);
  595. }
  596. &-title3 {
  597. color: #fb5b60;
  598. background-color: rgba(251, 91, 96, 0.15);
  599. }
  600. &-title4 {
  601. color: #42bc6f;
  602. background-color: rgba(66, 188, 111, 0.15);
  603. }
  604. &-title5 {
  605. color: #14cde1;
  606. background-color: rgba(52, 149, 161, 0.15);
  607. }
  608. &-title6 {
  609. color: rgba(4, 66, 31, 0.63);
  610. background-color: rgba(66, 188, 111, 0.15);
  611. }
  612. &-content {
  613. padding-left: 1vw;
  614. display: flex;
  615. flex-direction: column;
  616. &-num {
  617. font-size: 20px;
  618. font-weight: 600;
  619. }
  620. &-text {
  621. color: #909399;
  622. }
  623. }
  624. }
  625. }
  626. }
  627. </style>