index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  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. clearable:false,
  401. defaultTime: ['00:00:00', '23:59:59'],
  402. format: "yyyy-MM-dd HH:mm",
  403. valueFormat: "yyyy-MM-dd HH:mm:ss",
  404. index: 1,
  405. width: 119,
  406. search: true,
  407. }, {
  408. label: '物流运输',
  409. prop: 'dispatchDeptName',
  410. overHidden: true,
  411. index: 1,
  412. width: 82,
  413. }, {
  414. label: '运输调度',
  415. prop: 'dispatcherName',
  416. overHidden: true,
  417. index: 1,
  418. width: 70,
  419. }, {
  420. label: '货运地点',
  421. index: 2,
  422. width: 138,
  423. search: true,
  424. prop: 'addressDetail'
  425. }, {
  426. label: '提单号',
  427. width: 140,
  428. index: 3,
  429. search: true,
  430. overHidden: true,
  431. prop: 'billNo'
  432. }, {
  433. label: '场站',
  434. prop: 'station',
  435. overHidden: true,
  436. index: 4,
  437. width: 68,
  438. search: true,
  439. }, {
  440. label: '箱型',
  441. width: 68,
  442. index: 5,
  443. search: true,
  444. overHidden: true,
  445. prop: 'ctnType',
  446. type: 'select',
  447. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  448. props: {
  449. label: "dictValue",
  450. value: "dictValue"
  451. }
  452. }, {
  453. label: '箱量',
  454. width: 58,
  455. index: 6,
  456. overHidden: true,
  457. prop: 'ctnQuantity'
  458. },
  459. {
  460. label: '车队',
  461. width: 90,
  462. search: true,
  463. index: 7,
  464. // hide:true,
  465. disabled:true,
  466. showColumn: false,
  467. filterable: true,
  468. type: 'select',
  469. cascader: ['plateNo','driverId'],
  470. overHidden: true,
  471. prop: 'fleetId',
  472. dicUrl: "/api/blade-client/corpsdesc/fleetList",
  473. props: {
  474. label: "cname",
  475. value: "id"
  476. },
  477. cell: true
  478. }, {
  479. label: '车号',
  480. width: 82,
  481. cell: true,
  482. search: true,
  483. index: 8,
  484. allowCreate: true,
  485. prop: "plateNo",
  486. overHidden: true,
  487. filterable: true,
  488. cascader: ['driverId'],
  489. type: "select",
  490. dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
  491. props: {
  492. label: "plateNo",
  493. value: "plateNo"
  494. },
  495. },
  496. {
  497. label: '司机',
  498. width: 77,
  499. search: true,
  500. overHidden: true,
  501. cell: true,
  502. filterable: true,
  503. index: 9,
  504. prop: 'driverId',
  505. type: "select",
  506. dicUrl: `/api/blade-client/land-driver/driver-list?plateNo={{key}}&fleetId=${ `{{fleetId}}` ? `{{fleetId}}` : '' }`,
  507. props: {
  508. label: "name",
  509. value: "id",
  510. res: "res.data"
  511. }
  512. }, {
  513. label: '电话',
  514. overHidden: true,
  515. width: 124,
  516. search: true,
  517. cell: true,
  518. index: 10,
  519. prop: 'tel'
  520. }, {
  521. label: '平台号',
  522. width: 100,
  523. index: 11,
  524. search: true,
  525. overHidden: true,
  526. prop: 'orderNo'
  527. },{
  528. label: '箱号',
  529. overHidden: true,
  530. width: 140,
  531. index: 12,
  532. search: true,
  533. prop: 'ctnNo'
  534. },{
  535. label: '实际到厂时间',
  536. prop: 'realArrivalTime',
  537. overHidden: true,
  538. type: "date",
  539. searchRange: true,
  540. defaultTime: ['00:00:00', '23:59:59'],
  541. format: "yyyy-MM-dd HH:mm",
  542. valueFormat: "yyyy-MM-dd HH:mm:ss",
  543. index: 14,
  544. width: 132
  545. },{
  546. label: '受理日期',
  547. type: "datetime",
  548. format: 'yyyy-MM-dd HH:mm',
  549. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  550. width: 132,
  551. index: 13,
  552. prop: 'acceptTime'
  553. },{
  554. label: '完工日期',
  555. prop: 'finishedTime',
  556. overHidden: true,
  557. type: "date",
  558. searchRange: true,
  559. defaultTime: ['00:00:00', '23:59:59'],
  560. format: "yyyy-MM-dd HH:mm",
  561. valueFormat: "yyyy-MM-dd HH:mm:ss",
  562. index:15,
  563. width: 132,
  564. },{
  565. label: '货物名称',
  566. overHidden: true,
  567. width: 100,
  568. search: true,
  569. index: 16,
  570. prop: 'goods'
  571. }, {
  572. label: '件数',
  573. width: 75,
  574. search: true,
  575. index: 17,
  576. overHidden: true,
  577. controls: false,
  578. cell: true,
  579. prop: 'quantity',
  580. type: 'number',
  581. precision:0
  582. }, {
  583. label: '重量(吨)',
  584. width: 75,
  585. prop: 'landWeight',
  586. controls: false,
  587. overHidden: true,
  588. index: 18,
  589. precision: 2,
  590. type: 'number'
  591. },
  592. // {
  593. // label: '包装',
  594. // width: 100,
  595. // search: true,
  596. // index: 6,
  597. // overHidden: true,
  598. // cell: true,
  599. // prop: 'packing',
  600. // type: 'select',
  601. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  602. // props: {
  603. // label: "dictValue",
  604. // value: "dictValue"
  605. // },
  606. // },
  607. {
  608. label: '尺码',
  609. width: 75,
  610. // search: true,
  611. index:19,
  612. overHidden: true,
  613. cell: true,
  614. prop: 'size',
  615. },
  616. // {
  617. // label: '陆运费(D)',
  618. // overHidden: true,
  619. // prop: 'landAmountD'
  620. // },
  621. {
  622. label: '应付陆运费',
  623. overHidden: true,
  624. index: 20,
  625. width: 68,
  626. cell: true,
  627. prop: 'landAmountC'
  628. }, {
  629. label: '委托备注',
  630. overHidden: true,
  631. index: 21,
  632. width: 238,
  633. prop: 'remarks'
  634. }, {
  635. label: '车队备注',
  636. cell: true,
  637. index: 22,
  638. width: 238,
  639. overHidden: true,
  640. prop: 'fleetRemarks'
  641. }, {
  642. label: '司机备注',
  643. overHidden: true,
  644. width: 238,
  645. index: 23,
  646. prop: 'driverRemarks'
  647. },
  648. // {
  649. // label: '场站费',
  650. // width: 100,
  651. // precision: 2,
  652. // cell: true,
  653. // index: 24,
  654. // controls: false,
  655. // type: 'number',
  656. // prop: 'oneFeeC'
  657. // }, {
  658. // label: '港杂费',
  659. // width: 100,
  660. // precision: 2,
  661. // cell: true,
  662. // index: 25,
  663. // controls: false,
  664. // type: 'number',
  665. // prop: 'twoFeeC'
  666. // }, {
  667. // label: '扣款',
  668. // width: 100,
  669. // precision: 2,
  670. // index: 26,
  671. // cell: true,
  672. // controls: false,
  673. // type: 'number',
  674. // prop: 'threeFeeC'
  675. // }, {
  676. // label: '待时费',
  677. // width: 100,
  678. // precision: 2,
  679. // index: 27,
  680. // cell: true,
  681. // controls: false,
  682. // type: 'number',
  683. // prop: 'fourFeeC'
  684. // }, {
  685. // label: '其他',
  686. // width: 100,
  687. // precision: 2,
  688. // index: 28,
  689. // cell: true,
  690. // type: 'number',
  691. // controls: false,
  692. // prop: 'fiveFeeC'
  693. // }, {
  694. // label: '费用备注',
  695. // width: 245,
  696. // index: 29,
  697. // cell: true,
  698. // prop: 'feeRemarksC'
  699. // },
  700. {
  701. label: '制单日期',
  702. overHidden: true,
  703. prop: 'createTime',
  704. type: "date",
  705. searchRange: true,
  706. defaultTime: ['00:00:00', '23:59:59'],
  707. format: "yyyy-MM-dd HH:mm",
  708. valueFormat: "yyyy-MM-dd HH:mm:ss",
  709. index: 30,
  710. width: 100,
  711. search: true,
  712. }, {
  713. label: '船名航次',
  714. prop: 'factory',
  715. overHidden: true,
  716. index: 31,
  717. width: 128,
  718. search: true,
  719. }
  720. ]
  721. },
  722. totalData: {},
  723. activeName: '1',
  724. dispatchACarTimer:null
  725. }
  726. },
  727. async created() {
  728. this.entrustOptionTwoT = await this.getColumnData(this.getColumnName(87), this.optionList);
  729. this.query = {
  730. arrivalTime: [defaultDate(4)[0] + ' 00:00:00',defaultDate(4)[1] + ' 23:59:59']
  731. }
  732. this.key++
  733. this.findObject(this.entrustOptionTwoT.column, "plateNo").change = (data) => {
  734. fleetListTwo({plateNo:data.value}).then(res => {
  735. this.goodsList[data.index].driverId = res.data.data[0].driverId
  736. this.goodsList[data.index].driverName = res.data.data[0].driverName
  737. this.goodsList[data.index].tel = res.data.data[0].tel
  738. })
  739. }
  740. this.findObject(this.entrustOptionTwoT.column, "driverId").change = (data) => {
  741. telephone().then(res => {
  742. for (let item in res.data.data) {
  743. if (data.value === res.data.data[item].id) {
  744. this.goodsList[data.index].tel = res.data.data[item].tel
  745. }
  746. }
  747. })
  748. }
  749. let i = 0;
  750. this.entrustOptionTwoT.column.forEach(item => {
  751. if (item.search) i++
  752. })
  753. if (i % 3 !== 0) {
  754. const num = 3 - Number(i % 3)
  755. this.entrustOptionTwoT.searchMenuSpan = num * 8;
  756. this.entrustOptionTwoT.searchMenuPosition = "right";
  757. }
  758. businessStatisticsFrequency().then(res=>{
  759. let this_ = this
  760. this_.dispatchACarTimer = setInterval(function(){
  761. motorcadeDriver({
  762. tag:3,
  763. ...this_.screen
  764. }).then(res=>{
  765. this_.totalData = res.data.data
  766. })
  767. }, Number(res.data.data[0].dictKey)*1000)
  768. })
  769. },
  770. beforeDestroy() {
  771. this.map && this.map.destroy();
  772. clearInterval(this.dispatchACarTimer); //关闭
  773. },
  774. methods: {
  775. confirmChange() {
  776. changeVehicle({
  777. ...this.formData,
  778. id: this.formDataList.id,
  779. originalPlateNo: this.formDataList.vehicleId,
  780. originalDriverName: this.formDataList.driverName,
  781. originalTel: this.formDataList.tel
  782. }).then(res => {
  783. this.dialogChange = false
  784. this.onLoad(this.page)
  785. this.$refs.saveForm.resetForm()
  786. })
  787. },
  788. //变更信息
  789. changeFleetT(row, index) {
  790. let data = [{
  791. dictKey: "2",
  792. dictValue: "未受理"
  793. },{
  794. dictKey: "3",
  795. dictValue: "未完工"
  796. },{
  797. dictKey: "5",
  798. dictValue: "未到厂"
  799. },{
  800. dictKey: "6",
  801. dictValue: "已提箱"
  802. }]
  803. for (let item of data){
  804. if (row.status == item.dictKey){
  805. this.formData = {
  806. status:item.dictKey,
  807. $status:item.dictValue
  808. }
  809. }
  810. }
  811. this.formDataList = row
  812. this.dialogChange = true
  813. this.optionData.column[0].dicUrl = "/api/blade-client/land-vehicle/vehicle-list?fleetId="+this.formDataList.fleetId
  814. },
  815. //打开变更记录
  816. recordsOfChanges(row, index) {
  817. this.dialogRecord = true
  818. recordingDetails({itemId: row.id, kind: 3}).then(res => {
  819. this.dataRecord = res.data.data
  820. })
  821. },
  822. //自定义列保存
  823. async saveColumn() {
  824. /**
  825. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  826. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  827. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  828. */
  829. const inSave = await this.saveColumnData(this.getColumnName(87), this.entrustOptionTwoT);
  830. if (inSave) {
  831. this.$message.success("保存成功");
  832. //关闭窗口
  833. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  834. }
  835. },
  836. //自定义列重置
  837. async resetColumn() {
  838. this.entrustOptionTwoT = this.optionList;
  839. const inSave = await this.delColumnData(this.getColumnName(87), this.optionList);
  840. if (inSave) {
  841. this.$message.success("重置成功");
  842. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  843. }
  844. },
  845. // 获得高度
  846. searchCriteriaSwitch(type) {
  847. if (type) {
  848. this.entrustOptionTwoT.height = this.entrustOptionTwoT.height - 230
  849. } else {
  850. this.entrustOptionTwoT.height = this.entrustOptionTwoT.height + 230
  851. }
  852. this.$refs.crud.getTableHeight()
  853. },
  854. //箱信息保存
  855. rowSave(row, index, done, loading) {
  856. done()
  857. },
  858. //箱信息选择车队
  859. getfleetIdT(data, row) {
  860. this.$set(row, 'fleetName', data.cname)
  861. },
  862. //搜索
  863. searchChange(params, done) {
  864. let data = params
  865. if (params.arrivalTime) {
  866. data.beginArrivalTime = params.arrivalTime[0]
  867. data.endArrivalTime = params.arrivalTime[1]
  868. }
  869. if (params.createTime) {
  870. data.beginCrateTime = params.createTime[0]
  871. data.endCrateTime = params.createTime[1]
  872. }
  873. delete data.arrivalTime
  874. delete data.createTime
  875. this.query = data;
  876. this.onLoad(this.page, params)
  877. done();
  878. },
  879. //查询
  880. onLoad(page, params={}) {
  881. let queryParams = {
  882. size: page.pageSize,
  883. current: page.currentPage,
  884. status: this.activeName,
  885. tag: '3',
  886. ...params,
  887. ...Object.assign(params, this.query)
  888. }
  889. if (queryParams.arrivalTime) {
  890. queryParams.beginArrivalTime = queryParams.arrivalTime[0]
  891. queryParams.endArrivalTime = queryParams.arrivalTime[1]
  892. }
  893. delete queryParams.arrivalTime
  894. this.screen = queryParams
  895. motorcadeDriver({
  896. tag:3,
  897. ...this.screen
  898. }).then(res => {
  899. this.totalData = res.data.data
  900. })
  901. this.loading = true;
  902. driverQueryCollection(queryParams).then(res => {
  903. this.goodsList = res.data.data.records
  904. this.page.total = res.data.data.total
  905. this.entrustOptionTwoT.height = window.innerHeight - 355;
  906. }).finally(() => {
  907. this.loading = false;
  908. })
  909. },
  910. //箱信息保存
  911. rowSaveT(row, index, done, loading) {
  912. if (row.$cellEdit) {
  913. fleetDriverSave(row).then(res => {
  914. this.$message.success("保存成功");
  915. })
  916. }
  917. this.$refs.crud.rowCell(row, index)
  918. },
  919. //切换订单状态
  920. handleClick(tab) {
  921. this.activeName = tab
  922. this.onLoad(this.page)
  923. },
  924. //箱信息派车
  925. designate(row) {
  926. if (row.plateNo) {
  927. this.$confirm('是否确定派车', '提示', {
  928. confirmButtonText: '确定',
  929. cancelButtonText: '取消',
  930. type: 'warning'
  931. }).then(() => {
  932. sendACarCollection(row).then(res => {
  933. this.$message.success('操作成功');
  934. this.onLoad(this.page)
  935. })
  936. }).catch(() => {
  937. this.$message({
  938. type: 'info',
  939. message: '已取消'
  940. });
  941. });
  942. } else {
  943. this.$message.warning('未选择车号,请选择');
  944. }
  945. },
  946. //取消派车
  947. cancelDesignate(row) {
  948. this.$confirm('是否确定取消派车', '提示', {
  949. confirmButtonText: '确定',
  950. cancelButtonText: '取消',
  951. type: 'warning'
  952. }).then(() => {
  953. sendACarDispatchCollection({id: row.id}).then(res => {
  954. this.$message.success('操作成功');
  955. this.onLoad(this.page)
  956. })
  957. }).catch(() => {
  958. this.$message({
  959. type: 'info',
  960. message: '已取消'
  961. });
  962. });
  963. },
  964. //打开附件
  965. annexOpen(row, index) {
  966. this.loadingTwo = false
  967. this.dialogVisible = true
  968. this.form = row
  969. getAttachment({id: row.id}).then(res => {
  970. console.log(res)
  971. this.orderList = res.data.data
  972. })
  973. },
  974. //保存
  975. saveAnnex() {
  976. this.loadingTwo = true
  977. saveAttached({
  978. id: this.form.id,
  979. fileList: this.orderList
  980. }).then(res => {
  981. this.$message.success('保存成功');
  982. this.annexOpen(this.form)
  983. })
  984. },
  985. ToBreak(val) {
  986. if (val)return val.replace(/\n/g, '<br/>')
  987. },
  988. markerClick(e) {
  989. this.infoWindow.setContent(e.target.content);
  990. this.infoWindow.open(this.map, e.target.getPosition());
  991. },
  992. openTrack(row){
  993. location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  994. this.dialogVisibleTwo = true
  995. this.loadingDialog = true
  996. let this_ = this
  997. setTimeout(function () {
  998. this_.initMap(res.data.data, row.plateNo);
  999. this_.loadingDialog = false
  1000. }, 2000)
  1001. })
  1002. },
  1003. initMap(data, plateNo) {
  1004. this.map = new AMap.Map("container", {resizeEnable: true});
  1005. this.infoWindow = new AMap.InfoWindow({
  1006. ffset: new AMap.Pixel(0, -30),
  1007. offset: new AMap.Pixel(0, -30)
  1008. });
  1009. let icon = new AMap.Icon({
  1010. size: new AMap.Size(52, 26), // 图标尺寸
  1011. image: 'https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/che.png',
  1012. imageSize: new AMap.Size(52, 26), // 根据所设置的大小拉伸或压缩图片
  1013. });
  1014. this.marker = new AMap.Marker({
  1015. position: data.location,
  1016. map: this.map,
  1017. icon: icon,
  1018. markerMeta: new AMap.Size(28, 28),
  1019. offset: new AMap.Pixel(-26, -15),
  1020. autoRotation: true,
  1021. angle: -15
  1022. });
  1023. this.marker.content = '<div style="width: 300px;">'
  1024. + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #fff;">' + plateNo + '</p>'
  1025. + '<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>'
  1026. + '<div style="width: 150px;float: left;">'
  1027. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
  1028. + '</div>'
  1029. + '<div style="width: 150px;float: right;">'
  1030. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
  1031. + '</div>'
  1032. + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
  1033. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
  1034. + '</div>'
  1035. this.infoWindow.open(this.map, this.map.getCenter());
  1036. this.marker.on('click', this.markerClick);
  1037. this.marker.emit('click', {target: this.marker});
  1038. this.map.setFitView();
  1039. },
  1040. }
  1041. }
  1042. </script>
  1043. <style lang="scss" scoped>
  1044. #container {
  1045. height: 80vh;
  1046. width: 100%;
  1047. }
  1048. ::v-deep .el-dialog {
  1049. margin-top: 5vh !important;
  1050. margin-bottom: 0 !important;
  1051. }
  1052. ::v-deep .el-dialog__body {
  1053. padding: 0 20px 10px 20px !important;
  1054. }
  1055. ::v-deep .amap-info-content {
  1056. padding: 5px 5px 5px 5px !important;
  1057. }
  1058. ::v-deep .amap-info-close {
  1059. right: 10px !important;
  1060. top: 12px !important;
  1061. }
  1062. .selected{
  1063. color: #1e9fff !important;
  1064. }
  1065. .home-container {
  1066. padding: 0px 5px 5px 5px;
  1067. box-sizing: border-box;
  1068. height: 100%;
  1069. ::v-deep .el-card__body {
  1070. padding: 10px 15px;
  1071. font-size: 14px;
  1072. }
  1073. &__card {
  1074. width: 100%;
  1075. height: 100%;
  1076. }
  1077. .title {
  1078. display: flex;
  1079. justify-content: space-between;
  1080. .right {
  1081. display: flex;
  1082. align-items: center;
  1083. &_but {
  1084. margin-right: 10px;
  1085. border: 1px solid #409eff;
  1086. width: 80px;
  1087. border-radius: 3px;
  1088. display: flex;
  1089. &_left {
  1090. width: 40px;
  1091. text-align: center;
  1092. color: #409eff;
  1093. cursor: pointer;
  1094. }
  1095. &_right {
  1096. width: 40px;
  1097. text-align: center;
  1098. color: #409eff;
  1099. cursor: pointer;
  1100. }
  1101. &_active {
  1102. color: #fff;
  1103. background-color: #409eff;
  1104. }
  1105. }
  1106. }
  1107. }
  1108. }
  1109. .content {
  1110. display: flex;
  1111. justify-content: center;
  1112. align-items: center;
  1113. height: 6vh;
  1114. width: 80vw;
  1115. .divider {
  1116. display: block;
  1117. height: 0px;
  1118. width: 100%;
  1119. border-top: 1px dashed #dcdfe6;
  1120. }
  1121. &-item {
  1122. margin-left: 1vw;
  1123. .card {
  1124. width: 130px;
  1125. display: flex;
  1126. align-items: center;
  1127. &-title {
  1128. width: 40px;
  1129. height: 40px;
  1130. text-align: center;
  1131. border-radius: 50%;
  1132. font-size: 20px;
  1133. font-weight: 600;
  1134. display: flex;
  1135. justify-content: center;
  1136. align-items: center;
  1137. span {
  1138. line-height: 20px;
  1139. }
  1140. }
  1141. &-title1 {
  1142. color: #037fe1;
  1143. background-color: rgba(3, 127, 225, 0.15);
  1144. }
  1145. &-title2 {
  1146. color: #ffa21e;
  1147. background-color: rgba(255, 162, 30, 0.15);
  1148. }
  1149. &-title3 {
  1150. color: #fb5b60;
  1151. background-color: rgba(251, 91, 96, 0.15);
  1152. }
  1153. &-title4 {
  1154. color: #42bc6f;
  1155. background-color: rgba(66, 188, 111, 0.15);
  1156. }
  1157. &-title5 {
  1158. color: #14cde1;
  1159. background-color: rgba(52, 149, 161, 0.15);
  1160. }
  1161. &-title6 {
  1162. color: rgba(4, 66, 31, 0.63);
  1163. background-color: rgba(66, 188, 111, 0.15);
  1164. }
  1165. &-content {
  1166. padding-left: 1vw;
  1167. display: flex;
  1168. flex-direction: column;
  1169. &-num {
  1170. font-size: 20px;
  1171. font-weight: 600;
  1172. }
  1173. &-text {
  1174. color: #909399;
  1175. }
  1176. }
  1177. }
  1178. }
  1179. }
  1180. </style>