index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  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. @on-load="onLoad"
  83. @resetColumn="resetColumn"
  84. @saveColumn="saveColumn"
  85. @search-change="searchChange"
  86. @search-reset="query={};activeName = ''"
  87. @search-criteria-switch="searchCriteriaSwitch"
  88. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  89. @row-update="rowSave">
  90. <template slot-scope="{row}" slot="fleetId">
  91. <span>{{ row.fleetName }}</span>
  92. </template>
  93. <template slot-scope="{row}" slot="fleetIdSearch">
  94. <crop-select
  95. v-model="row.fleetId"
  96. corpType="CD"
  97. ></crop-select>
  98. </template>
  99. <template slot-scope="{row}" slot="plateNo">
  100. <span class="el-button--text" style="cursor: pointer"
  101. @click="openTrack(row)">{{ row.plateNo }}</span>
  102. </template>
  103. <template slot-scope="{row,index}" slot="menu">
  104. <el-button
  105. type="text"
  106. size="small"
  107. v-if="row.status===1"
  108. @click="rowSaveT(row,index)"
  109. >{{ row.$cellEdit ? '保 存' : '修 改' }}
  110. </el-button>
  111. <el-button
  112. size="small"
  113. type="text"
  114. @click="designate(row, index)"
  115. v-if="row.status===1"
  116. >派 车
  117. </el-button>
  118. <el-button
  119. size="small"
  120. type="text"
  121. @click="cancelDesignate(row, index)"
  122. v-if="row.status===2"
  123. >取消派车
  124. </el-button>
  125. <el-button
  126. size="small"
  127. type="text"
  128. @click="annexOpen(row, index)"
  129. >附 件
  130. </el-button>
  131. <el-button
  132. size="small"
  133. type="text"
  134. @click="changeFleetT(row, index)"
  135. v-if="row.status !== 0 && row.status !== 1 && row.status !== 2 && row.status !== 4"
  136. >变 更
  137. </el-button>
  138. <el-button
  139. size="small"
  140. type="text"
  141. @click="recordsOfChanges(row, index)"
  142. v-if="row.status > 2"
  143. >变更记录
  144. </el-button>
  145. </template>
  146. <template slot="addressDetail" slot-scope="{ row,index}">
  147. <el-tooltip class="item" effect="dark" placement="top">
  148. <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
  149. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.addressDetail }}</div>
  150. </el-tooltip>
  151. </template>
  152. </avue-crud>
  153. <el-dialog
  154. title="附件"
  155. :visible.sync="dialogVisible"
  156. append-to-body
  157. width="70%">
  158. <c-upload
  159. typeUpload="PC"
  160. :basic="true"
  161. deleteUrl="/api/blade-client/common-file/remove"
  162. :data="orderList"
  163. :enumerationValue="76"
  164. ></c-upload>
  165. <span slot="footer" class="dialog-footer">
  166. <el-button @click="dialogVisible = false" size="small">取 消</el-button>
  167. <el-button type="primary" @click="saveAnnex" size="small" :loading="loadingTwo" :disabled="form.status >= 2">保 存</el-button>
  168. </span>
  169. </el-dialog>
  170. <el-dialog
  171. title="变更"
  172. :visible.sync="dialogChange"
  173. append-to-body
  174. width="70%">
  175. <avue-form :option="optionData" v-model="formData" v-if="dialogChange" ref="saveForm">
  176. </avue-form>
  177. <span slot="footer" class="dialog-footer">
  178. <el-button @click="dialogChange = false" size="small">关 闭</el-button>
  179. <el-button type="primary" @click="confirmChange" size="small">确 定</el-button>
  180. </span>
  181. </el-dialog>
  182. <el-dialog
  183. title="变更记录"
  184. :visible.sync="dialogRecord"
  185. append-to-body
  186. width="70%">
  187. <avue-crud :data="dataRecord" :option="optionRecord" style="margin-top: -43px"></avue-crud>
  188. <span slot="footer" class="dialog-footer">
  189. <el-button @click="dialogRecord = false" size="small">关 闭</el-button>
  190. </span>
  191. </el-dialog>
  192. </basic-container>
  193. <el-dialog
  194. title="车辆轨迹"
  195. append-to-body
  196. custom-class="dialog_two"
  197. :visible.sync="dialogVisibleTwo"
  198. lock-scroll
  199. width="80%">
  200. <div id="container"></div>
  201. </el-dialog>
  202. </div>
  203. </template>
  204. <script>
  205. import {
  206. sendACarCollection,
  207. sendACarDispatchCollection,
  208. driverQueryCollection,
  209. fleetList,
  210. motorcadeDriver,
  211. fleetDriverSave, telephone, getAttachment, saveAttached, recordingDetails, changeVehicle
  212. } from "@/api/landTransportation";
  213. import {location} from "@/api/gaude";
  214. export default {
  215. name: "index",
  216. data() {
  217. return {
  218. key: 0,
  219. query:{},
  220. dialogVisibleTwo:false,
  221. map: null,
  222. infoWindow: null,
  223. marker: null,
  224. formDataList:{},
  225. optionData: {
  226. span: 12,
  227. menuBtn: false,
  228. column: [{
  229. label: "车号",
  230. prop: "plateNo",
  231. allowCreate: true,
  232. overHidden: true,
  233. filterable: true,
  234. cascader: ['driverId'],
  235. type: 'select',
  236. dicUrl: '',
  237. props: {
  238. label: "plateNo",
  239. value: "plateNo"
  240. },
  241. change: (data) => {
  242. fleetList().then(res => {
  243. for (let item in res.data.data) {
  244. if (data.value === res.data.data[item].plateNo) {
  245. this.formData.driverId = res.data.data[item].driverId
  246. this.formData.driverName = res.data.data[item].driverName
  247. this.formData.tel = res.data.data[item].tel
  248. }
  249. }
  250. })
  251. }
  252. }, {
  253. label: '状态',
  254. overHidden: true,
  255. width: 100,
  256. type: 'select',
  257. index: 14,
  258. props: {
  259. label: "dictValue",
  260. value: "dictKey"
  261. },
  262. dicData:[{
  263. dictKey: "2",
  264. dictValue: "未受理"
  265. },{
  266. dictKey: "3",
  267. dictValue: "未完工"
  268. },{
  269. dictKey: "5",
  270. dictValue: "未到厂"
  271. },{
  272. dictKey: "6",
  273. dictValue: "已提箱"
  274. }],
  275. prop: 'status'
  276. }, {
  277. label: "司机",
  278. prop: "driverId",
  279. type: 'select',
  280. dicUrl: "/api/blade-client/land-driver/driver-list?vehicleId={{key}}",
  281. props: {
  282. label: "name",
  283. value: "id"
  284. },
  285. change: (data) => {
  286. telephone().then(res => {
  287. for (let item in res.data.data) {
  288. if (data.value === res.data.data[item].id) {
  289. this.formData.tel = res.data.data[item].tel
  290. }
  291. }
  292. })
  293. }
  294. }, {
  295. label: "电话",
  296. prop: "tel",
  297. }]
  298. },
  299. dialogRecord: false,
  300. dialogChange: false,
  301. formData: {},
  302. dataRecord: [],
  303. optionRecord: {
  304. stripe: true,
  305. refreshBtn: false,
  306. columnBtn: false,
  307. menu: false,
  308. addBtn: false,
  309. align: 'center',
  310. column: [
  311. {
  312. label: '变更内容',
  313. prop: 'content'
  314. }, {
  315. label: '变更人',
  316. prop: 'changeUserName'
  317. }, {
  318. label: '变更时间',
  319. prop: 'changeTime'
  320. }
  321. ]
  322. },
  323. form: {},
  324. loadingTwo:false,
  325. dialogVisible: false,
  326. orderList: [],
  327. loading: false,
  328. page: {
  329. pageSize: 10,
  330. currentPage: 1,
  331. total: 0,
  332. pageSizes: [10, 50, 100, 200, 300]
  333. },
  334. roleName: localStorage.getItem("roleName").split(',')[0],
  335. goodsList: [],
  336. entrustOptionTwoT: {},
  337. optionList: {
  338. stripe: true,
  339. align: 'center',
  340. menuAlign: 'center',
  341. index: true,
  342. addBtn: false,
  343. delBtn: false,
  344. menuWidth:150,
  345. cellBtn: false,
  346. cancelBtn: false,
  347. editBtn: false,
  348. addRowBtn: false,
  349. searchIcon: true,
  350. searchIndex: 2,
  351. searchSpan: 8,
  352. height: "auto",
  353. showSummary: true,
  354. summaryText: "合计",
  355. sumColumnList: [
  356. {
  357. name: 'landWeight',
  358. type: 'sum',
  359. decimals: 2
  360. }, {
  361. name: 'landAmountC',
  362. type: 'sum',
  363. decimals: 2
  364. }, {
  365. name: 'landAmountD',
  366. type: 'sum',
  367. decimals: 2
  368. }, {
  369. name: 'ctnQuantity',
  370. type: 'count'
  371. }, {
  372. name: 'oneFeeC',
  373. type: 'sum',
  374. decimals: 2
  375. }, {
  376. name: 'twoFeeC',
  377. type: 'sum',
  378. decimals: 2
  379. }, {
  380. name: 'threeFeeC',
  381. type: 'sum',
  382. decimals: 2
  383. }, {
  384. name: 'fourFeeC',
  385. type: 'sum',
  386. decimals: 2
  387. }, {
  388. name: 'fiveFeeC',
  389. type: 'sum',
  390. decimals: 2
  391. }],
  392. column: [ {
  393. label: '货运日期',
  394. prop: 'arrivalTime',
  395. overHidden: true,
  396. type: "date",
  397. searchRange: true,
  398. defaultTime: ['00:00:00', '23:59:59'],
  399. format: "yyyy-MM-dd HH:mm",
  400. valueFormat: "yyyy-MM-dd HH:mm:ss",
  401. index: 1,
  402. width: 119,
  403. search: true,
  404. }, {
  405. label: '物流运输',
  406. prop: 'dispatchDeptName',
  407. overHidden: true,
  408. index: 1,
  409. width: 82,
  410. }, {
  411. label: '运输调度',
  412. prop: 'dispatcherName',
  413. overHidden: true,
  414. index: 1,
  415. width: 70,
  416. }, {
  417. label: '货运地点',
  418. index: 2,
  419. width: 138,
  420. search: true,
  421. prop: 'addressDetail'
  422. }, {
  423. label: '提单号',
  424. width: 140,
  425. index: 3,
  426. search: true,
  427. overHidden: true,
  428. prop: 'billNo'
  429. }, {
  430. label: '场站',
  431. prop: 'station',
  432. overHidden: true,
  433. index: 4,
  434. width: 68,
  435. search: true,
  436. }, {
  437. label: '箱型',
  438. width: 68,
  439. index: 5,
  440. search: true,
  441. overHidden: true,
  442. prop: 'ctnType',
  443. type: 'select',
  444. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  445. props: {
  446. label: "dictValue",
  447. value: "dictValue"
  448. }
  449. }, {
  450. label: '箱量',
  451. width: 58,
  452. index: 6,
  453. overHidden: true,
  454. prop: 'ctnQuantity'
  455. },
  456. {
  457. label: '车队',
  458. width: 90,
  459. search: true,
  460. index: 7,
  461. // hide:true,
  462. // showColumn: false,
  463. filterable: true,
  464. disabled: true,
  465. type: 'select',
  466. cascader: ['plateNo'],
  467. overHidden: true,
  468. prop: 'fleetId',
  469. dicUrl: "/api/blade-client/land-vehicle/list?size=1000&current=1&corpType=CD",
  470. props: {
  471. label: "fleetName",
  472. value: "fleetId",
  473. res: "data.records"
  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.key++
  727. this.findObject(this.entrustOptionTwoT.column, "plateNo").change = (data) => {
  728. fleetList({fleetId:data.row.fleetId}).then(res => {
  729. for (let item in res.data.data) {
  730. if (data.value === res.data.data[item].plateNo) {
  731. this.goodsList[data.index].driverId = res.data.data[item].driverId
  732. this.goodsList[data.index].driverName = res.data.data[item].driverName
  733. this.goodsList[data.index].tel = res.data.data[item].tel
  734. }
  735. }
  736. })
  737. }
  738. this.findObject(this.entrustOptionTwoT.column, "driverId").change = (data) => {
  739. telephone().then(res => {
  740. for (let item in res.data.data) {
  741. if (data.value === res.data.data[item].id) {
  742. this.goodsList[data.index].tel = res.data.data[item].tel
  743. }
  744. }
  745. })
  746. }
  747. let i = 0;
  748. this.entrustOptionTwoT.column.forEach(item => {
  749. if (item.search) i++
  750. })
  751. if (i % 3 !== 0) {
  752. const num = 3 - Number(i % 3)
  753. this.entrustOptionTwoT.searchMenuSpan = num * 8;
  754. this.entrustOptionTwoT.searchMenuPosition = "right";
  755. }
  756. let this_ = this
  757. this_.dispatchACarTimer = setInterval(function(){
  758. motorcadeDriver(3).then(res=>{
  759. this_.totalData = res.data.data
  760. })
  761. },5000)
  762. },
  763. beforeDestroy() {
  764. this.map && this.map.destroy();
  765. clearInterval(this.dispatchACarTimer); //关闭
  766. },
  767. methods: {
  768. confirmChange() {
  769. changeVehicle({
  770. ...this.formData,
  771. id: this.formDataList.id,
  772. originalPlateNo: this.formDataList.vehicleId,
  773. originalDriverName: this.formDataList.driverName,
  774. originalTel: this.formDataList.tel
  775. }).then(res => {
  776. this.dialogChange = false
  777. this.onLoad(this.page)
  778. this.$refs.saveForm.resetForm()
  779. })
  780. },
  781. //变更信息
  782. changeFleetT(row, index) {
  783. let data = [{
  784. dictKey: "2",
  785. dictValue: "未受理"
  786. },{
  787. dictKey: "3",
  788. dictValue: "未完工"
  789. },{
  790. dictKey: "5",
  791. dictValue: "未到厂"
  792. },{
  793. dictKey: "6",
  794. dictValue: "已提箱"
  795. }]
  796. for (let item of data){
  797. if (row.status == item.dictKey){
  798. this.formData = {
  799. status:item.dictKey,
  800. $status:item.dictValue
  801. }
  802. }
  803. }
  804. this.formDataList = row
  805. this.dialogChange = true
  806. this.optionData.column[0].dicUrl = "/api/blade-client/land-vehicle/vehicle-list?fleetId="+this.formDataList.fleetId
  807. },
  808. //打开变更记录
  809. recordsOfChanges(row, index) {
  810. this.dialogRecord = true
  811. recordingDetails({itemId: row.id, kind: 3}).then(res => {
  812. this.dataRecord = res.data.data
  813. })
  814. },
  815. //自定义列保存
  816. async saveColumn() {
  817. /**
  818. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  819. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  820. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  821. */
  822. const inSave = await this.saveColumnData(this.getColumnName(87), this.entrustOptionTwoT);
  823. if (inSave) {
  824. this.$message.success("保存成功");
  825. //关闭窗口
  826. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  827. }
  828. },
  829. //自定义列重置
  830. async resetColumn() {
  831. this.entrustOptionTwoT = this.optionList;
  832. const inSave = await this.delColumnData(this.getColumnName(87), this.optionList);
  833. if (inSave) {
  834. this.$message.success("重置成功");
  835. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  836. }
  837. },
  838. // 获得高度
  839. searchCriteriaSwitch(type) {
  840. if (type) {
  841. this.entrustOptionTwoT.height = this.entrustOptionTwoT.height - 230
  842. } else {
  843. this.entrustOptionTwoT.height = this.entrustOptionTwoT.height + 230
  844. }
  845. this.$refs.crud.getTableHeight()
  846. },
  847. //箱信息保存
  848. rowSave(row, index, done, loading) {
  849. done()
  850. },
  851. //箱信息选择车队
  852. getfleetIdT(data, row) {
  853. this.$set(row, 'fleetName', data.cname)
  854. },
  855. //搜索
  856. searchChange(params, done) {
  857. let data = params
  858. if (params.arrivalTime) {
  859. data.beginArrivalTime = params.arrivalTime[0]
  860. data.endArrivalTime = params.arrivalTime[1]
  861. }
  862. if (params.createTime) {
  863. data.beginCrateTime = params.createTime[0]
  864. data.endCrateTime = params.createTime[1]
  865. }
  866. delete data.arrivalTime
  867. delete data.createTime
  868. this.query = data;
  869. this.onLoad(this.page, params)
  870. done();
  871. },
  872. //查询
  873. onLoad(page, params={}) {
  874. motorcadeDriver(3).then(res => {
  875. this.totalData = res.data.data
  876. })
  877. let queryParams = {
  878. size: page.pageSize,
  879. current: page.currentPage,
  880. status: this.activeName,
  881. tag: '3',
  882. ...params,
  883. ...Object.assign(params, this.query)
  884. }
  885. this.loading = true;
  886. driverQueryCollection(queryParams).then(res => {
  887. this.goodsList = res.data.data.records
  888. this.page.total = res.data.data.total
  889. this.entrustOptionTwoT.height = window.innerHeight - 355;
  890. }).finally(() => {
  891. this.loading = false;
  892. })
  893. },
  894. //箱信息保存
  895. rowSaveT(row, index, done, loading) {
  896. if (row.$cellEdit) {
  897. fleetDriverSave(row).then(res => {
  898. this.$message.success("保存成功");
  899. })
  900. }
  901. this.$refs.crud.rowCell(row, index)
  902. },
  903. //切换订单状态
  904. handleClick(tab) {
  905. this.activeName = tab
  906. this.onLoad(this.page)
  907. },
  908. //箱信息派车
  909. designate(row) {
  910. if (row.plateNo) {
  911. this.$confirm('是否确定派车', '提示', {
  912. confirmButtonText: '确定',
  913. cancelButtonText: '取消',
  914. type: 'warning'
  915. }).then(() => {
  916. sendACarCollection(row).then(res => {
  917. this.$message.success('操作成功');
  918. this.onLoad(this.page)
  919. })
  920. }).catch(() => {
  921. this.$message({
  922. type: 'info',
  923. message: '已取消'
  924. });
  925. });
  926. } else {
  927. this.$message.warning('未选择车号,请选择');
  928. }
  929. },
  930. //取消派车
  931. cancelDesignate(row) {
  932. this.$confirm('是否确定取消派车', '提示', {
  933. confirmButtonText: '确定',
  934. cancelButtonText: '取消',
  935. type: 'warning'
  936. }).then(() => {
  937. sendACarDispatchCollection({id: row.id}).then(res => {
  938. this.$message.success('操作成功');
  939. this.onLoad(this.page)
  940. })
  941. }).catch(() => {
  942. this.$message({
  943. type: 'info',
  944. message: '已取消'
  945. });
  946. });
  947. },
  948. //打开附件
  949. annexOpen(row, index) {
  950. this.loadingTwo = false
  951. this.dialogVisible = true
  952. this.form = row
  953. getAttachment({id: row.id}).then(res => {
  954. console.log(res)
  955. this.orderList = res.data.data
  956. })
  957. },
  958. //保存
  959. saveAnnex() {
  960. this.loadingTwo = true
  961. saveAttached({
  962. id: this.form.id,
  963. fileList: this.orderList
  964. }).then(res => {
  965. this.$message.success('保存成功');
  966. this.annexOpen(this.form)
  967. })
  968. },
  969. ToBreak(val) {
  970. if (val)return val.replace(/\n/g, '<br/>')
  971. },
  972. markerClick(e) {
  973. this.infoWindow.setContent(e.target.content);
  974. this.infoWindow.open(this.map, e.target.getPosition());
  975. },
  976. openTrack(row){
  977. location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  978. this.dialogVisibleTwo = true
  979. let this_ = this
  980. setTimeout(function () {
  981. this_.initMap(res.data.data, row.plateNo);
  982. }, 1000)
  983. })
  984. },
  985. initMap(data, plateNo) {
  986. this.map = new AMap.Map("container", {resizeEnable: true});
  987. this.infoWindow = new AMap.InfoWindow({
  988. ffset: new AMap.Pixel(0, -30),
  989. offset: new AMap.Pixel(0, -30)
  990. });
  991. let icon = new AMap.Icon({
  992. size: new AMap.Size(52, 26), // 图标尺寸
  993. image: 'https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/che.png',
  994. imageSize: new AMap.Size(52, 26), // 根据所设置的大小拉伸或压缩图片
  995. });
  996. this.marker = new AMap.Marker({
  997. position: data.location,
  998. map: this.map,
  999. icon: icon,
  1000. markerMeta: new AMap.Size(28, 28),
  1001. offset: new AMap.Pixel(-26, -15),
  1002. autoRotation: true,
  1003. angle: -15
  1004. });
  1005. this.marker.content = '<div style="width: 300px;">'
  1006. + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #fff;">' + plateNo + '</p>'
  1007. + '<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>'
  1008. + '<div style="width: 150px;float: left;">'
  1009. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
  1010. + '</div>'
  1011. + '<div style="width: 150px;float: right;">'
  1012. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
  1013. + '</div>'
  1014. + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
  1015. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
  1016. + '</div>'
  1017. this.infoWindow.open(this.map, this.map.getCenter());
  1018. this.marker.on('click', this.markerClick);
  1019. this.marker.emit('click', {target: this.marker});
  1020. this.map.setFitView();
  1021. },
  1022. }
  1023. }
  1024. </script>
  1025. <style lang="scss" scoped>
  1026. #container {
  1027. height: 80vh;
  1028. width: 100%;
  1029. }
  1030. ::v-deep .el-dialog {
  1031. margin-top: 5vh !important;
  1032. margin-bottom: 0 !important;
  1033. }
  1034. ::v-deep .el-dialog__body {
  1035. padding: 0 20px 10px 20px !important;
  1036. }
  1037. ::v-deep .amap-info-content {
  1038. padding: 5px 5px 5px 5px !important;
  1039. }
  1040. ::v-deep .amap-info-close {
  1041. right: 10px !important;
  1042. top: 12px !important;
  1043. }
  1044. .selected{
  1045. color: #1e9fff !important;
  1046. }
  1047. .home-container {
  1048. padding: 0px 5px 5px 5px;
  1049. box-sizing: border-box;
  1050. height: 100%;
  1051. ::v-deep .el-card__body {
  1052. padding: 10px 15px;
  1053. font-size: 14px;
  1054. }
  1055. &__card {
  1056. width: 100%;
  1057. height: 100%;
  1058. }
  1059. .title {
  1060. display: flex;
  1061. justify-content: space-between;
  1062. .right {
  1063. display: flex;
  1064. align-items: center;
  1065. &_but {
  1066. margin-right: 10px;
  1067. border: 1px solid #409eff;
  1068. width: 80px;
  1069. border-radius: 3px;
  1070. display: flex;
  1071. &_left {
  1072. width: 40px;
  1073. text-align: center;
  1074. color: #409eff;
  1075. cursor: pointer;
  1076. }
  1077. &_right {
  1078. width: 40px;
  1079. text-align: center;
  1080. color: #409eff;
  1081. cursor: pointer;
  1082. }
  1083. &_active {
  1084. color: #fff;
  1085. background-color: #409eff;
  1086. }
  1087. }
  1088. }
  1089. }
  1090. }
  1091. .content {
  1092. display: flex;
  1093. justify-content: center;
  1094. align-items: center;
  1095. height: 6vh;
  1096. width: 80vw;
  1097. .divider {
  1098. display: block;
  1099. height: 0px;
  1100. width: 100%;
  1101. border-top: 1px dashed #dcdfe6;
  1102. }
  1103. &-item {
  1104. margin-left: 1vw;
  1105. .card {
  1106. width: 130px;
  1107. display: flex;
  1108. align-items: center;
  1109. &-title {
  1110. width: 40px;
  1111. height: 40px;
  1112. text-align: center;
  1113. border-radius: 50%;
  1114. font-size: 20px;
  1115. font-weight: 600;
  1116. display: flex;
  1117. justify-content: center;
  1118. align-items: center;
  1119. span {
  1120. line-height: 20px;
  1121. }
  1122. }
  1123. &-title1 {
  1124. color: #037fe1;
  1125. background-color: rgba(3, 127, 225, 0.15);
  1126. }
  1127. &-title2 {
  1128. color: #ffa21e;
  1129. background-color: rgba(255, 162, 30, 0.15);
  1130. }
  1131. &-title3 {
  1132. color: #fb5b60;
  1133. background-color: rgba(251, 91, 96, 0.15);
  1134. }
  1135. &-title4 {
  1136. color: #42bc6f;
  1137. background-color: rgba(66, 188, 111, 0.15);
  1138. }
  1139. &-title5 {
  1140. color: #14cde1;
  1141. background-color: rgba(52, 149, 161, 0.15);
  1142. }
  1143. &-title6 {
  1144. color: rgba(4, 66, 31, 0.63);
  1145. background-color: rgba(66, 188, 111, 0.15);
  1146. }
  1147. &-content {
  1148. padding-left: 1vw;
  1149. display: flex;
  1150. flex-direction: column;
  1151. &-num {
  1152. font-size: 20px;
  1153. font-weight: 600;
  1154. }
  1155. &-text {
  1156. color: #909399;
  1157. }
  1158. }
  1159. }
  1160. }
  1161. }
  1162. </style>