index.vue 35 KB

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