index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210
  1. <template>
  2. <div class="adds">
  3. <basic-container>
  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" :class="!activeName?'selected':''">{{ totalData.all }}</span>
  15. <span class="card-content-text" :class="!activeName?'selected':''">全部</span>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="divider"/>
  20. <div class="content-item" @click="handleClick('1')">
  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" :class="activeName === '1'?'selected':''">{{ totalData.one }}</span>
  28. <span class="card-content-text" :class="activeName === '1'?'selected':''">未派车</span>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="divider"/>
  33. <div class="content-item" @click="handleClick('2')">
  34. <div class="card">
  35. <div class="card-title card-title4">
  36. <span>
  37. </span>
  38. </div>
  39. <div class="card-content">
  40. <span class="card-content-num" :class="activeName === '2'?'selected':''">{{ totalData.two }}</span>
  41. <span class="card-content-text" :class="activeName === '2'?'selected':''">未受理</span>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="divider"/>
  46. <div class="content-item" @click="handleClick('3')">
  47. <div class="card">
  48. <div class="card-title card-title5">
  49. <span>
  50. </span>
  51. </div>
  52. <div class="card-content">
  53. <span class="card-content-num" :class="activeName === '3'?'selected':''">{{ totalData.three }}</span>
  54. <span class="card-content-text" :class="activeName === '3'?'selected':''">未完工</span>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="divider"/>
  59. <div class="content-item" @click="handleClick('4')">
  60. <div class="card">
  61. <div class="card-title card-title6">
  62. <span>
  63. </span>
  64. </div>
  65. <div class="card-content">
  66. <span class="card-content-num" :class="activeName === '4'?'selected':''">{{ totalData.four }}</span>
  67. <span class="card-content-text" :class="activeName === '4'?'selected':''">已完工</span>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </basic-container>
  75. <basic-container v-if="key>0">
  76. <avue-crud
  77. :data="goodsList"
  78. :option="entrustOptionTwoT"
  79. :table-loading="loading"
  80. :page.sync="page"
  81. ref="crud"
  82. :search.sync="query"
  83. @on-load="onLoad"
  84. @resetColumn="resetColumn"
  85. @saveColumn="saveColumn"
  86. @search-change="searchChange"
  87. @search-reset="query={};activeName = ''"
  88. @search-criteria-switch="searchCriteriaSwitch"
  89. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  90. @row-update="rowSave">
  91. <template slot-scope="{row}" slot="fleetId">
  92. <span>{{ row.fleetName }}</span>
  93. </template>
  94. <template slot-scope="{row}" slot="fleetIdSearch">
  95. <crop-select
  96. v-model="row.fleetId"
  97. corpType="CD"
  98. ></crop-select>
  99. </template>
  100. <template slot-scope="{row}" slot="plateNo">
  101. <span class="el-button--text" style="cursor: pointer"
  102. @click="openTrack(row)">{{ row.plateNo }}</span>
  103. </template>
  104. <template slot-scope="{row,index}" slot="menu">
  105. <el-button
  106. type="text"
  107. size="small"
  108. v-if="row.status===1"
  109. @click="rowSaveT(row,index)"
  110. >{{ row.$cellEdit ? '保 存' : '修 改' }}
  111. </el-button>
  112. <el-button
  113. size="small"
  114. type="text"
  115. @click="designate(row, index)"
  116. v-if="row.status===1"
  117. >派 车
  118. </el-button>
  119. <el-button
  120. size="small"
  121. type="text"
  122. @click="cancelDesignate(row, index)"
  123. v-if="row.status===2"
  124. >取消派车
  125. </el-button>
  126. <el-button
  127. size="small"
  128. type="text"
  129. @click="annexOpen(row, index)"
  130. >附 件
  131. </el-button>
  132. <el-button
  133. size="small"
  134. type="text"
  135. @click="changeFleetT(row, index)"
  136. v-if="row.status !== 0 && row.status !== 1 && row.status !== 2 && row.status !== 4"
  137. >变 更
  138. </el-button>
  139. <el-button
  140. size="small"
  141. type="text"
  142. @click="recordsOfChanges(row, index)"
  143. v-if="row.status > 2"
  144. >变更记录
  145. </el-button>
  146. </template>
  147. <template slot="addressDetail" slot-scope="{ row,index}">
  148. <el-tooltip class="item" effect="dark" placement="top">
  149. <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
  150. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.addressDetail }}</div>
  151. </el-tooltip>
  152. </template>
  153. </avue-crud>
  154. <el-dialog
  155. title="附件"
  156. :visible.sync="dialogVisible"
  157. append-to-body
  158. width="70%">
  159. <c-upload
  160. typeUpload="PC"
  161. :basic="true"
  162. deleteUrl="/api/blade-client/common-file/remove"
  163. :data="orderList"
  164. :enumerationValue="76"
  165. ></c-upload>
  166. <span slot="footer" class="dialog-footer">
  167. <el-button @click="dialogVisible = false" size="small">取 消</el-button>
  168. <el-button type="primary" @click="saveAnnex" size="small" :loading="loadingTwo" :disabled="form.status >= 2">保 存</el-button>
  169. </span>
  170. </el-dialog>
  171. <el-dialog
  172. title="变更"
  173. :visible.sync="dialogChange"
  174. append-to-body
  175. width="70%">
  176. <avue-form :option="optionData" v-model="formData" v-if="dialogChange" ref="saveForm">
  177. </avue-form>
  178. <span slot="footer" class="dialog-footer">
  179. <el-button @click="dialogChange = false" size="small">关 闭</el-button>
  180. <el-button type="primary" @click="confirmChange" size="small">确 定</el-button>
  181. </span>
  182. </el-dialog>
  183. <el-dialog
  184. title="变更记录"
  185. :visible.sync="dialogRecord"
  186. append-to-body
  187. width="70%">
  188. <avue-crud :data="dataRecord" :option="optionRecord" style="margin-top: -43px"></avue-crud>
  189. <span slot="footer" class="dialog-footer">
  190. <el-button @click="dialogRecord = false" size="small">关 闭</el-button>
  191. </span>
  192. </el-dialog>
  193. </basic-container>
  194. <el-dialog
  195. title="实时位置"
  196. append-to-body
  197. custom-class="dialog_two"
  198. :visible.sync="dialogVisibleTwo"
  199. v-loading="loadingDialog"
  200. lock-scroll
  201. width="80%">
  202. <div id="container"></div>
  203. </el-dialog>
  204. </div>
  205. </template>
  206. <script>
  207. import {
  208. sendACarCollection,
  209. sendACarDispatchCollection,
  210. driverQueryCollection,
  211. fleetList,
  212. motorcadeDriver,
  213. fleetDriverSave, telephone, getAttachment, saveAttached, recordingDetails, changeVehicle, fleetListTwo
  214. } from "@/api/landTransportation";
  215. import {location} from "@/api/gaude";
  216. import {businessStatisticsFrequency} from "@/api/wel";
  217. import {defaultDate} from "@/util/date";
  218. export default {
  219. name: "index",
  220. data() {
  221. return {
  222. key: 0,
  223. query:{},
  224. screen:{},
  225. dialogVisibleTwo:false,
  226. loadingDialog:false,
  227. map: null,
  228. infoWindow: null,
  229. marker: null,
  230. formDataList:{},
  231. optionData: {
  232. span: 12,
  233. menuBtn: false,
  234. column: [{
  235. label: "车号",
  236. prop: "plateNo",
  237. allowCreate: true,
  238. overHidden: true,
  239. filterable: true,
  240. cascader: ['driverId'],
  241. type: 'select',
  242. dicUrl: '',
  243. props: {
  244. label: "plateNo",
  245. value: "plateNo"
  246. },
  247. change: (data) => {
  248. fleetListTwo({plateNo:data.value}).then(res => {
  249. this.formData.driverId = res.data.data[0].driverId
  250. this.formData.driverName = res.data.data[0].driverName
  251. this.formData.tel = res.data.data[0].tel
  252. })
  253. }
  254. }, {
  255. label: '状态',
  256. overHidden: true,
  257. width: 100,
  258. type: 'select',
  259. index: 14,
  260. props: {
  261. label: "dictValue",
  262. value: "dictKey"
  263. },
  264. dicData:[{
  265. dictKey: "2",
  266. dictValue: "未受理"
  267. },{
  268. dictKey: "3",
  269. dictValue: "未完工"
  270. },{
  271. dictKey: "5",
  272. dictValue: "未到厂"
  273. },{
  274. dictKey: "6",
  275. dictValue: "已提箱"
  276. }],
  277. prop: 'status'
  278. }, {
  279. label: "司机",
  280. prop: "driverId",
  281. type: 'select',
  282. dicUrl: "/api/blade-client/land-driver/driver-list?vehicleId={{key}}",
  283. props: {
  284. label: "name",
  285. value: "id"
  286. },
  287. change: (data) => {
  288. telephone().then(res => {
  289. for (let item in res.data.data) {
  290. if (data.value === res.data.data[item].id) {
  291. this.formData.tel = res.data.data[item].tel
  292. }
  293. }
  294. })
  295. }
  296. }, {
  297. label: "电话",
  298. prop: "tel",
  299. }]
  300. },
  301. dialogRecord: false,
  302. dialogChange: false,
  303. formData: {},
  304. dataRecord: [],
  305. optionRecord: {
  306. stripe: true,
  307. refreshBtn: false,
  308. columnBtn: false,
  309. menu: false,
  310. addBtn: false,
  311. align: 'center',
  312. column: [
  313. {
  314. label: '变更内容',
  315. prop: 'content'
  316. }, {
  317. label: '变更人',
  318. prop: 'changeUserName'
  319. }, {
  320. label: '变更时间',
  321. prop: 'changeTime'
  322. }
  323. ]
  324. },
  325. form: {},
  326. loadingTwo:false,
  327. dialogVisible: false,
  328. orderList: [],
  329. loading: false,
  330. page: {
  331. pageSize: 10,
  332. currentPage: 1,
  333. total: 0,
  334. pageSizes: [10, 50, 100, 200, 300]
  335. },
  336. roleName: localStorage.getItem("roleName").split(',')[0],
  337. goodsList: [],
  338. entrustOptionTwoT: {},
  339. optionList: {
  340. stripe: true,
  341. align: 'center',
  342. menuAlign: 'center',
  343. index: true,
  344. addBtn: false,
  345. delBtn: false,
  346. menuWidth:150,
  347. cellBtn: false,
  348. cancelBtn: false,
  349. editBtn: false,
  350. addRowBtn: false,
  351. searchIcon: true,
  352. searchIndex: 2,
  353. searchSpan: 8,
  354. height: "auto",
  355. showSummary: true,
  356. summaryText: "合计",
  357. sumColumnList: [
  358. {
  359. name: 'landWeight',
  360. type: 'sum',
  361. decimals: 2
  362. }, {
  363. name: 'landAmountC',
  364. type: 'sum',
  365. decimals: 2
  366. }, {
  367. name: 'landAmountD',
  368. type: 'sum',
  369. decimals: 2
  370. }, {
  371. name: 'ctnQuantity',
  372. type: 'count'
  373. }, {
  374. name: 'oneFeeC',
  375. type: 'sum',
  376. decimals: 2
  377. }, {
  378. name: 'twoFeeC',
  379. type: 'sum',
  380. decimals: 2
  381. }, {
  382. name: 'threeFeeC',
  383. type: 'sum',
  384. decimals: 2
  385. }, {
  386. name: 'fourFeeC',
  387. type: 'sum',
  388. decimals: 2
  389. }, {
  390. name: 'fiveFeeC',
  391. type: 'sum',
  392. decimals: 2
  393. }],
  394. column: [ {
  395. label: '货运日期',
  396. prop: 'arrivalTime',
  397. overHidden: true,
  398. type: "date",
  399. searchRange: true,
  400. defaultTime: ['00:00:00', '23:59:59'],
  401. format: "yyyy-MM-dd HH:mm",
  402. valueFormat: "yyyy-MM-dd HH:mm:ss",
  403. index: 1,
  404. width: 119,
  405. search: true,
  406. }, {
  407. label: '物流运输',
  408. prop: 'dispatchDeptName',
  409. overHidden: true,
  410. index: 1,
  411. width: 82,
  412. }, {
  413. label: '运输调度',
  414. prop: 'dispatcherName',
  415. overHidden: true,
  416. index: 1,
  417. width: 70,
  418. }, {
  419. label: '货运地点',
  420. index: 2,
  421. width: 138,
  422. search: true,
  423. prop: 'addressDetail'
  424. }, {
  425. label: '提单号',
  426. width: 140,
  427. index: 3,
  428. search: true,
  429. overHidden: true,
  430. prop: 'billNo'
  431. }, {
  432. label: '场站',
  433. prop: 'station',
  434. overHidden: true,
  435. index: 4,
  436. width: 68,
  437. search: true,
  438. }, {
  439. label: '箱型',
  440. width: 68,
  441. index: 5,
  442. search: true,
  443. overHidden: true,
  444. prop: 'ctnType',
  445. type: 'select',
  446. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  447. props: {
  448. label: "dictValue",
  449. value: "dictValue"
  450. }
  451. }, {
  452. label: '箱量',
  453. width: 58,
  454. index: 6,
  455. overHidden: true,
  456. prop: 'ctnQuantity'
  457. },
  458. {
  459. label: '车队',
  460. width: 90,
  461. search: true,
  462. index: 7,
  463. // hide:true,
  464. // showColumn: false,
  465. filterable: true,
  466. type: 'select',
  467. cascader: ['plateNo'],
  468. overHidden: true,
  469. prop: 'fleetId',
  470. dicUrl: "/api/blade-client/corpsdesc/fleetList",
  471. props: {
  472. label: "cname",
  473. value: "id"
  474. },
  475. cell: true
  476. }, {
  477. label: '车号',
  478. width: 82,
  479. cell: true,
  480. search: true,
  481. index: 8,
  482. allowCreate: true,
  483. prop: "plateNo",
  484. overHidden: true,
  485. filterable: true,
  486. cascader: ['driverId'],
  487. type: "select",
  488. dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
  489. props: {
  490. label: "plateNo",
  491. value: "plateNo"
  492. },
  493. },
  494. {
  495. label: '司机',
  496. width: 77,
  497. search: true,
  498. overHidden: true,
  499. cell: true,
  500. filterable: true,
  501. index: 9,
  502. prop: 'driverId',
  503. type: "select",
  504. dicUrl: "/api/blade-client/land-driver/driver-list?plateNo={{key}}",
  505. props: {
  506. label: "name",
  507. value: "id"
  508. }
  509. }, {
  510. label: '电话',
  511. overHidden: true,
  512. width: 124,
  513. search: true,
  514. cell: true,
  515. index: 10,
  516. prop: 'tel'
  517. }, {
  518. label: '平台号',
  519. width: 100,
  520. index: 11,
  521. search: true,
  522. overHidden: true,
  523. prop: 'orderNo'
  524. },{
  525. label: '箱号',
  526. overHidden: true,
  527. width: 140,
  528. index: 12,
  529. search: true,
  530. prop: 'ctnNo'
  531. },{
  532. label: '实际到厂时间',
  533. prop: 'realArrivalTime',
  534. overHidden: true,
  535. type: "date",
  536. searchRange: true,
  537. defaultTime: ['00:00:00', '23:59:59'],
  538. format: "yyyy-MM-dd HH:mm",
  539. valueFormat: "yyyy-MM-dd HH:mm:ss",
  540. index: 14,
  541. width: 132
  542. },{
  543. label: '受理日期',
  544. type: "datetime",
  545. format: 'yyyy-MM-dd HH:mm',
  546. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  547. width: 132,
  548. index: 13,
  549. prop: 'acceptTime'
  550. },{
  551. label: '完工日期',
  552. prop: 'finishedTime',
  553. overHidden: true,
  554. type: "date",
  555. searchRange: true,
  556. defaultTime: ['00:00:00', '23:59:59'],
  557. format: "yyyy-MM-dd HH:mm",
  558. valueFormat: "yyyy-MM-dd HH:mm:ss",
  559. index:15,
  560. width: 132,
  561. },{
  562. label: '货物名称',
  563. overHidden: true,
  564. width: 100,
  565. search: true,
  566. index: 16,
  567. prop: 'goods'
  568. }, {
  569. label: '件数',
  570. width: 75,
  571. search: true,
  572. index: 17,
  573. overHidden: true,
  574. controls: false,
  575. cell: true,
  576. prop: 'quantity',
  577. type: 'number',
  578. precision:0
  579. }, {
  580. label: '重量(吨)',
  581. width: 75,
  582. prop: 'landWeight',
  583. controls: false,
  584. overHidden: true,
  585. index: 18,
  586. precision: 2,
  587. type: 'number'
  588. },
  589. // {
  590. // label: '包装',
  591. // width: 100,
  592. // search: true,
  593. // index: 6,
  594. // overHidden: true,
  595. // cell: true,
  596. // prop: 'packing',
  597. // type: 'select',
  598. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  599. // props: {
  600. // label: "dictValue",
  601. // value: "dictValue"
  602. // },
  603. // },
  604. {
  605. label: '尺码',
  606. width: 75,
  607. // search: true,
  608. index:19,
  609. overHidden: true,
  610. cell: true,
  611. prop: 'size',
  612. },
  613. // {
  614. // label: '陆运费(D)',
  615. // overHidden: true,
  616. // prop: 'landAmountD'
  617. // },
  618. {
  619. label: '应付陆运费',
  620. overHidden: true,
  621. index: 20,
  622. width: 68,
  623. cell: true,
  624. prop: 'landAmountC'
  625. }, {
  626. label: '委托备注',
  627. overHidden: true,
  628. index: 21,
  629. width: 238,
  630. prop: 'remarks'
  631. }, {
  632. label: '车队备注',
  633. cell: true,
  634. index: 22,
  635. width: 238,
  636. overHidden: true,
  637. prop: 'fleetRemarks'
  638. }, {
  639. label: '司机备注',
  640. overHidden: true,
  641. width: 238,
  642. index: 23,
  643. prop: 'driverRemarks'
  644. },
  645. // {
  646. // label: '场站费',
  647. // width: 100,
  648. // precision: 2,
  649. // cell: true,
  650. // index: 24,
  651. // controls: false,
  652. // type: 'number',
  653. // prop: 'oneFeeC'
  654. // }, {
  655. // label: '港杂费',
  656. // width: 100,
  657. // precision: 2,
  658. // cell: true,
  659. // index: 25,
  660. // controls: false,
  661. // type: 'number',
  662. // prop: 'twoFeeC'
  663. // }, {
  664. // label: '扣款',
  665. // width: 100,
  666. // precision: 2,
  667. // index: 26,
  668. // cell: true,
  669. // controls: false,
  670. // type: 'number',
  671. // prop: 'threeFeeC'
  672. // }, {
  673. // label: '待时费',
  674. // width: 100,
  675. // precision: 2,
  676. // index: 27,
  677. // cell: true,
  678. // controls: false,
  679. // type: 'number',
  680. // prop: 'fourFeeC'
  681. // }, {
  682. // label: '其他',
  683. // width: 100,
  684. // precision: 2,
  685. // index: 28,
  686. // cell: true,
  687. // type: 'number',
  688. // controls: false,
  689. // prop: 'fiveFeeC'
  690. // }, {
  691. // label: '费用备注',
  692. // width: 245,
  693. // index: 29,
  694. // cell: true,
  695. // prop: 'feeRemarksC'
  696. // },
  697. {
  698. label: '制单日期',
  699. overHidden: true,
  700. prop: 'createTime',
  701. type: "date",
  702. searchRange: true,
  703. defaultTime: ['00:00:00', '23:59:59'],
  704. format: "yyyy-MM-dd HH:mm",
  705. valueFormat: "yyyy-MM-dd HH:mm:ss",
  706. index: 30,
  707. width: 100,
  708. search: true,
  709. }, {
  710. label: '船名航次',
  711. prop: 'factory',
  712. overHidden: true,
  713. index: 31,
  714. width: 128,
  715. search: true,
  716. }
  717. ]
  718. },
  719. totalData: {},
  720. activeName: '1',
  721. dispatchACarTimer:null
  722. }
  723. },
  724. async created() {
  725. this.entrustOptionTwoT = await this.getColumnData(this.getColumnName(87), this.optionList);
  726. this.query = {
  727. arrivalTime: [defaultDate(4)[0] + ' 00:00:00',defaultDate(4)[1] + ' 23:59:59']
  728. }
  729. this.key++
  730. this.findObject(this.entrustOptionTwoT.column, "plateNo").change = (data) => {
  731. fleetListTwo({plateNo:data.value}).then(res => {
  732. this.goodsList[data.index].driverId = res.data.data[0].driverId
  733. this.goodsList[data.index].driverName = res.data.data[0].driverName
  734. this.goodsList[data.index].tel = res.data.data[0].tel
  735. })
  736. }
  737. this.findObject(this.entrustOptionTwoT.column, "driverId").change = (data) => {
  738. telephone().then(res => {
  739. for (let item in res.data.data) {
  740. if (data.value === res.data.data[item].id) {
  741. this.goodsList[data.index].tel = res.data.data[item].tel
  742. }
  743. }
  744. })
  745. }
  746. let i = 0;
  747. this.entrustOptionTwoT.column.forEach(item => {
  748. if (item.search) i++
  749. })
  750. if (i % 3 !== 0) {
  751. const num = 3 - Number(i % 3)
  752. this.entrustOptionTwoT.searchMenuSpan = num * 8;
  753. this.entrustOptionTwoT.searchMenuPosition = "right";
  754. }
  755. businessStatisticsFrequency().then(res=>{
  756. let this_ = this
  757. this_.dispatchACarTimer = setInterval(function(){
  758. motorcadeDriver({
  759. tag:3,
  760. ...this_.screen
  761. }).then(res=>{
  762. this_.totalData = res.data.data
  763. })
  764. }, Number(res.data.data[0].dictKey)*1000)
  765. })
  766. },
  767. beforeDestroy() {
  768. this.map && this.map.destroy();
  769. clearInterval(this.dispatchACarTimer); //关闭
  770. },
  771. methods: {
  772. confirmChange() {
  773. changeVehicle({
  774. ...this.formData,
  775. id: this.formDataList.id,
  776. originalPlateNo: this.formDataList.vehicleId,
  777. originalDriverName: this.formDataList.driverName,
  778. originalTel: this.formDataList.tel
  779. }).then(res => {
  780. this.dialogChange = false
  781. this.onLoad(this.page)
  782. this.$refs.saveForm.resetForm()
  783. })
  784. },
  785. //变更信息
  786. changeFleetT(row, index) {
  787. let data = [{
  788. dictKey: "2",
  789. dictValue: "未受理"
  790. },{
  791. dictKey: "3",
  792. dictValue: "未完工"
  793. },{
  794. dictKey: "5",
  795. dictValue: "未到厂"
  796. },{
  797. dictKey: "6",
  798. dictValue: "已提箱"
  799. }]
  800. for (let item of data){
  801. if (row.status == item.dictKey){
  802. this.formData = {
  803. status:item.dictKey,
  804. $status:item.dictValue
  805. }
  806. }
  807. }
  808. this.formDataList = row
  809. this.dialogChange = true
  810. this.optionData.column[0].dicUrl = "/api/blade-client/land-vehicle/vehicle-list?fleetId="+this.formDataList.fleetId
  811. },
  812. //打开变更记录
  813. recordsOfChanges(row, index) {
  814. this.dialogRecord = true
  815. recordingDetails({itemId: row.id, kind: 3}).then(res => {
  816. this.dataRecord = res.data.data
  817. })
  818. },
  819. //自定义列保存
  820. async saveColumn() {
  821. /**
  822. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  823. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  824. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  825. */
  826. const inSave = await this.saveColumnData(this.getColumnName(87), this.entrustOptionTwoT);
  827. if (inSave) {
  828. this.$message.success("保存成功");
  829. //关闭窗口
  830. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  831. }
  832. },
  833. //自定义列重置
  834. async resetColumn() {
  835. this.entrustOptionTwoT = this.optionList;
  836. const inSave = await this.delColumnData(this.getColumnName(87), this.optionList);
  837. if (inSave) {
  838. this.$message.success("重置成功");
  839. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  840. }
  841. },
  842. // 获得高度
  843. searchCriteriaSwitch(type) {
  844. if (type) {
  845. this.entrustOptionTwoT.height = this.entrustOptionTwoT.height - 230
  846. } else {
  847. this.entrustOptionTwoT.height = this.entrustOptionTwoT.height + 230
  848. }
  849. this.$refs.crud.getTableHeight()
  850. },
  851. //箱信息保存
  852. rowSave(row, index, done, loading) {
  853. done()
  854. },
  855. //箱信息选择车队
  856. getfleetIdT(data, row) {
  857. this.$set(row, 'fleetName', data.cname)
  858. },
  859. //搜索
  860. searchChange(params, done) {
  861. let data = params
  862. if (params.arrivalTime) {
  863. data.beginArrivalTime = params.arrivalTime[0]
  864. data.endArrivalTime = params.arrivalTime[1]
  865. }
  866. if (params.createTime) {
  867. data.beginCrateTime = params.createTime[0]
  868. data.endCrateTime = params.createTime[1]
  869. }
  870. delete data.arrivalTime
  871. delete data.createTime
  872. this.query = data;
  873. this.onLoad(this.page, params)
  874. done();
  875. },
  876. //查询
  877. onLoad(page, params={}) {
  878. let queryParams = {
  879. size: page.pageSize,
  880. current: page.currentPage,
  881. status: this.activeName,
  882. tag: '3',
  883. ...params,
  884. ...Object.assign(params, this.query)
  885. }
  886. if (queryParams.arrivalTime) {
  887. queryParams.beginArrivalTime = queryParams.arrivalTime[0]
  888. queryParams.endArrivalTime = queryParams.arrivalTime[1]
  889. }
  890. delete queryParams.arrivalTime
  891. this.screen = queryParams
  892. motorcadeDriver({
  893. tag:3,
  894. ...this.screen
  895. }).then(res => {
  896. this.totalData = res.data.data
  897. })
  898. this.loading = true;
  899. driverQueryCollection(queryParams).then(res => {
  900. this.goodsList = res.data.data.records
  901. this.page.total = res.data.data.total
  902. this.entrustOptionTwoT.height = window.innerHeight - 355;
  903. }).finally(() => {
  904. this.loading = false;
  905. })
  906. },
  907. //箱信息保存
  908. rowSaveT(row, index, done, loading) {
  909. if (row.$cellEdit) {
  910. fleetDriverSave(row).then(res => {
  911. this.$message.success("保存成功");
  912. })
  913. }
  914. this.$refs.crud.rowCell(row, index)
  915. },
  916. //切换订单状态
  917. handleClick(tab) {
  918. this.activeName = tab
  919. this.onLoad(this.page)
  920. },
  921. //箱信息派车
  922. designate(row) {
  923. if (row.plateNo) {
  924. this.$confirm('是否确定派车', '提示', {
  925. confirmButtonText: '确定',
  926. cancelButtonText: '取消',
  927. type: 'warning'
  928. }).then(() => {
  929. sendACarCollection(row).then(res => {
  930. this.$message.success('操作成功');
  931. this.onLoad(this.page)
  932. })
  933. }).catch(() => {
  934. this.$message({
  935. type: 'info',
  936. message: '已取消'
  937. });
  938. });
  939. } else {
  940. this.$message.warning('未选择车号,请选择');
  941. }
  942. },
  943. //取消派车
  944. cancelDesignate(row) {
  945. this.$confirm('是否确定取消派车', '提示', {
  946. confirmButtonText: '确定',
  947. cancelButtonText: '取消',
  948. type: 'warning'
  949. }).then(() => {
  950. sendACarDispatchCollection({id: row.id}).then(res => {
  951. this.$message.success('操作成功');
  952. this.onLoad(this.page)
  953. })
  954. }).catch(() => {
  955. this.$message({
  956. type: 'info',
  957. message: '已取消'
  958. });
  959. });
  960. },
  961. //打开附件
  962. annexOpen(row, index) {
  963. this.loadingTwo = false
  964. this.dialogVisible = true
  965. this.form = row
  966. getAttachment({id: row.id}).then(res => {
  967. console.log(res)
  968. this.orderList = res.data.data
  969. })
  970. },
  971. //保存
  972. saveAnnex() {
  973. this.loadingTwo = true
  974. saveAttached({
  975. id: this.form.id,
  976. fileList: this.orderList
  977. }).then(res => {
  978. this.$message.success('保存成功');
  979. this.annexOpen(this.form)
  980. })
  981. },
  982. ToBreak(val) {
  983. if (val)return val.replace(/\n/g, '<br/>')
  984. },
  985. markerClick(e) {
  986. this.infoWindow.setContent(e.target.content);
  987. this.infoWindow.open(this.map, e.target.getPosition());
  988. },
  989. openTrack(row){
  990. location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  991. this.dialogVisibleTwo = true
  992. this.loadingDialog = true
  993. let this_ = this
  994. setTimeout(function () {
  995. this_.initMap(res.data.data, row.plateNo);
  996. this_.loadingDialog = false
  997. }, 2000)
  998. })
  999. },
  1000. initMap(data, plateNo) {
  1001. this.map = new AMap.Map("container", {resizeEnable: true});
  1002. this.infoWindow = new AMap.InfoWindow({
  1003. ffset: new AMap.Pixel(0, -30),
  1004. offset: new AMap.Pixel(0, -30)
  1005. });
  1006. let icon = new AMap.Icon({
  1007. size: new AMap.Size(52, 26), // 图标尺寸
  1008. image: 'https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/che.png',
  1009. imageSize: new AMap.Size(52, 26), // 根据所设置的大小拉伸或压缩图片
  1010. });
  1011. this.marker = new AMap.Marker({
  1012. position: data.location,
  1013. map: this.map,
  1014. icon: icon,
  1015. markerMeta: new AMap.Size(28, 28),
  1016. offset: new AMap.Pixel(-26, -15),
  1017. autoRotation: true,
  1018. angle: -15
  1019. });
  1020. this.marker.content = '<div style="width: 300px;">'
  1021. + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #fff;">' + plateNo + '</p>'
  1022. + '<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>'
  1023. + '<div style="width: 150px;float: left;">'
  1024. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
  1025. + '</div>'
  1026. + '<div style="width: 150px;float: right;">'
  1027. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
  1028. + '</div>'
  1029. + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
  1030. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
  1031. + '</div>'
  1032. this.infoWindow.open(this.map, this.map.getCenter());
  1033. this.marker.on('click', this.markerClick);
  1034. this.marker.emit('click', {target: this.marker});
  1035. this.map.setFitView();
  1036. },
  1037. }
  1038. }
  1039. </script>
  1040. <style lang="scss" scoped>
  1041. #container {
  1042. height: 80vh;
  1043. width: 100%;
  1044. }
  1045. ::v-deep .el-dialog {
  1046. margin-top: 5vh !important;
  1047. margin-bottom: 0 !important;
  1048. }
  1049. ::v-deep .el-dialog__body {
  1050. padding: 0 20px 10px 20px !important;
  1051. }
  1052. ::v-deep .amap-info-content {
  1053. padding: 5px 5px 5px 5px !important;
  1054. }
  1055. ::v-deep .amap-info-close {
  1056. right: 10px !important;
  1057. top: 12px !important;
  1058. }
  1059. .selected{
  1060. color: #1e9fff !important;
  1061. }
  1062. .home-container {
  1063. padding: 0px 5px 5px 5px;
  1064. box-sizing: border-box;
  1065. height: 100%;
  1066. ::v-deep .el-card__body {
  1067. padding: 10px 15px;
  1068. font-size: 14px;
  1069. }
  1070. &__card {
  1071. width: 100%;
  1072. height: 100%;
  1073. }
  1074. .title {
  1075. display: flex;
  1076. justify-content: space-between;
  1077. .right {
  1078. display: flex;
  1079. align-items: center;
  1080. &_but {
  1081. margin-right: 10px;
  1082. border: 1px solid #409eff;
  1083. width: 80px;
  1084. border-radius: 3px;
  1085. display: flex;
  1086. &_left {
  1087. width: 40px;
  1088. text-align: center;
  1089. color: #409eff;
  1090. cursor: pointer;
  1091. }
  1092. &_right {
  1093. width: 40px;
  1094. text-align: center;
  1095. color: #409eff;
  1096. cursor: pointer;
  1097. }
  1098. &_active {
  1099. color: #fff;
  1100. background-color: #409eff;
  1101. }
  1102. }
  1103. }
  1104. }
  1105. }
  1106. .content {
  1107. display: flex;
  1108. justify-content: center;
  1109. align-items: center;
  1110. height: 6vh;
  1111. width: 80vw;
  1112. .divider {
  1113. display: block;
  1114. height: 0px;
  1115. width: 100%;
  1116. border-top: 1px dashed #dcdfe6;
  1117. }
  1118. &-item {
  1119. margin-left: 1vw;
  1120. .card {
  1121. width: 130px;
  1122. display: flex;
  1123. align-items: center;
  1124. &-title {
  1125. width: 40px;
  1126. height: 40px;
  1127. text-align: center;
  1128. border-radius: 50%;
  1129. font-size: 20px;
  1130. font-weight: 600;
  1131. display: flex;
  1132. justify-content: center;
  1133. align-items: center;
  1134. span {
  1135. line-height: 20px;
  1136. }
  1137. }
  1138. &-title1 {
  1139. color: #037fe1;
  1140. background-color: rgba(3, 127, 225, 0.15);
  1141. }
  1142. &-title2 {
  1143. color: #ffa21e;
  1144. background-color: rgba(255, 162, 30, 0.15);
  1145. }
  1146. &-title3 {
  1147. color: #fb5b60;
  1148. background-color: rgba(251, 91, 96, 0.15);
  1149. }
  1150. &-title4 {
  1151. color: #42bc6f;
  1152. background-color: rgba(66, 188, 111, 0.15);
  1153. }
  1154. &-title5 {
  1155. color: #14cde1;
  1156. background-color: rgba(52, 149, 161, 0.15);
  1157. }
  1158. &-title6 {
  1159. color: rgba(4, 66, 31, 0.63);
  1160. background-color: rgba(66, 188, 111, 0.15);
  1161. }
  1162. &-content {
  1163. padding-left: 1vw;
  1164. display: flex;
  1165. flex-direction: column;
  1166. &-num {
  1167. font-size: 20px;
  1168. font-weight: 600;
  1169. }
  1170. &-text {
  1171. color: #909399;
  1172. }
  1173. }
  1174. }
  1175. }
  1176. }
  1177. </style>