voyageDetail.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019
  1. <template>
  2. <div class="line-container-p24">
  3. <i class="el-icon-arrow-left"></i>
  4. <div
  5. class="dib go-back ml8 pointer"
  6. @click="router.replace('/voyage/voyageList')"
  7. >
  8. 返回航次列表
  9. </div>
  10. </div>
  11. <div class="container-title">航次信息</div>
  12. <div class="line-container-p24">
  13. <div class="line">
  14. <div class="info-line">
  15. <div class="info-line-title">航次名称</div>
  16. <el-input
  17. class="info-line-text"
  18. v-model="voyage.voyageName"
  19. disabled
  20. ></el-input>
  21. </div>
  22. <div class="info-line">
  23. <div class="info-line-title">货主</div>
  24. <el-input
  25. class="info-line-text"
  26. v-model="voyage.cargoOwnerName"
  27. disabled
  28. ></el-input>
  29. </div>
  30. </div>
  31. <!-- <div class="line">
  32. <div class="info-line">
  33. <div class="info-line-title">船东</div>
  34. <el-input
  35. class="info-line-text"
  36. v-model="voyage.shipOwnerName"
  37. disabled
  38. ></el-input>
  39. </div>
  40. <div class="info-line">
  41. <div class="info-line-title">船东手机号</div>
  42. <el-input
  43. class="info-line-text"
  44. v-model="voyage.shipOwnerPhone"
  45. disabled
  46. ></el-input>
  47. </div>
  48. </div> -->
  49. <div class="line">
  50. <div class="info-line">
  51. <div class="info-line-title">船舶</div>
  52. <el-input
  53. class="info-line-text"
  54. v-model="voyage.shipName"
  55. disabled
  56. ></el-input>
  57. </div>
  58. <div class="info-line">
  59. <div class="info-line-title">MMSI</div>
  60. <el-input
  61. class="info-line-text"
  62. v-model="voyage.shipMmsi"
  63. disabled
  64. ></el-input>
  65. </div>
  66. </div>
  67. <div id="map-container" class="map-container"></div>
  68. <div class="line" style="margin-top: 30px">
  69. <div class="info-line">
  70. <div class="info-line-title">开始时间</div>
  71. <el-input
  72. class="info-line-text"
  73. v-model="voyage.startTime"
  74. disabled
  75. ></el-input>
  76. </div>
  77. <div class="info-line">
  78. <div class="info-line-title">结束时间</div>
  79. <el-input
  80. class="info-line-text"
  81. v-model="voyage.endTime"
  82. disabled
  83. ></el-input>
  84. </div>
  85. </div>
  86. <div class="line">
  87. <div class="info-line">
  88. <div class="info-line-title">装货港</div>
  89. <el-input
  90. class="info-line-text"
  91. v-model="voyage.loadPort"
  92. disabled
  93. ></el-input>
  94. </div>
  95. <div class="info-line">
  96. <div class="info-line-title">卸货港</div>
  97. <el-input
  98. class="info-line-text"
  99. v-model="voyage.dischargeProt"
  100. disabled
  101. ></el-input>
  102. </div>
  103. </div>
  104. <div class="line">
  105. <div class="info-line">
  106. <div class="info-line-title">货种</div>
  107. <el-input
  108. class="info-line-text"
  109. v-model="voyage.cargo"
  110. disabled
  111. ></el-input>
  112. </div>
  113. <div class="info-line">
  114. <div class="info-line-title">吨位</div>
  115. <el-input
  116. class="info-line-text"
  117. v-model="voyage.tons"
  118. disabled
  119. ></el-input>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="container-title">航次信息</div>
  124. <div class="line-container-p24">
  125. <div class="line">
  126. <div class="info-line">
  127. <div class="info-line-title">运输状态</div>
  128. <el-select
  129. v-model="voyage.transStatus"
  130. placeholder="Select"
  131. class="info-line-text"
  132. :disabled="disabledStatus"
  133. >
  134. <el-option
  135. v-for="item in options"
  136. :key="item.value"
  137. :label="item.label"
  138. :value="item.value"
  139. ></el-option>
  140. </el-select>
  141. </div>
  142. </div>
  143. <div class="line">
  144. <div class="info-line">
  145. <div class="info-line-title">到达装货港时间</div>
  146. <el-date-picker
  147. class="info-line-text"
  148. v-model="voyage.arrivalLoadPortTime"
  149. type="datetime"
  150. format="YYYY/MM/DD HH:mm:ss"
  151. value-format="YYYY/MM/DD HH:mm:ss"
  152. placeholder="到达装货港时间"
  153. :disabled="disabledStatus"
  154. ></el-date-picker>
  155. </div>
  156. <div class="info-line">
  157. <div class="info-line-title">实装吨位</div>
  158. <el-input
  159. class="info-line-text"
  160. v-model="voyage.actualDischargeTons"
  161. :disabled="disabledStatus"
  162. placeholder="实装吨位"
  163. ></el-input>
  164. </div>
  165. </div>
  166. <div class="line">
  167. <div class="info-line">
  168. <div class="info-line-title">装货开始时间</div>
  169. <el-date-picker
  170. class="info-line-text"
  171. v-model="voyage.loadStartTime"
  172. type="datetime"
  173. format="YYYY/MM/DD HH:mm:ss"
  174. value-format="YYYY/MM/DD HH:mm:ss"
  175. placeholder="装货开始时间"
  176. :disabled="disabledStatus"
  177. ></el-date-picker>
  178. </div>
  179. <div class="info-line">
  180. <div class="info-line-title">装货结束时间</div>
  181. <el-date-picker
  182. class="info-line-text"
  183. v-model="voyage.loadEndTime"
  184. type="datetime"
  185. format="YYYY/MM/DD HH:mm:ss"
  186. value-format="YYYY/MM/DD HH:mm:ss"
  187. placeholder="装货开始时间"
  188. :disabled="disabledStatus"
  189. ></el-date-picker>
  190. </div>
  191. </div>
  192. <div class="line">
  193. <div class="info-line">
  194. <div class="info-line-title">开航时间</div>
  195. <el-date-picker
  196. class="info-line-text"
  197. v-model="voyage.setSailTime"
  198. type="datetime"
  199. format="YYYY/MM/DD HH:mm:ss"
  200. value-format="YYYY/MM/DD HH:mm:ss"
  201. placeholder="开航时间"
  202. :disabled="disabledStatus"
  203. ></el-date-picker>
  204. </div>
  205. <div class="info-line">
  206. <div class="info-line-title">预计到港时间</div>
  207. <el-date-picker
  208. class="info-line-text"
  209. v-model="voyage.expectedArrivalTime"
  210. type="datetime"
  211. format="YYYY/MM/DD HH:mm:ss"
  212. value-format="YYYY/MM/DD HH:mm:ss"
  213. placeholder="预计到港时间"
  214. :disabled="disabledStatus"
  215. ></el-date-picker>
  216. </div>
  217. </div>
  218. <div class="line">
  219. <div class="info-line">
  220. <div class="info-line-title">实际到港时间</div>
  221. <el-date-picker
  222. class="info-line-text"
  223. v-model="voyage.actualArrivalTime"
  224. type="datetime"
  225. format="YYYY/MM/DD HH:mm:ss"
  226. value-format="YYYY/MM/DD HH:mm:ss"
  227. placeholder="实际到港时间"
  228. :disabled="disabledStatus"
  229. ></el-date-picker>
  230. </div>
  231. <!-- <div class="info-line">
  232. <div class="info-line-title">抵达目的地港时间</div>
  233. <el-date-picker
  234. class="info-line-text"
  235. v-model="voyage.arrivalPortTime"
  236. type="datetime"
  237. format="YYYY/MM/DD HH:mm:ss"
  238. value-format="YYYY/MM/DD HH:mm:ss"
  239. placeholder="抵达目的地港时间"
  240. :disabled="disabledStatus"
  241. ></el-date-picker>
  242. </div> -->
  243. </div>
  244. <div class="line">
  245. <div class="info-line">
  246. <div class="info-line-title">卸货开始时间</div>
  247. <el-date-picker
  248. class="info-line-text"
  249. v-model="voyage.dischargeStartTime"
  250. type="datetime"
  251. format="YYYY/MM/DD HH:mm:ss"
  252. value-format="YYYY/MM/DD HH:mm:ss"
  253. placeholder="卸货开始时间"
  254. :disabled="disabledStatus"
  255. ></el-date-picker>
  256. </div>
  257. <div class="info-line">
  258. <div class="info-line-title">卸货结束时间</div>
  259. <el-date-picker
  260. class="info-line-text"
  261. v-model="voyage.dischargeEndTime"
  262. type="datetime"
  263. format="YYYY/MM/DD HH:mm:ss"
  264. value-format="YYYY/MM/DD HH:mm:ss"
  265. placeholder="卸货结束时间"
  266. :disabled="disabledStatus"
  267. ></el-date-picker>
  268. </div>
  269. </div>
  270. <div class="line">
  271. <div class="info-line">
  272. <div class="info-line-title">实际卸货吨位</div>
  273. <el-input
  274. class="info-line-text"
  275. placeholder="实际卸货吨位"
  276. v-model="voyage.actualDischargeTons"
  277. :disabled="disabledStatus"
  278. ></el-input>
  279. </div>
  280. </div>
  281. <div class="line">
  282. <div class="info-line">
  283. <div class="info-line-title">备注</div>
  284. <el-input
  285. class="info-line-textarea"
  286. v-model="voyage.remark"
  287. autosize
  288. type="textarea"
  289. :disabled="disabledStatus"
  290. ></el-input>
  291. </div>
  292. </div>
  293. <el-card
  294. style="
  295. width: 800px;
  296. margin-left: 60px;
  297. margin-top: 50px;
  298. margin-bottom: 40px;
  299. "
  300. >
  301. <el-table :data="dischagreList" stripe :disabled="disabledStatus">
  302. <el-table-column
  303. type="index"
  304. label="序号"
  305. min-width="80"
  306. align="center"
  307. ></el-table-column>
  308. <el-table-column
  309. prop="id"
  310. label="卸货记录ID"
  311. min-width="100"
  312. align="center"
  313. ></el-table-column>
  314. <el-table-column
  315. prop="dischargeTons"
  316. label="卸货吨位"
  317. min-width="100"
  318. align="center"
  319. ></el-table-column>
  320. <el-table-column
  321. prop="dischargeTime"
  322. label="卸货时间"
  323. min-width="120"
  324. align="center"
  325. ></el-table-column>
  326. </el-table>
  327. <el-dialog v-model="dialogVisible" title="图片预览" width="30%">
  328. <el-image
  329. :src="dialogImageUrl"
  330. style="height: 100%; width: 100%"
  331. ></el-image>
  332. </el-dialog>
  333. <div style="width: 100%; text-align: right; margin-top: 43px">
  334. <el-pagination
  335. background
  336. layout="prev, pager, next"
  337. :total="total"
  338. @current-change="pageChange"
  339. ></el-pagination>
  340. </div>
  341. </el-card>
  342. <div v-if="false" class="line" style="margin-bottom: 60px">
  343. <div class="info-line">
  344. <div class="info-line-title">上传航次运单</div>
  345. <el-upload
  346. drag
  347. multiple
  348. action="https://interface.huihenduo.com.cn/hhd-pat/voyage/uploadVoyageWayBill"
  349. list-type="picture-card"
  350. :on-preview="handlePictureCardPreview"
  351. :on-remove="handleRemoveBill"
  352. :data="billParams"
  353. :on-success="billUploadSuccess"
  354. :file-list="voyageBill"
  355. :limit="10"
  356. >
  357. <div class="upload-plus-icon">+</div>
  358. <div class="upload-text">拖拽或点击上传</div>
  359. </el-upload>
  360. </div>
  361. </div>
  362. <div>
  363. <img
  364. style="width: 200px; height: 200px"
  365. v-for="item in voyageBill"
  366. :src="item.url"
  367. :key="item"
  368. alt=""
  369. />
  370. </div>
  371. <div class="media-content df ffw">
  372. <div class="pic-container">
  373. <div v-for="(item, index) in media" :key="item" class="pic-main">
  374. <div
  375. :class="[
  376. 'box',
  377. index % 2 == 0 ? '' : 'bottom-box',
  378. item.status == 1 ? 'now-box' : '',
  379. ]"
  380. >
  381. <div class="card-note">
  382. {{ item.shipName }} 拍摄于
  383. <br />
  384. {{ item.createTime }}
  385. </div>
  386. <div class="media-box" style="position: relative">
  387. <el-image
  388. v-if="item.mediaType == 1"
  389. style="width: 100%; height: 100%"
  390. fit="contain"
  391. :src="item.downloadUrl"
  392. @click="openMediaModal(item.downloadUrl, 1, '图片审核')"
  393. ></el-image>
  394. <video
  395. style="width: 100%; height: 100%"
  396. v-else
  397. :src="item.downloadUrl"
  398. ></video>
  399. <img
  400. @click="openMediaModal(item.downloadUrl, 2, '视频审核')"
  401. v-if="item.mediaType == 2"
  402. src="../../assets/icon-player.png"
  403. style="
  404. object-fit: contain;
  405. width: 40px;
  406. height: 40px;
  407. position: absolute;
  408. top: calc(50% - 20px);
  409. left: calc(50% - 20px);
  410. background: #fff;
  411. border-radius: 50%;
  412. "
  413. alt=""
  414. />
  415. </div>
  416. </div>
  417. <div
  418. :class="[
  419. 's-line',
  420. index % 2 == 0 ? '' : 'top210px',
  421. item.status == 1 ? 'now-s-line' : '',
  422. ]"
  423. ></div>
  424. <div :class="['point', item.status == 1 ? '' : 'now-point']"></div>
  425. <div
  426. :class="['l-line', item.status == 1 ? 'now-l-line' : '']"
  427. v-if="index + 1 != media.length"
  428. ></div>
  429. </div>
  430. <el-dialog
  431. v-model="mediaModal"
  432. :title="modalTitle"
  433. width="20%"
  434. :before-close="videoClose"
  435. >
  436. <el-image
  437. v-if="modalType == 1"
  438. style="width: 100%; height: 100%"
  439. fit="contain"
  440. :src="currentUrl"
  441. :preview-src-list="modalPreview"
  442. ></el-image>
  443. <video
  444. v-else
  445. autoplay
  446. controls
  447. style="width: 100%; height: 100%"
  448. :src="currentUrl"
  449. ></video>
  450. </el-dialog>
  451. </div>
  452. </div>
  453. </div>
  454. </template>
  455. <script>
  456. import { onMounted, reactive, ref, toRefs } from "_vue@3.2.20@vue";
  457. import api from "../../apis/fetch";
  458. import { useRoute } from "vue-router";
  459. import _ from "lodash";
  460. import router from "../../router";
  461. import store from "../../store";
  462. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  463. export default {
  464. setup() {
  465. const route = useRoute();
  466. let map = ref();
  467. let voyage = ref({});
  468. let media = ref();
  469. let coordinates = ref();
  470. let previewSrcList = ref([]);
  471. async function getVoyageDetail(type) {
  472. let res = await api.getVoyageDetail({
  473. type: localStorage.userType,
  474. voyageId: route.query.id,
  475. });
  476. if (res.data.status == 0) {
  477. if (type) {
  478. ElNotification({
  479. type: "success",
  480. title: res.data.msg,
  481. });
  482. }
  483. coordinates.value = res.data.result.coordinates;
  484. voyage.value = res.data.result.voyage;
  485. media.value = res.data.result.medias;
  486. for (let i of res.data.result.waybills) {
  487. voyageBill.value.push({
  488. ...i,
  489. url: i.viewUrl,
  490. });
  491. }
  492. for (let i of media.value) {
  493. previewSrcList.value.push(i.downloadUrl);
  494. }
  495. initMap();
  496. } else {
  497. console.log(res);
  498. ElNotification({
  499. type: "error",
  500. title: res.data.msg,
  501. });
  502. }
  503. }
  504. let total = ref();
  505. function pageChange(e) {
  506. dischargeCurrentPage.value = e;
  507. getDischargeList();
  508. }
  509. async function addDischarge() {
  510. if (!formInline.value.dischargeTime || !formInline.value.dischargeTons)
  511. return;
  512. let res = await api.addDischarge({
  513. ...formInline.value,
  514. voyageId: route.query.id,
  515. });
  516. if (res.data.status == 0) {
  517. getDischargeList(1);
  518. formInline.value = {};
  519. ElNotification({
  520. type: "success",
  521. title: res.data.msg,
  522. });
  523. } else {
  524. console.log(res);
  525. ElNotification({
  526. type: "error",
  527. title: res.data.msg,
  528. });
  529. }
  530. }
  531. async function deleteDischarge(id, index) {
  532. let res = await api.deleteDischarge({
  533. id,
  534. });
  535. if (res.data.status == 0) {
  536. dischagreList.value.splice(index, 1);
  537. ElNotification({
  538. type: "success",
  539. title: res.data.msg,
  540. });
  541. } else {
  542. console.log(res);
  543. ElNotification({
  544. type: "error",
  545. title: res.data.msg,
  546. });
  547. }
  548. }
  549. async function exportExcel() {}
  550. let dischargeCurrentPage = ref(1);
  551. let dischagreList = ref();
  552. let formInline = ref({});
  553. async function getDischargeList(type) {
  554. let res = await api.getDischargeList({
  555. voyageId: route.query.id,
  556. currentPage: dischargeCurrentPage.value,
  557. size: 10,
  558. });
  559. if (res.data.status == 0) {
  560. dischagreList.value = res.data.result;
  561. total.value = res.data.total;
  562. } else {
  563. ElNotification({
  564. type: "error",
  565. title: res.data.msg,
  566. });
  567. }
  568. }
  569. let updateForm = ref({});
  570. let updateDischargeDialog = ref(false);
  571. let currentUpdateIndex = ref(-1);
  572. async function updateDischarge() {
  573. let res = await api.updateDischarge({
  574. ...updateForm.value,
  575. });
  576. if (res.data.status == 0) {
  577. dischagreList.value[currentUpdateIndex.value] = res.data.result;
  578. cancelUpdateDischarge();
  579. ElNotification({
  580. type: "success",
  581. title: res.data.msg,
  582. });
  583. } else {
  584. console.log(res);
  585. ElNotification({
  586. type: "error",
  587. title: res.data.msg,
  588. });
  589. }
  590. }
  591. function showUpdateDischarge(item, index) {
  592. updateDischargeDialog.value = true;
  593. updateForm.value = {
  594. ...item,
  595. };
  596. delete updateForm.value.createTime;
  597. delete updateForm.value.voyageId;
  598. currentUpdateIndex.value = index;
  599. }
  600. function cancelUpdateDischarge() {
  601. updateDischargeDialog.value = false;
  602. updateForm.value = {};
  603. currentUpdateIndex.value = -1;
  604. }
  605. function initMap() {
  606. map.value = new AMap.Map("map-container", {
  607. zoom: 11, //级别
  608. center: [121.524761, 31.228721], //中心点坐标
  609. mapStyle: "amap://styles/f48d96805f5fa7f5aada657c5ee37017",
  610. });
  611. if (coordinates.value.length) {
  612. let { longitude, latitude } =
  613. coordinates.value[coordinates.value.length - 1];
  614. setShipMarker(longitude, latitude);
  615. }
  616. }
  617. function setShipMarker(longitude = 121.524761, latitude = 31.228721) {
  618. map.value.setCenter([longitude, latitude]);
  619. var marker = new AMap.Marker({
  620. position: new AMap.LngLat(longitude, latitude),
  621. // offset: new AMap.Pixel(-10, -10),
  622. size: new AMap.Size(80, 80),
  623. icon: "https://hhd-pat-1255802371.cos.ap-shanghai.myqcloud.com/frontend/ship-red-icon.png", // 添加 Icon 图标 URL
  624. title: "北京",
  625. });
  626. map.value.add(marker);
  627. }
  628. let disabledStatus = ref(true);
  629. let updateCache = {};
  630. function changeVoyageInfo() {
  631. updateCache = _.cloneDeep(voyage.value);
  632. disabledStatus.value = false;
  633. }
  634. function cancelVoyageChange() {
  635. voyage.value = updateCache;
  636. disabledStatus.value = true;
  637. }
  638. async function submitVoyageChange() {
  639. let {
  640. id,
  641. transStatus,
  642. loadStartTime,
  643. loadEndTime,
  644. dischargeStartTime,
  645. dischargeEndTime,
  646. actualDischargeTons,
  647. remark,
  648. } = voyage.value;
  649. let res = await api.updateVoyage({
  650. id,
  651. transStatus,
  652. loadStartTime,
  653. loadEndTime,
  654. dischargeStartTime,
  655. dischargeEndTime,
  656. actualDischargeTons,
  657. remark,
  658. });
  659. if (res.data.status == 0) {
  660. ElNotification({
  661. type: "success",
  662. title: res.data.msg,
  663. });
  664. disabledStatus.value = true;
  665. } else {
  666. ElNotification({
  667. type: "error",
  668. title: res.data.msg,
  669. });
  670. console.log(res);
  671. }
  672. }
  673. let options = ref([
  674. { value: 0, label: "请选择" },
  675. {
  676. value: 1,
  677. label: "航行",
  678. },
  679. {
  680. value: 2,
  681. label: "停泊",
  682. },
  683. {
  684. value: 3,
  685. label: "装货",
  686. },
  687. {
  688. value: 4,
  689. label: "运输中",
  690. },
  691. {
  692. value: 5,
  693. label: "卸货",
  694. },
  695. ]);
  696. async function finishVoyage() {
  697. if (!voyage.value.dischargeEndTime) return;
  698. let res = await api.finishVoyage({
  699. voyageId: route.query.id,
  700. });
  701. if (res.data.status == 0) {
  702. voyage.value.voyageStatus = 2;
  703. ElNotification({
  704. type: "success",
  705. title: res.data.msg,
  706. });
  707. } else {
  708. ElNotification({
  709. type: "error",
  710. title: res.data.msg,
  711. });
  712. console.log(res);
  713. }
  714. }
  715. let currentUrl = ref("");
  716. let mediaModal = ref(false);
  717. let modalType = ref(1);
  718. let modalTitle = ref();
  719. let modalPreview = ref([]);
  720. function openMediaModal(url, type, title) {
  721. modalPreview.value = [url];
  722. modalTitle.value = title;
  723. modalType.value = type;
  724. currentUrl.value = url;
  725. mediaModal.value = true;
  726. }
  727. async function auditMedia(mediaId, a, index, mediaType) {
  728. console.log(mediaId, a, index, mediaType);
  729. let res = await api.auditMedia({
  730. mediaId,
  731. audit: a,
  732. });
  733. if (res.data.status == 0) {
  734. media.value[index].audit = a;
  735. ElNotification({
  736. type: "success",
  737. title: res.data.msg,
  738. });
  739. } else {
  740. console.log(res);
  741. ElNotification({
  742. type: "error",
  743. title: res.data.msg,
  744. });
  745. }
  746. }
  747. let dialogImageUrl = ref();
  748. let dialogVisible = ref();
  749. function handlePictureCardPreview(file) {
  750. dialogVisible.value = true;
  751. dialogImageUrl.value = file.url;
  752. }
  753. async function handleRemoveBill(file, list) {
  754. let cache = _.cloneDeep(voyageBill.value);
  755. console.log(cache);
  756. ElMessageBox.confirm("确认删除运单?", "Warning", {
  757. confirmButtonText: "删除",
  758. cancelButtonText: "取消",
  759. type: "warning",
  760. })
  761. .then(async () => {
  762. let { id } = file;
  763. let res = await api.deleteWaybill({
  764. id,
  765. });
  766. if (res.data.status == 0) {
  767. ElMessage({
  768. message: "删除成功!",
  769. type: "success",
  770. });
  771. voyageBill.value = list;
  772. }
  773. })
  774. .catch(() => {
  775. voyageBill.value = cache;
  776. ElMessage({
  777. type: "info",
  778. message: "取消删除",
  779. });
  780. });
  781. }
  782. let voyageBill = ref([]);
  783. function billUploadSuccess(response, file, list) {
  784. list[list.length - 1] = {
  785. ...response.result,
  786. url: response.result.viewUrl,
  787. };
  788. console.log(list);
  789. voyageBill.value = list;
  790. }
  791. let billParams = ref({
  792. voyageId: route.query.id,
  793. });
  794. onMounted(() => {
  795. getVoyageDetail(1);
  796. getDischargeList(1);
  797. });
  798. return {
  799. options,
  800. voyage,
  801. coordinates,
  802. media,
  803. disabledStatus,
  804. changeVoyageInfo,
  805. cancelVoyageChange,
  806. submitVoyageChange,
  807. finishVoyage,
  808. openMediaModal,
  809. previewSrcList,
  810. router,
  811. auditMedia,
  812. modalType,
  813. modalTitle,
  814. currentUrl,
  815. mediaModal,
  816. modalPreview,
  817. addDischarge,
  818. deleteDischarge,
  819. exportExcel,
  820. dischargeCurrentPage,
  821. dischagreList,
  822. getDischargeList,
  823. updateDischarge,
  824. total,
  825. pageChange,
  826. formInline,
  827. updateDischargeDialog,
  828. showUpdateDischarge,
  829. cancelUpdateDischarge,
  830. updateForm,
  831. dialogImageUrl,
  832. dialogVisible,
  833. handlePictureCardPreview,
  834. handleRemoveBill,
  835. voyageBill,
  836. billUploadSuccess,
  837. billParams,
  838. };
  839. },
  840. };
  841. </script>
  842. <style scoped>
  843. .map-container {
  844. width: 100%;
  845. height: 500px;
  846. }
  847. .card-note {
  848. height: 30px;
  849. font-size: 12px;
  850. font-family: PingFangSC-Regular, PingFang SC;
  851. font-weight: 400;
  852. color: #777777;
  853. }
  854. .media-box {
  855. width: 200px;
  856. height: 200px;
  857. margin-top: 20px;
  858. }
  859. .checkbox-group {
  860. width: 200px;
  861. height: 50px;
  862. margin-top: 20px;
  863. }
  864. .media-content {
  865. width: 100%;
  866. height: 600px;
  867. background: #f7f7f7;
  868. border-radius: 2px;
  869. }
  870. .pic-container {
  871. width: 100%;
  872. height: 100%;
  873. box-sizing: border-box;
  874. display: flex;
  875. padding: 30px;
  876. overflow-x: scroll;
  877. overflow-y: hidden;
  878. white-space: nowrap;
  879. }
  880. .pic-main {
  881. position: relative;
  882. width: 120px;
  883. }
  884. .box {
  885. position: absolute;
  886. height: 240px;
  887. width: var(--box-width);
  888. border: 5px solid #dddddd;
  889. transition: all 0.5s;
  890. background: #fff;
  891. z-index: 10;
  892. }
  893. .point {
  894. position: relative;
  895. left: 93px;
  896. top: 258px;
  897. width: 16px;
  898. height: 16px;
  899. background-image: url(../../assets/blue-circle.png);
  900. }
  901. .s-line {
  902. position: absolute;
  903. left: 100px;
  904. top: 242px;
  905. height: 20px;
  906. border-left: 2px dashed;
  907. box-sizing: border-box;
  908. border-color: #ddd;
  909. }
  910. .l-line {
  911. position: relative;
  912. bottom: 30px;
  913. left: 111px;
  914. top: 249px;
  915. height: 3px;
  916. width: 100px;
  917. background-color: #dddddd;
  918. }
  919. .bottom-box {
  920. top: 290px;
  921. }
  922. .top210px {
  923. top: 270px;
  924. }
  925. .box:hover {
  926. transform: scale(1.2);
  927. }
  928. .media-box {
  929. width: 80px;
  930. height: 80px;
  931. margin-top: 10px;
  932. }
  933. .card-note {
  934. height: 30px;
  935. font-size: 12px;
  936. font-family: PingFangSC-Regular, PingFang SC;
  937. font-weight: 400;
  938. color: #777777;
  939. padding: 10px 20px;
  940. }
  941. .media-box {
  942. width: 100%;
  943. height: 100px;
  944. margin-top: 20px;
  945. }
  946. .checkbox-group {
  947. width: 180px;
  948. height: 50px;
  949. margin-top: 20px;
  950. }
  951. .el-checkbox {
  952. margin: 0;
  953. }
  954. .now-box {
  955. border: 5px solid #0094fe;
  956. }
  957. .now-l-line {
  958. background-color: #0094fe;
  959. }
  960. .now-s-line {
  961. border-color: #97caf6;
  962. }
  963. .now-point {
  964. filter: grayscale(1);
  965. }
  966. .info-line-text-table {
  967. width: 180px !important;
  968. }
  969. .upload-plus-icon {
  970. height: 15%;
  971. color: rgb(139, 147, 156);
  972. line-height: 100px;
  973. font-size: 40px;
  974. font-weight: 200;
  975. }
  976. .upload-text {
  977. height: 25%;
  978. color: rgb(139, 147, 156);
  979. }
  980. </style>