index.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  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]
  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: 16,
  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.query = {
  732. arrivalTime: [defaultDate(4)[0] + ' 00:00:00',defaultDate(4)[1] + ' 23:59:59']
  733. }
  734. this.key++
  735. this.findObject(this.entrustOptionTwoT.column, "plateNo").change = (data) => {
  736. fleetListTwo({plateNo:data.value}).then(res => {
  737. this.goodsList[data.index].driverId = res.data.data[0].driverId
  738. this.goodsList[data.index].driverName = res.data.data[0].driverName
  739. this.goodsList[data.index].tel = res.data.data[0].tel
  740. })
  741. }
  742. this.findObject(this.entrustOptionTwoT.column, "driverId").change = (data) => {
  743. telephone().then(res => {
  744. for (let item in res.data.data) {
  745. if (data.value === res.data.data[item].id) {
  746. this.goodsList[data.index].tel = res.data.data[item].tel
  747. }
  748. }
  749. })
  750. }
  751. let i = 0;
  752. this.entrustOptionTwoT.column.forEach(item => {
  753. if (item.search) i++
  754. })
  755. if (i % 3 !== 0) {
  756. const num = 3 - Number(i % 3)
  757. this.entrustOptionTwoT.searchMenuSpan = num * 8;
  758. this.entrustOptionTwoT.searchMenuPosition = "right";
  759. }
  760. businessStatisticsFrequency().then(res=>{
  761. let this_ = this
  762. this_.dispatchACarTimer = setInterval(function(){
  763. motorcadeDriver({
  764. tag:3,
  765. ...this_.screen
  766. }).then(res=>{
  767. this_.totalData = res.data.data
  768. })
  769. }, Number(res.data.data[0].dictKey)*1000)
  770. })
  771. },
  772. beforeDestroy() {
  773. this.map && this.map.destroy();
  774. clearInterval(this.dispatchACarTimer); //关闭
  775. },
  776. methods: {
  777. confirmChange() {
  778. changeVehicle({
  779. ...this.formData,
  780. id: this.formDataList.id,
  781. originalPlateNo: this.formDataList.vehicleId,
  782. originalDriverName: this.formDataList.driverName,
  783. originalTel: this.formDataList.tel
  784. }).then(res => {
  785. this.dialogChange = false
  786. this.onLoad(this.page)
  787. this.$refs.saveForm.resetForm()
  788. })
  789. },
  790. //变更信息
  791. changeFleetT(row, index) {
  792. let data = [{
  793. dictKey: "2",
  794. dictValue: "未受理"
  795. },{
  796. dictKey: "3",
  797. dictValue: "未完工"
  798. },{
  799. dictKey: "5",
  800. dictValue: "未到厂"
  801. },{
  802. dictKey: "6",
  803. dictValue: "已提箱"
  804. }]
  805. for (let item of data){
  806. if (row.status == item.dictKey){
  807. this.formData = {
  808. status:item.dictKey,
  809. $status:item.dictValue
  810. }
  811. }
  812. }
  813. this.formDataList = row
  814. this.dialogChange = true
  815. this.optionData.column[0].dicUrl = "/api/blade-client/land-vehicle/vehicle-list?fleetId="+this.formDataList.fleetId
  816. },
  817. //打开变更记录
  818. recordsOfChanges(row, index) {
  819. this.dialogRecord = true
  820. recordingDetails({itemId: row.id, kind: 3}).then(res => {
  821. this.dataRecord = res.data.data
  822. })
  823. },
  824. //自定义列保存
  825. async saveColumn() {
  826. /**
  827. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  828. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  829. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  830. */
  831. const inSave = await this.saveColumnData(this.getColumnName(87), this.entrustOptionTwoT);
  832. if (inSave) {
  833. this.$message.success("保存成功");
  834. //关闭窗口
  835. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  836. }
  837. },
  838. //自定义列重置
  839. async resetColumn() {
  840. this.entrustOptionTwoT = this.optionList;
  841. const inSave = await this.delColumnData(this.getColumnName(87), this.optionList);
  842. if (inSave) {
  843. this.$message.success("重置成功");
  844. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  845. }
  846. },
  847. // 获得高度
  848. searchCriteriaSwitch(type) {
  849. if (type) {
  850. this.entrustOptionTwoT.height = this.entrustOptionTwoT.height - 230
  851. } else {
  852. this.entrustOptionTwoT.height = this.entrustOptionTwoT.height + 230
  853. }
  854. this.$refs.crud.getTableHeight()
  855. },
  856. //箱信息保存
  857. rowSave(row, index, done, loading) {
  858. done()
  859. },
  860. //箱信息选择车队
  861. getfleetIdT(data, row) {
  862. this.$set(row, 'fleetName', data.cname)
  863. },
  864. //搜索
  865. searchChange(params, done) {
  866. let data = params
  867. if (params.arrivalTime) {
  868. data.beginArrivalTime = params.arrivalTime[0]
  869. data.endArrivalTime = params.arrivalTime[1]
  870. }
  871. if (params.createTime) {
  872. data.beginCrateTime = params.createTime[0]
  873. data.endCrateTime = params.createTime[1]
  874. }
  875. delete data.arrivalTime
  876. delete data.createTime
  877. this.query = data;
  878. this.onLoad(this.page, params)
  879. done();
  880. },
  881. //查询
  882. onLoad(page, params={}) {
  883. let queryParams = {
  884. size: page.pageSize,
  885. current: page.currentPage,
  886. status: this.activeName,
  887. tag: '3',
  888. ...params,
  889. ...Object.assign(params, this.query)
  890. }
  891. if (queryParams.arrivalTime) {
  892. queryParams.beginArrivalTime = queryParams.arrivalTime[0]
  893. queryParams.endArrivalTime = queryParams.arrivalTime[1]
  894. }
  895. delete queryParams.arrivalTime
  896. this.screen = queryParams
  897. motorcadeDriver({
  898. tag:3,
  899. ...this.screen
  900. }).then(res => {
  901. this.totalData = res.data.data
  902. })
  903. this.loading = true;
  904. driverQueryCollection(queryParams).then(res => {
  905. this.goodsList = res.data.data.records
  906. this.page.total = res.data.data.total
  907. this.entrustOptionTwoT.height = window.innerHeight - 355;
  908. }).finally(() => {
  909. this.loading = false;
  910. })
  911. },
  912. //箱信息保存
  913. rowSaveT(row, index, done, loading) {
  914. if (row.$cellEdit) {
  915. fleetDriverSave(row).then(res => {
  916. this.$message.success("保存成功");
  917. })
  918. }
  919. this.$refs.crud.rowCell(row, index)
  920. },
  921. //切换订单状态
  922. handleClick(tab) {
  923. this.activeName = tab
  924. this.onLoad(this.page)
  925. },
  926. //箱信息派车
  927. designate(row) {
  928. if (row.plateNo) {
  929. this.$confirm('是否确定派车', '提示', {
  930. confirmButtonText: '确定',
  931. cancelButtonText: '取消',
  932. type: 'warning'
  933. }).then(() => {
  934. sendACarCollection(row).then(res => {
  935. this.$message.success('操作成功');
  936. this.onLoad(this.page)
  937. })
  938. }).catch(() => {
  939. this.$message({
  940. type: 'info',
  941. message: '已取消'
  942. });
  943. });
  944. } else {
  945. this.$message.warning('未选择车号,请选择');
  946. }
  947. },
  948. //取消派车
  949. cancelDesignate(row) {
  950. this.$confirm('是否确定取消派车', '提示', {
  951. confirmButtonText: '确定',
  952. cancelButtonText: '取消',
  953. type: 'warning'
  954. }).then(() => {
  955. sendACarDispatchCollection({id: row.id}).then(res => {
  956. this.$message.success('操作成功');
  957. this.onLoad(this.page)
  958. })
  959. }).catch(() => {
  960. this.$message({
  961. type: 'info',
  962. message: '已取消'
  963. });
  964. });
  965. },
  966. //打开附件
  967. annexOpen(row, index) {
  968. this.loadingTwo = false
  969. this.dialogVisible = true
  970. this.form = row
  971. getAttachment({id: row.id}).then(res => {
  972. console.log(res)
  973. this.orderList = res.data.data
  974. })
  975. },
  976. //保存
  977. saveAnnex() {
  978. this.loadingTwo = true
  979. saveAttached({
  980. id: this.form.id,
  981. fileList: this.orderList
  982. }).then(res => {
  983. this.$message.success('保存成功');
  984. this.annexOpen(this.form)
  985. })
  986. },
  987. ToBreak(val) {
  988. if (val)return val.replace(/\n/g, '<br/>')
  989. },
  990. markerClick(e) {
  991. this.infoWindow.setContent(e.target.content);
  992. this.infoWindow.open(this.map, e.target.getPosition());
  993. },
  994. openTrack(row){
  995. location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  996. this.dialogVisibleTwo = true
  997. this.loadingDialog = true
  998. let this_ = this
  999. setTimeout(function () {
  1000. this_.initMap(res.data.data, row.plateNo);
  1001. this_.loadingDialog = false
  1002. }, 2000)
  1003. })
  1004. },
  1005. initMap(data, plateNo) {
  1006. this.map = new AMap.Map("container", {resizeEnable: true});
  1007. this.infoWindow = new AMap.InfoWindow({
  1008. ffset: new AMap.Pixel(0, -30),
  1009. offset: new AMap.Pixel(0, -30)
  1010. });
  1011. let icon = new AMap.Icon({
  1012. size: new AMap.Size(52, 26), // 图标尺寸
  1013. image: 'https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/che.png',
  1014. imageSize: new AMap.Size(52, 26), // 根据所设置的大小拉伸或压缩图片
  1015. });
  1016. this.marker = new AMap.Marker({
  1017. position: data.location,
  1018. map: this.map,
  1019. icon: icon,
  1020. markerMeta: new AMap.Size(28, 28),
  1021. offset: new AMap.Pixel(-26, -15),
  1022. autoRotation: true,
  1023. angle: -15
  1024. });
  1025. this.marker.content = '<div style="width: 300px;">'
  1026. + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #fff;">' + plateNo + '</p>'
  1027. + '<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>'
  1028. + '<div style="width: 150px;float: left;">'
  1029. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
  1030. + '</div>'
  1031. + '<div style="width: 150px;float: right;">'
  1032. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
  1033. + '</div>'
  1034. + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
  1035. + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
  1036. + '</div>'
  1037. this.infoWindow.open(this.map, this.map.getCenter());
  1038. this.marker.on('click', this.markerClick);
  1039. this.marker.emit('click', {target: this.marker});
  1040. this.map.setFitView();
  1041. },
  1042. }
  1043. }
  1044. </script>
  1045. <style lang="scss" scoped>
  1046. #container {
  1047. height: 80vh;
  1048. width: 100%;
  1049. }
  1050. ::v-deep .el-dialog {
  1051. margin-top: 5vh !important;
  1052. margin-bottom: 0 !important;
  1053. }
  1054. ::v-deep .el-dialog__body {
  1055. padding: 0 20px 10px 20px !important;
  1056. }
  1057. ::v-deep .amap-info-content {
  1058. padding: 5px 5px 5px 5px !important;
  1059. }
  1060. ::v-deep .amap-info-close {
  1061. right: 10px !important;
  1062. top: 12px !important;
  1063. }
  1064. .selected{
  1065. color: #1e9fff !important;
  1066. }
  1067. .home-container {
  1068. padding: 0px 5px 5px 5px;
  1069. box-sizing: border-box;
  1070. height: 100%;
  1071. ::v-deep .el-card__body {
  1072. padding: 10px 15px;
  1073. font-size: 14px;
  1074. }
  1075. &__card {
  1076. width: 100%;
  1077. height: 100%;
  1078. }
  1079. .title {
  1080. display: flex;
  1081. justify-content: space-between;
  1082. .right {
  1083. display: flex;
  1084. align-items: center;
  1085. &_but {
  1086. margin-right: 10px;
  1087. border: 1px solid #409eff;
  1088. width: 80px;
  1089. border-radius: 3px;
  1090. display: flex;
  1091. &_left {
  1092. width: 40px;
  1093. text-align: center;
  1094. color: #409eff;
  1095. cursor: pointer;
  1096. }
  1097. &_right {
  1098. width: 40px;
  1099. text-align: center;
  1100. color: #409eff;
  1101. cursor: pointer;
  1102. }
  1103. &_active {
  1104. color: #fff;
  1105. background-color: #409eff;
  1106. }
  1107. }
  1108. }
  1109. }
  1110. }
  1111. .content {
  1112. display: flex;
  1113. justify-content: center;
  1114. align-items: center;
  1115. height: 6vh;
  1116. width: 80vw;
  1117. .divider {
  1118. display: block;
  1119. height: 0px;
  1120. width: 100%;
  1121. border-top: 1px dashed #dcdfe6;
  1122. }
  1123. &-item {
  1124. margin-left: 1vw;
  1125. .card {
  1126. width: 130px;
  1127. display: flex;
  1128. align-items: center;
  1129. &-title {
  1130. width: 40px;
  1131. height: 40px;
  1132. text-align: center;
  1133. border-radius: 50%;
  1134. font-size: 20px;
  1135. font-weight: 600;
  1136. display: flex;
  1137. justify-content: center;
  1138. align-items: center;
  1139. span {
  1140. line-height: 20px;
  1141. }
  1142. }
  1143. &-title1 {
  1144. color: #037fe1;
  1145. background-color: rgba(3, 127, 225, 0.15);
  1146. }
  1147. &-title2 {
  1148. color: #ffa21e;
  1149. background-color: rgba(255, 162, 30, 0.15);
  1150. }
  1151. &-title3 {
  1152. color: #fb5b60;
  1153. background-color: rgba(251, 91, 96, 0.15);
  1154. }
  1155. &-title4 {
  1156. color: #42bc6f;
  1157. background-color: rgba(66, 188, 111, 0.15);
  1158. }
  1159. &-title5 {
  1160. color: #14cde1;
  1161. background-color: rgba(52, 149, 161, 0.15);
  1162. }
  1163. &-title6 {
  1164. color: rgba(4, 66, 31, 0.63);
  1165. background-color: rgba(66, 188, 111, 0.15);
  1166. }
  1167. &-content {
  1168. padding-left: 1vw;
  1169. display: flex;
  1170. flex-direction: column;
  1171. &-num {
  1172. font-size: 20px;
  1173. font-weight: 600;
  1174. }
  1175. &-text {
  1176. color: #909399;
  1177. }
  1178. }
  1179. }
  1180. }
  1181. }
  1182. </style>