sales-trend.vue 29 KB

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