sales-trend.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993
  1. <template>
  2. <div class="home-container">
  3. <el-card class="home-container__card">
  4. <div>
  5. <div class="content" v-loading="loading" v-if="!(roleName.indexOf('司机') !== -1)">
  6. <!--散货-->
  7. <avue-crud
  8. v-if="mold == 2"
  9. :data="tableData"
  10. :key="key"
  11. :option="optionTwo"
  12. ref="crud"
  13. @refresh-change="refresh"
  14. @resetColumn="resetColumnTwo('crud','optionTwo','bulkCargoList',140.1)"
  15. @saveColumn="saveColumnTwo('crud','optionTwo','bulkCargoList',140.1)">
  16. <template slot="addressDetail" slot-scope="{ row,index}">
  17. <el-tooltip class="item" effect="dark" placement="top">
  18. <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
  19. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.addressDetail }}</div>
  20. </el-tooltip>
  21. </template>
  22. <template slot="unloadingPlace" slot-scope="{ row,index}">
  23. <el-tooltip class="item" effect="dark" placement="top">
  24. <div v-html="ToBreak(row.unloadingPlace)" slot="content"></div>
  25. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.unloadingPlace }}</div>
  26. </el-tooltip>
  27. </template>
  28. <template slot="dispatchNumber" slot-scope="{row}">
  29. <span class="el-button--text" style="cursor: pointer"
  30. @click="openTrackTwo(row,0)">{{ row.dispatchNumber }}</span>
  31. </template>
  32. <template slot="menuLeft">
  33. <span>今日业务详情{{ mold == 1 ? '(集装箱)' : mold == 2 ? '(散货)' : mold == 3 ? '(特种)' : '' }}</span>
  34. </template>
  35. </avue-crud>
  36. <!--集装箱-->
  37. <avue-crud v-else :data="tableData" :option="option" :key="key" ref="crud" @refresh-change="refresh"
  38. @resetColumn="resetColumn"
  39. @saveColumn="saveColumn">
  40. <template slot="menuLeft">
  41. <span>今日业务详情{{ mold == 1 ? '(集装箱)' : mold == 2 ? '(散货)' : mold == 3 ? '(特种)' : '' }}</span>
  42. </template>
  43. <template slot="billNo" slot-scope="{row}">
  44. <span class="el-button--text" style="cursor: pointer"
  45. @click="openTrack(row,0)">{{ row.billNo }}</span>
  46. </template>
  47. <template slot="plateNo" slot-scope="{row}">
  48. <span class="el-button--text" style="cursor: pointer"
  49. @click="openTrack(row,1)">{{ row.plateNo }}</span>
  50. </template>
  51. <template slot="addressDetail" slot-scope="{ row,index}">
  52. <el-tooltip class="item" effect="dark" placement="top">
  53. <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
  54. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.addressDetail }}</div>
  55. </el-tooltip>
  56. </template>
  57. <template slot="status" slot-scope="{row}">
  58. <span v-if="row.status == 0" style="color: #ffa21e;">未调度</span>
  59. <span v-if="row.status == 1" style="color: #fb5b60;">未派车</span>
  60. <span v-if="row.status == 2" style="color: #42bc6f;">未受理</span>
  61. <span v-if="row.status == 3" style="color: #14cde1;">未完工</span>
  62. <span v-if="row.status == 5" style="color: #F56C6C;">未到厂</span>
  63. <span v-if="row.status == 4" style="color: #04421fa1;">工单关闭</span>
  64. <span v-if="row.status == 6" style="color: #3C9CFF;">未提箱</span>
  65. </template>
  66. </avue-crud>
  67. </div>
  68. </div>
  69. </el-card>
  70. <el-dialog
  71. title="实时位置"
  72. append-to-body
  73. custom-class="dialog_two"
  74. :visible.sync="dialogVisible"
  75. lock-scroll
  76. width="80%">
  77. <div id="container"></div>
  78. </el-dialog>
  79. </div>
  80. </template>
  81. <script>
  82. import {active, frequency} from "@/api/wel";
  83. import {gaude, location} from "@/api/gaude";
  84. import data from "@/views/util/data";
  85. export default {
  86. name: "basicContainer",
  87. props: {
  88. sysType: Number
  89. },
  90. data() {
  91. return {
  92. entrustTimer: null,
  93. roleName: localStorage.getItem("roleName").split(','),
  94. dialogVisible: false,
  95. loading: false,
  96. mold: 0,
  97. status: 1,
  98. tableData: [],
  99. map: null,
  100. infoWindow: null,
  101. marker: null,
  102. lineArr: [],
  103. key: 0,
  104. option: {},
  105. optionList: {
  106. stripe: true,
  107. index: true,
  108. menu: false,
  109. refreshBtn: true,
  110. addBtn: false,
  111. height: 390,
  112. align: 'center',
  113. column: [
  114. {
  115. label: '货运日期',
  116. prop: 'arrivalTime',
  117. type: "date",
  118. format: "yyyy-MM-dd HH:mm",
  119. index: 1,
  120. width: 150,
  121. overHidden: true,
  122. },
  123. {
  124. label: '货运地点',
  125. prop: 'addressDetail',
  126. index: 3,
  127. width: 100
  128. },
  129. {
  130. label: '票据号',
  131. prop: 'receiptNo',
  132. index: 4,
  133. width: 100,
  134. overHidden: true,
  135. },
  136. {
  137. label: '提单号',
  138. prop: 'billNo',
  139. index: 5,
  140. width: 140,
  141. overHidden: true,
  142. },
  143. {
  144. label: '场站',
  145. prop: 'station',
  146. index: 6,
  147. width: 100,
  148. overHidden: true,
  149. },
  150. {
  151. label: '箱型箱量',
  152. prop: 'ctnDetail',
  153. index: 7,
  154. width: 100,
  155. overHidden: true,
  156. },
  157. {
  158. label: '车队',
  159. prop: 'fleetShortName',
  160. index: 11,
  161. width: 100,
  162. overHidden: true,
  163. },
  164. {
  165. label: '车号',
  166. prop: 'plateNo',
  167. index: 12,
  168. width: 100,
  169. overHidden: true,
  170. },
  171. {
  172. label: '状态',
  173. prop: 'status',
  174. type: 'select',
  175. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
  176. props: {
  177. label: "dictValue",
  178. value: "dictKey"
  179. },
  180. dataType: "string",
  181. index: 13,
  182. width: 100,
  183. overHidden: true,
  184. }, {
  185. label: '备注',
  186. prop: 'remarks',
  187. index: 17,
  188. width: 100,
  189. overHidden: true,
  190. },
  191. ]
  192. },
  193. optionTwo: {},
  194. bulkCargoList: {},
  195. // 客户
  196. bulkCargoListOne: {
  197. stripe: true,
  198. index: true,
  199. menu: false,
  200. refreshBtn: true,
  201. addBtn: false,
  202. height: 390,
  203. align: 'center',
  204. column: [{
  205. label: '货运日期',
  206. prop: 'arrivalTime',
  207. type: "date",
  208. format: "yyyy-MM-dd HH:mm",
  209. index: 1,
  210. width: 150,
  211. overHidden: true,
  212. }, {
  213. label: '业务员',
  214. prop: 'salesmanName',
  215. index: 2,
  216. width: 60,
  217. overHidden: true,
  218. }, {
  219. label: '物流运输',
  220. prop: 'dispatchDeptName',
  221. overHidden: true,
  222. index: 3,
  223. width: 100
  224. }, {
  225. label: '派车单号',
  226. width: 140,
  227. index: 4,
  228. overHidden: true,
  229. prop: 'dispatchNumber'
  230. }, {
  231. label: '合同号',
  232. width: 140,
  233. index: 5,
  234. overHidden: true,
  235. prop: 'contractNo'
  236. }, {
  237. label: '装货地址',
  238. prop: 'addressDetail',
  239. index: 6,
  240. width: 132,
  241. }, {
  242. label: '卸货地址',
  243. prop: 'unloadingPlace',
  244. index: 7,
  245. width: 132,
  246. }, {
  247. label: '车体积',
  248. width: 100,
  249. index: 8,
  250. prop: 'fleetVolum'
  251. }, {
  252. label: '车队',
  253. prop: 'fleetShortName',
  254. index: 9,
  255. width: 100,
  256. overHidden: true,
  257. }, {
  258. label: '车号',
  259. prop: 'plateNo',
  260. index: 10,
  261. width: 100,
  262. overHidden: true,
  263. }, {
  264. label: '状态',
  265. prop: 'status',
  266. index: 11,
  267. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status_two",
  268. props: {
  269. label: "dictValue",
  270. value: "dictKey"
  271. },
  272. dataType: "string",
  273. type: 'select',
  274. overHidden: true,
  275. width: 140
  276. }, {
  277. label: '应收运费',
  278. prop: 'freightCollect',
  279. index: 12,
  280. width: 100,
  281. overHidden: true,
  282. }, {
  283. label: '应收杂费',
  284. prop: 'extraAmountD',
  285. index: 13,
  286. width: 100,
  287. overHidden: true,
  288. }, {
  289. label: '备注',
  290. prop: 'remarks',
  291. index: 14,
  292. width: 100,
  293. overHidden: true,
  294. }]
  295. },
  296. // 平台
  297. bulkCargoListTwo: {
  298. stripe: true,
  299. index: true,
  300. menu: false,
  301. refreshBtn: true,
  302. addBtn: false,
  303. height: 390,
  304. align: 'center',
  305. column: [{
  306. label: '货运日期',
  307. prop: 'arrivalTime',
  308. type: "date",
  309. format: "yyyy-MM-dd HH:mm",
  310. index: 1,
  311. width: 150,
  312. overHidden: true,
  313. }, {
  314. label: '业务员',
  315. prop: 'salesmanName',
  316. index: 2,
  317. width: 60,
  318. overHidden: true,
  319. },{
  320. label: '运输调度',
  321. prop: 'dispatcherName',
  322. overHidden: true,
  323. index: 3,
  324. width: 100,
  325. }, {
  326. label: '派车单号',
  327. width: 140,
  328. index: 4,
  329. overHidden: true,
  330. prop: 'dispatchNumber'
  331. }, {
  332. label: '合同号',
  333. width: 140,
  334. index: 5,
  335. overHidden: true,
  336. prop: 'contractNo'
  337. }, {
  338. label: '装货地址',
  339. prop: 'addressDetail',
  340. index: 6,
  341. width: 132,
  342. }, {
  343. label: '卸货地址',
  344. prop: 'unloadingPlace',
  345. index: 7,
  346. width: 132,
  347. }, {
  348. label: '车体积',
  349. width: 100,
  350. index: 8,
  351. prop: 'fleetVolum'
  352. }, {
  353. label: '车队',
  354. prop: 'fleetShortName',
  355. index: 9,
  356. width: 100,
  357. overHidden: true,
  358. }, {
  359. label: '车号',
  360. prop: 'plateNo',
  361. index: 10,
  362. width: 100,
  363. overHidden: true,
  364. }, {
  365. label: '状态',
  366. prop: 'status',
  367. index: 11,
  368. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status_two",
  369. props: {
  370. label: "dictValue",
  371. value: "dictKey"
  372. },
  373. dataType: "string",
  374. type: 'select',
  375. overHidden: true,
  376. width: 140
  377. }, {
  378. label: '应收运费',
  379. prop: 'freightCollect',
  380. index: 12,
  381. width: 100,
  382. overHidden: true,
  383. }, {
  384. label: '应收杂费',
  385. prop: 'extraAmountD',
  386. index: 13,
  387. width: 100,
  388. overHidden: true,
  389. },{
  390. label: '应付杂费',
  391. prop: 'extraAmountC',
  392. index: 14,
  393. width: 100,
  394. overHidden: true
  395. },{
  396. label: '客户名称',
  397. prop: 'corpShortName',
  398. index: 15,
  399. width: 100,
  400. overHidden: true,
  401. }, {
  402. label: '备注',
  403. prop: 'remarks',
  404. index: 16,
  405. width: 100,
  406. overHidden: true,
  407. }]
  408. },
  409. // 车队
  410. bulkCargoListThree: {
  411. stripe: true,
  412. index: true,
  413. menu: false,
  414. refreshBtn: true,
  415. addBtn: false,
  416. height: 390,
  417. align: 'center',
  418. column: [{
  419. label: '货运日期',
  420. prop: 'arrivalTime',
  421. type: "date",
  422. format: "yyyy-MM-dd HH:mm",
  423. index: 1,
  424. width: 150,
  425. overHidden: true,
  426. }, {
  427. label: '物流运输',
  428. prop: 'dispatchDeptName',
  429. overHidden: true,
  430. index: 2,
  431. width: 100
  432. },{
  433. label: '运输调度',
  434. prop: 'dispatcherName',
  435. overHidden: true,
  436. index: 3,
  437. width: 100,
  438. }, {
  439. label: '派车单号',
  440. width: 140,
  441. index: 4,
  442. overHidden: true,
  443. prop: 'dispatchNumber'
  444. }, {
  445. label: '合同号',
  446. width: 140,
  447. index: 5,
  448. overHidden: true,
  449. prop: 'contractNo'
  450. }, {
  451. label: '装货地址',
  452. prop: 'addressDetail',
  453. index: 6,
  454. width: 132,
  455. }, {
  456. label: '卸货地址',
  457. prop: 'unloadingPlace',
  458. index: 7,
  459. width: 132,
  460. }, {
  461. label: '车体积',
  462. width: 100,
  463. index: 8,
  464. prop: 'fleetVolum'
  465. }, {
  466. label: '车队',
  467. prop: 'fleetShortName',
  468. index: 9,
  469. width: 100,
  470. overHidden: true,
  471. }, {
  472. label: '车号',
  473. prop: 'plateNo',
  474. index: 10,
  475. width: 100,
  476. overHidden: true,
  477. }, {
  478. label: '状态',
  479. prop: 'status',
  480. index: 11,
  481. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status_two",
  482. props: {
  483. label: "dictValue",
  484. value: "dictKey"
  485. },
  486. dataType: "string",
  487. type: 'select',
  488. overHidden: true,
  489. width: 140
  490. }, {
  491. label: '应付运费',
  492. prop: 'freightPay',
  493. index: 12,
  494. width: 100,
  495. overHidden: true,
  496. },{
  497. label: '应付杂费',
  498. prop: 'extraAmountC',
  499. index: 13,
  500. width: 100,
  501. overHidden: true
  502. }, {
  503. label: '备注',
  504. prop: 'remarks',
  505. index: 14,
  506. width: 100,
  507. overHidden: true,
  508. }]
  509. },
  510. };
  511. },
  512. async mounted() {
  513. this.option = await this.getColumnData(this.getColumnName(140), this.optionList);
  514. if (this.roleName.indexOf('客户') !== -1) {
  515. this.bulkCargoList = this.bulkCargoListOne
  516. } else if (this.roleName.indexOf('平台') !== -1) {
  517. this.bulkCargoList = this.bulkCargoListTwo
  518. } else if (this.roleName.indexOf('车队') !== -1) {
  519. this.bulkCargoList = this.bulkCargoListThree
  520. } else {
  521. this.bulkCargoList = this.bulkCargoListOne
  522. }
  523. this.optionTwo = await this.getColumnData(this.getColumnName(140.1), this.bulkCargoList);
  524. this.key++
  525. await this.getsalesTrend()
  526. this.init()
  527. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('总调度') !== -1 || this.roleName.indexOf('分管调度') !== -1 || this.roleName.indexOf('admin') !== -1) {
  528. for (let item of this.option.column) {
  529. if (item.prop === 'extraAmountC') return
  530. }
  531. this.option.column.push(
  532. {
  533. label: '业务员',
  534. prop: 'salesmanName',
  535. index: 2,
  536. width: 60,
  537. overHidden: true,
  538. }, {
  539. label: '运输调度',
  540. prop: 'dispatcherName',
  541. overHidden: true,
  542. index: 2,
  543. width: 100,
  544. },
  545. {
  546. label: '客户名称',
  547. prop: 'corpShortName',
  548. index: 16,
  549. width: 100,
  550. overHidden: true,
  551. }, {
  552. label: '应付杂费',
  553. prop: 'extraAmountC',
  554. index: 14,
  555. width: 100,
  556. overHidden: true
  557. },
  558. {
  559. label: '应收运费',
  560. prop: 'landAmountD',
  561. index: 13,
  562. width: 100,
  563. overHidden: true,
  564. },
  565. {
  566. label: '应收杂费',
  567. prop: 'extraAmountD',
  568. index: 13,
  569. width: 100,
  570. overHidden: true,
  571. }
  572. )
  573. }
  574. if (this.roleName.indexOf('车队') !== -1) {
  575. for (let item of this.option.column) {
  576. if (item.prop === 'extraAmountC') return
  577. }
  578. this.option.column.push(
  579. {
  580. label: '物流运输',
  581. prop: 'dispatchDeptName',
  582. overHidden: true,
  583. index: 1,
  584. width: 100
  585. }, {
  586. label: '运输调度',
  587. prop: 'dispatcherName',
  588. overHidden: true,
  589. index: 1,
  590. width: 100,
  591. }, {
  592. label: '应付运费',
  593. prop: 'landAmountC',
  594. index: 13,
  595. width: 100,
  596. overHidden: true,
  597. }, {
  598. label: '应付杂费',
  599. prop: 'extraAmountC',
  600. index: 13,
  601. width: 100,
  602. overHidden: true
  603. }
  604. )
  605. }
  606. if (this.roleName.indexOf('客户') !== -1) {
  607. for (let item of this.option.column) {
  608. if (item.prop === 'salesmanName') return
  609. }
  610. this.option.column.push(
  611. {
  612. label: '业务员',
  613. prop: 'salesmanName',
  614. index: 2,
  615. width: 60,
  616. overHidden: true,
  617. }, {
  618. label: '物流运输',
  619. prop: 'dispatchDeptName',
  620. overHidden: true,
  621. index: 2,
  622. width: 100
  623. },
  624. {
  625. label: '客户名称',
  626. prop: 'corpShortName',
  627. index: 16,
  628. width: 100,
  629. overHidden: true,
  630. },
  631. {
  632. label: '应收运费',
  633. prop: 'landAmountD',
  634. index: 14,
  635. width: 100,
  636. overHidden: true,
  637. },
  638. {
  639. label: '应收杂费',
  640. prop: 'extraAmountD',
  641. index: 15,
  642. width: 100,
  643. overHidden: true,
  644. }
  645. )
  646. }
  647. },
  648. beforeDestroy() {
  649. this.map && this.map.destroy();
  650. clearInterval(this.entrustTimer); //关闭
  651. },
  652. methods: {
  653. //自定义列保存
  654. async saveColumn() {
  655. /**
  656. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  657. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  658. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  659. */
  660. const inSave = await this.saveColumnData(this.getColumnName(140), this.option);
  661. if (inSave) {
  662. this.$message.success("保存成功");
  663. //关闭窗口
  664. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  665. }
  666. },
  667. //自定义列重置
  668. async resetColumn() {
  669. this.option = this.optionList;
  670. const inSave = await this.delColumnData(this.getColumnName(140), this.optionList);
  671. if (inSave) {
  672. this.$message.success("重置成功");
  673. //关闭窗口
  674. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  675. this.key++
  676. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('总调度') !== -1 || this.roleName.indexOf('分管调度') !== -1) {
  677. for (let item of this.option.column) {
  678. if (item.prop === 'extraAmountC') return
  679. }
  680. this.option.column.push(
  681. {
  682. label: '业务员',
  683. prop: 'salesmanName',
  684. index: 2,
  685. width: 60,
  686. overHidden: true,
  687. }, {
  688. label: '运输调度',
  689. prop: 'dispatcherName',
  690. overHidden: true,
  691. index: 2,
  692. width: 100,
  693. },
  694. {
  695. label: '客户名称',
  696. prop: 'corpShortName',
  697. index: 16,
  698. width: 100,
  699. overHidden: true,
  700. }, {
  701. label: '应付杂费',
  702. prop: 'extraAmountC',
  703. index: 14,
  704. width: 100,
  705. overHidden: true
  706. },
  707. {
  708. label: '应收运费',
  709. prop: 'landAmountD',
  710. index: 13,
  711. width: 100,
  712. overHidden: true,
  713. },
  714. {
  715. label: '应收杂费',
  716. prop: 'extraAmountD',
  717. index: 13,
  718. width: 100,
  719. overHidden: true,
  720. }
  721. )
  722. }
  723. if (this.roleName.indexOf('车队') !== -1) {
  724. for (let item of this.option.column) {
  725. if (item.prop === 'extraAmountC') return
  726. }
  727. this.option.column.push(
  728. {
  729. label: '物流运输',
  730. prop: 'dispatchDeptName',
  731. overHidden: true,
  732. index: 1,
  733. width: 100
  734. }, {
  735. label: '运输调度',
  736. prop: 'dispatcherName',
  737. overHidden: true,
  738. index: 1,
  739. width: 100,
  740. }, {
  741. label: '应付运费',
  742. prop: 'landAmountC',
  743. index: 13,
  744. width: 100,
  745. overHidden: true,
  746. }, {
  747. label: '应付杂费',
  748. prop: 'extraAmountC',
  749. index: 13,
  750. width: 100,
  751. overHidden: true
  752. }
  753. )
  754. }
  755. if (this.roleName.indexOf('客户') !== -1) {
  756. for (let item of this.option.column) {
  757. if (item.prop === 'salesmanName') return
  758. }
  759. this.option.column.push(
  760. {
  761. label: '业务员',
  762. prop: 'salesmanName',
  763. index: 2,
  764. width: 60,
  765. overHidden: true,
  766. }, {
  767. label: '物流运输',
  768. prop: 'dispatchDeptName',
  769. overHidden: true,
  770. index: 2,
  771. width: 100
  772. },
  773. {
  774. label: '客户名称',
  775. prop: 'corpShortName',
  776. index: 16,
  777. width: 100,
  778. overHidden: true,
  779. },
  780. {
  781. label: '应收运费',
  782. prop: 'landAmountD',
  783. index: 14,
  784. width: 100,
  785. overHidden: true,
  786. },
  787. {
  788. label: '应收杂费',
  789. prop: 'extraAmountD',
  790. index: 15,
  791. width: 100,
  792. overHidden: true,
  793. }
  794. )
  795. }
  796. }
  797. },
  798. //自定义列保存
  799. async saveColumnTwo(ref, option, optionBack, code) {
  800. /**
  801. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  802. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  803. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  804. */
  805. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  806. if (inSave) {
  807. this.$message.success("保存成功");
  808. //关闭窗口
  809. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  810. }
  811. },
  812. //自定义列重置
  813. async resetColumnTwo(ref, option, optionBack, code) {
  814. this[option] = this[optionBack];
  815. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  816. if (inSave) {
  817. this.$message.success("重置成功");
  818. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  819. }
  820. },
  821. openTrackTwo(row, index){
  822. if (index == 0){
  823. this.$router.push({
  824. path: '/landTransportation/bulkCargo/index',
  825. query: {id: row.orderId},
  826. });
  827. }
  828. },
  829. openTrack(row, index) {
  830. if (index == 0) {
  831. this.$router.push({
  832. path: '/landTransportation/placeAnOrder/index',
  833. query: {id: row.orderId},
  834. });
  835. } else {
  836. // gaude({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557',color:'2'}).then(res => {
  837. // this.lineArr = res.data.data
  838. // this.dialogVisible = true
  839. // let this_ = this
  840. // setTimeout(function () {
  841. // this_.initMap();
  842. // }, 100)
  843. // })
  844. location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  845. this.dialogVisible = true
  846. let this_ = this
  847. setTimeout(function () {
  848. this_.initMap(res.data.data, row.plateNo);
  849. }, 1000)
  850. })
  851. }
  852. },
  853. markerClick(e) {
  854. this.infoWindow.setContent(e.target.content);
  855. this.infoWindow.open(this.map, e.target.getPosition());
  856. },
  857. initMap(data, plateNo) {
  858. this.map = new AMap.Map("container", {resizeEnable: true});
  859. this.infoWindow = new AMap.InfoWindow({
  860. ffset: new AMap.Pixel(0, -30),
  861. offset: new AMap.Pixel(0, -30)
  862. });
  863. let icon = new AMap.Icon({
  864. size: new AMap.Size(52, 26), // 图标尺寸
  865. image: 'https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/che.png',
  866. imageSize: new AMap.Size(52, 26), // 根据所设置的大小拉伸或压缩图片
  867. });
  868. this.marker = new AMap.Marker({
  869. position: data.location,
  870. map: this.map,
  871. icon: icon,
  872. markerMeta: new AMap.Size(28, 28),
  873. offset: new AMap.Pixel(-26, -15),
  874. autoRotation: true,
  875. angle: -15
  876. });
  877. this.marker.content = '<div style="width: 300px;">'
  878. + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #fff;">' + plateNo + '</p>'
  879. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">最后上报时间:</span>' + new Date(Number(data.time) + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19) + '</p>'
  880. + '<div style="width: 150px;float: left;">'
  881. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
  882. + '</div>'
  883. + '<div style="width: 150px;float: right;">'
  884. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
  885. + '</div>'
  886. + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
  887. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
  888. + '</div>'
  889. this.infoWindow.open(this.map, this.map.getCenter());
  890. this.marker.on('click', this.markerClick);
  891. this.marker.emit('click', {target: this.marker});
  892. this.map.setFitView();
  893. },
  894. init() {
  895. frequency().then(res => {
  896. let this_ = this
  897. this_.entrustTimer = setInterval(function () {
  898. if (JSON.parse(localStorage.getItem("saber-token")).content) {
  899. this_.getsalesTrend({
  900. status:this_.status,
  901. mold:this_.mold
  902. });
  903. }
  904. }, Number(res.data.data[0].dictKey) * 1000)
  905. })
  906. },
  907. query(data) {
  908. this.getsalesTrend(data)
  909. },
  910. getsalesTrend(data = {status: 0, mold: 1}) {
  911. this.mold = data.mold
  912. this.status = data.status
  913. this.loading = true;
  914. active(data).then(res => {
  915. this.tableData = res.data.data
  916. this.loading = false;
  917. })
  918. },
  919. ToBreak(val) {
  920. if (val) return val.replace(/\n/g, '<br/>')
  921. },
  922. refresh() {
  923. this.getsalesTrend({
  924. status:this.status,
  925. mold:this.mold
  926. })
  927. }
  928. }
  929. };
  930. </script>
  931. <style scoped src="../../../../../styles/demo-center.css"></style>
  932. <style scoped>
  933. #container {
  934. height: 80vh;
  935. width: 100%;
  936. }
  937. .input-card .btn {
  938. margin-right: 1.2rem;
  939. width: 9rem;
  940. }
  941. .input-card .btn:last-child {
  942. margin-right: 0;
  943. }
  944. </style>
  945. <style lang="scss" scoped>
  946. .home-container {
  947. padding: 0px 5px 5px 0px;
  948. box-sizing: border-box;
  949. height: 100%;
  950. ::v-deep .el-card__body {
  951. padding: 10px 15px;
  952. font-size: 14px;
  953. }
  954. &__card {
  955. width: 100%;
  956. height: 100%;
  957. }
  958. .title {
  959. display: flex;
  960. justify-content: space-between;
  961. }
  962. }
  963. .content {
  964. }
  965. ::v-deep .el-dialog {
  966. margin-top: 5vh !important;
  967. margin-bottom: 0 !important;
  968. }
  969. ::v-deep .el-dialog__body {
  970. padding: 0 20px 10px 20px !important;
  971. }
  972. ::v-deep .amap-info-close {
  973. right: 10px !important;
  974. top: 12px !important;
  975. }
  976. ::v-deep .amap-info-content {
  977. padding: 5px 5px 5px 5px !important;
  978. }
  979. </style>