index.vue 36 KB

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