voyageList.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. <template>
  2. <div class="line-container-p24">
  3. <div class="df jcsb aic">
  4. <div class="df aic">
  5. <div
  6. @click="changeVoyageType(0)"
  7. :class="
  8. status == 0
  9. ? 'currentbtn radio-btns left-radius'
  10. : 'radio-btns left-radius'
  11. "
  12. >
  13. 全部航次
  14. </div>
  15. <div
  16. style="border-left: none"
  17. @click="changeVoyageType(1)"
  18. :class="status == 1 ? 'currentbtn radio-btns' : 'radio-btns'"
  19. >
  20. 装货中
  21. </div>
  22. <div
  23. style="border-left: none"
  24. @click="changeVoyageType(2)"
  25. :class="status == 2 ? 'currentbtn radio-btns' : 'radio-btns'"
  26. >
  27. 运输中
  28. </div>
  29. <div
  30. style="border-left: none"
  31. @click="changeVoyageType(3)"
  32. :class="status == 3 ? 'currentbtn radio-btns' : 'radio-btns'"
  33. >
  34. 卸货中
  35. </div>
  36. <div
  37. @click="changeVoyageType(4)"
  38. :class="
  39. status == 4
  40. ? 'currentbtn radio-btns right-radius'
  41. : 'radio-btns right-radius '
  42. "
  43. style="margin-right: 40px; border-left: none"
  44. >
  45. 历史航次
  46. </div>
  47. <!-- <div style="color: #333; margin-right: 10px; font-size: 14px">
  48. 预计到港时间:
  49. </div>
  50. <el-radio-group v-model="sortradio">
  51. <el-radio :label="-1">默认排序</el-radio>
  52. <el-radio :label="0">降序</el-radio>
  53. <el-radio :label="1">升序</el-radio>
  54. </el-radio-group> -->
  55. <el-input
  56. placeholder="请输入货主名称/船名/MMSI"
  57. prefix-icon="el-icon-search"
  58. v-model="term"
  59. clearable
  60. style="width: 330px"
  61. ></el-input>
  62. <div class="search-btn" @click="getVoyageList(1)">查询</div>
  63. </div>
  64. <div class="df aic">
  65. <el-button
  66. @click="FYDIModalVisable = true"
  67. class="mr20"
  68. size="medium"
  69. type="primary"
  70. >上传FYDI指数</el-button
  71. >
  72. <el-dialog
  73. title="上传FYDI指数"
  74. v-model="FYDIModalVisable"
  75. @close="FYDIModalClose"
  76. >
  77. <template v-slot:default>
  78. <div class="df aic jcsa">
  79. <RemoteSelect
  80. api="getCargoOwnerSelect"
  81. v-model="cargoOwnerCompanyStr"
  82. placeholder="公司名称/联系人/手机号"
  83. @selectItem="selectCargoOwnerUpload($event)"
  84. class="mb10"
  85. ></RemoteSelect>
  86. <el-upload
  87. v-if="FYDIParams.cargoOwnerId"
  88. class="upload-demo"
  89. :action="this.$store.state.fydi"
  90. :show-file-list="false"
  91. :data="FYDIParams"
  92. :on-success="upFYDISuccess"
  93. :before-upload="beforeFYDI"
  94. >
  95. <el-button
  96. class="mr20"
  97. size="medium"
  98. type="primary"
  99. :loading="isUpLoading"
  100. >上传FYDI指数</el-button
  101. >
  102. </el-upload>
  103. </div>
  104. </template>
  105. </el-dialog>
  106. <el-button
  107. class="mr20"
  108. size="medium"
  109. type="primary"
  110. @click="voyageAddDialogVisible = true"
  111. >添加航次</el-button
  112. >
  113. </div>
  114. </div>
  115. <el-dialog
  116. v-model="voyageAddDialogVisible"
  117. @closed="resetAddVoyageForm"
  118. title="添加航次"
  119. >
  120. <el-form
  121. :rules="rules"
  122. label-position="right"
  123. label-width="100px"
  124. ref="voyageFormRef"
  125. :model="voyageForm"
  126. >
  127. <div class="df ffw">
  128. <!-- <el-form-item prop="voyageName" label="航次名称">
  129. <el-input v-model="voyageForm.voyageName"></el-input>
  130. </el-form-item>
  131. <el-form-item label=""></el-form-item> -->
  132. <el-form-item prop="shipName" label="船舶">
  133. <!-- <el-input v-model="voyageForm.shipOwnerId"></el-input> -->
  134. <el-autocomplete
  135. v-model="voyageForm.shipName"
  136. :fetch-suggestions="searchShip"
  137. placeholder="选择船舶"
  138. @blur="clear('shipId')"
  139. @select="selectShip"
  140. />
  141. </el-form-item>
  142. <el-form-item prop="cargoOwnerName" label="货主">
  143. <el-autocomplete
  144. v-model="voyageForm.cargoOwnerName"
  145. :fetch-suggestions="searchCargoOwner"
  146. @blur="clear('cargoOwnerId')"
  147. placeholder="选择货主"
  148. @select="selectCargoOwner"
  149. />
  150. </el-form-item>
  151. <el-form-item prop="startTime" label="开始时间">
  152. <el-date-picker
  153. v-model="voyageForm.startTime"
  154. type="date"
  155. value-format="YYYY/MM/DD"
  156. placeholder="航次开始时间"
  157. ></el-date-picker>
  158. </el-form-item>
  159. <el-form-item prop="endTime" label="结束时间">
  160. <el-date-picker
  161. v-model="voyageForm.endTime"
  162. type="date"
  163. value-format="YYYY/MM/DD"
  164. placeholder="航次结束时间"
  165. disabled
  166. ></el-date-picker>
  167. </el-form-item>
  168. <el-form-item prop="loadPort" label="装货港">
  169. <el-autocomplete
  170. v-model="voyageForm.loadPort"
  171. :fetch-suggestions="getCol"
  172. @blur="clear('loadPort')"
  173. placeholder="选择装货港"
  174. @select="selectLoadPort"
  175. />
  176. </el-form-item>
  177. <el-form-item></el-form-item>
  178. <el-form-item
  179. v-for="(item, index) in discPorts"
  180. prop="dischargeProt"
  181. :label="'第 ' + (index + 1) + ' 卸货港'"
  182. >
  183. <el-autocomplete
  184. v-model="item.loadPort"
  185. :fetch-suggestions="getCol"
  186. @blur="clear('dischargeProt')"
  187. placeholder="选择卸货港"
  188. @select="selectDischargeProt($event, index)"
  189. />
  190. </el-form-item>
  191. <el-form-item>
  192. <el-button type="primary" size="small" @click="addDiscPort"
  193. >添加卸货港</el-button
  194. ></el-form-item
  195. >
  196. <el-form-item v-if="discPorts.length % 2 == 0"></el-form-item>
  197. <el-form-item prop="cargo" label="货种">
  198. <el-input
  199. style="width: 220px"
  200. v-model="voyageForm.cargo"
  201. ></el-input>
  202. </el-form-item>
  203. <el-form-item prop="tons" label="吨位">
  204. <el-input style="width: 220px" v-model="voyageForm.tons"></el-input>
  205. </el-form-item>
  206. <el-form-item prop="pieces" label="件数">
  207. <el-input
  208. style="width: 220px"
  209. v-model="voyageForm.pieces"
  210. ></el-input>
  211. </el-form-item>
  212. </div>
  213. </el-form>
  214. <template #footer>
  215. <span class="dialog-footer">
  216. <el-button @click="resetAddVoyageForm">取消</el-button>
  217. <el-button type="primary" @click="addVoyage">确定</el-button>
  218. </span>
  219. </template>
  220. </el-dialog>
  221. <el-table
  222. :data="tableData"
  223. stripe
  224. style="width: 100%; margin-top: 24px"
  225. :row-style="rowStyle"
  226. >
  227. <!-- <el-table-column
  228. type="index"
  229. label="序号"
  230. min-width="80"
  231. align="center"
  232. ></el-table-column> -->
  233. <el-table-column
  234. prop="voyageName"
  235. label="航次名称"
  236. min-width="140"
  237. align="center"
  238. ></el-table-column>
  239. <el-table-column
  240. prop="loadPort"
  241. label="装货港"
  242. min-width="90"
  243. align="center"
  244. ></el-table-column>
  245. <el-table-column
  246. prop="dischargePort"
  247. label="卸货港"
  248. min-width="80"
  249. align="center"
  250. ></el-table-column>
  251. <!-- <el-table-column
  252. prop="setSailTime"
  253. label="开航时间"
  254. min-width="100"
  255. align="center"
  256. ></el-table-column> -->
  257. <el-table-column
  258. prop="expectedArrivalTime"
  259. label="预计到港时间"
  260. sortable
  261. min-width="140"
  262. align="center"
  263. >
  264. <template v-slot="scope">
  265. {{ scope.row.arrived ? "已到港" : scope.row.expectedArrivalTime }}
  266. </template>
  267. </el-table-column>
  268. <el-table-column
  269. prop="abnormalStatus"
  270. label="航次状态"
  271. min-width="80"
  272. align="center"
  273. >
  274. <template v-slot="scope">
  275. {{ scope.row.abnormalStatus == 0 ? "正常" : "异常" }}
  276. </template>
  277. </el-table-column>
  278. <el-table-column
  279. prop="daysInPortStr"
  280. label="在港天数"
  281. sortable
  282. min-width="100"
  283. align="center"
  284. ></el-table-column>
  285. <el-table-column
  286. prop="todayPhotoCount"
  287. label="今日照片"
  288. min-width="70"
  289. align="center"
  290. ></el-table-column>
  291. <el-table-column
  292. prop="cargo"
  293. label="货种"
  294. min-width="70"
  295. align="center"
  296. ></el-table-column>
  297. <el-table-column
  298. prop="actualLoadTons"
  299. label="装载吨位"
  300. min-width="80"
  301. align="center"
  302. ></el-table-column>
  303. <el-table-column
  304. prop="unloadedtons"
  305. label="已卸货吨位"
  306. min-width="80"
  307. align="center"
  308. ></el-table-column>
  309. <el-table-column
  310. prop="remainTons"
  311. label="剩余吨位"
  312. min-width="80"
  313. align="center"
  314. ></el-table-column>
  315. <!-- <el-table-column
  316. prop="waybillStatus"
  317. sortable
  318. label="签单状态"
  319. min-width="100"
  320. align="center"
  321. >
  322. <template v-slot="scope">
  323. {{
  324. scope.row.waybillStatus == 0
  325. ? ""
  326. : scope.row.waybillStatus == 1
  327. ? "未签单"
  328. : "已签单"
  329. }}
  330. </template>
  331. </el-table-column> -->
  332. <!-- <el-table-column
  333. prop="transStatus"
  334. label="船舶状态"
  335. min-width="100"
  336. align="center"
  337. ></el-table-column> -->
  338. <el-table-column
  339. prop="hasInsurance"
  340. label="保险状态"
  341. min-width="70"
  342. align="center"
  343. >
  344. <template v-slot="scope">
  345. {{ scope.row.hasInsurance == 0 ? "未购买" : "已购买" }}
  346. </template>
  347. </el-table-column>
  348. <!-- <el-table-column
  349. sortable
  350. prop="createTime"
  351. label="创建时间"
  352. min-width="100"
  353. align="center"
  354. ></el-table-column>
  355. <el-table-column
  356. prop="remark"
  357. label="备注"
  358. min-width="100"
  359. align="center"
  360. ></el-table-column> -->
  361. <el-table-column label="操作" min-width="80" align="center">
  362. <template v-slot="scope">
  363. <el-button
  364. @click="voyageDetail(scope.row.id, tableData)"
  365. type="text"
  366. size="small"
  367. >
  368. 查看详情
  369. </el-button>
  370. </template>
  371. </el-table-column>
  372. </el-table>
  373. <div style="width: 100%; text-align: right; margin-top: 43px">
  374. <el-pagination
  375. background
  376. layout="prev, pager, next"
  377. :current-page="currentPage"
  378. :total="total"
  379. :page-size="pageSize"
  380. @current-change="pageChange"
  381. ></el-pagination>
  382. </div>
  383. </div>
  384. </template>
  385. <script setup>
  386. import { ref, h, reactive, toRefs, onMounted } from "vue";
  387. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  388. import store from "../../store";
  389. import router from "../../router";
  390. import md5 from "md5";
  391. import api from "../../apis/fetch";
  392. import _ from "lodash";
  393. let currentPage = ref(1);
  394. let pageSize = ref(20);
  395. let term = ref("");
  396. let tableData = ref([]);
  397. let total = ref(0);
  398. let status = ref(0);
  399. async function getVoyageList(page) {
  400. currentPage.value = page || currentPage.value;
  401. let res = await api.getVoyageList({
  402. cargoOwnerId: 0,
  403. shipId: 0,
  404. status: status.value,
  405. term: term.value,
  406. currentPage: currentPage.value,
  407. size: pageSize.value,
  408. });
  409. if (res.data.status == 0) {
  410. tableData.value = res.data.result;
  411. total.value = res.data.total;
  412. } else {
  413. tableData.value = [];
  414. total.value = 0;
  415. ElNotification({
  416. type: "error",
  417. title: res.data.msg,
  418. });
  419. }
  420. }
  421. function changeVoyageType(s) {
  422. currentPage.value = 1;
  423. status.value = s;
  424. getVoyageList();
  425. }
  426. async function voyageDetail(id) {
  427. router.push({
  428. path: "/voyage/voyageDetail",
  429. query: {
  430. id,
  431. },
  432. });
  433. }
  434. function pageChange(e) {
  435. currentPage.value = e;
  436. getVoyageList();
  437. }
  438. function goToVoyageAdd() {
  439. router.push({
  440. path: "/voyage/voyageAdd",
  441. });
  442. }
  443. let voyageAddDialogVisible = ref(false);
  444. const rules = ref({
  445. voyageName: [{ required: false, message: "请填写航次名称", trigger: "blur" }],
  446. shipName: [{ required: true, message: "请选择船舶", trigger: "blur" }],
  447. cargoOwnerName: [{ required: true, message: "请选择货主", trigger: "blur" }],
  448. startTime: [{ required: true, message: "请填写开始时间", trigger: "blur" }],
  449. loadPort: [{ required: true, message: "请填写装货港", trigger: "blur" }],
  450. // dischargeProt: [{ required: true, message: "请填写卸货港", trigger: "blur" }],
  451. cargo: [{ required: true, message: "请填写货种", trigger: "blur" }],
  452. tons: [{ required: false, message: "请填写吨位", trigger: "blur" }],
  453. pieces: [{ required: false, message: "请填写件数", trigger: "blur" }],
  454. });
  455. let voyageForm = ref({
  456. voyageName: "",
  457. cargoOwnerId: "",
  458. cargoOwnerName: "",
  459. startTime: "",
  460. endTime: "",
  461. loadPort: "",
  462. dischargeProt: "",
  463. cargo: "",
  464. tons: 0,
  465. loadPortId: "",
  466. dischargeProtId: "",
  467. shipId: "",
  468. shipName: "",
  469. pieces: 0,
  470. });
  471. function clear(type) {
  472. setTimeout(() => {
  473. switch (type) {
  474. case "shipId": {
  475. let index = ref(-1);
  476. for (let i in shipsCache.value) {
  477. if (voyageForm.value.shipName == shipsCache.value[i].shipName) {
  478. index.value = i;
  479. break;
  480. }
  481. }
  482. if (index.value != -1) {
  483. voyageForm.value.shipId = shipsCache.value[index.value].shipId;
  484. } else {
  485. let b = shipsCache.value.some((item) => {
  486. return (
  487. item.shipId == voyageForm.value.shipId &&
  488. item.shipName == voyageForm.value.shipName
  489. );
  490. });
  491. voyageForm.value["shipId"] = "";
  492. voyageForm.value["shipName"] = "";
  493. }
  494. break;
  495. }
  496. case "cargoOwnerId": {
  497. let index = ref(-1);
  498. for (let i in cargoOwnersCache.value) {
  499. if (
  500. voyageForm.value.cargoOwnerName ==
  501. cargoOwnersCache.value[i].userName
  502. ) {
  503. index.value = i;
  504. break;
  505. }
  506. }
  507. if (index.value != -1) {
  508. voyageForm.value.cargoOwnerId =
  509. cargoOwnersCache.value[index.value].userId;
  510. } else {
  511. let b = cargoOwnersCache.value.some((item) => {
  512. return (
  513. item.userId == voyageForm.value.cargoOwnerId &&
  514. item.userName == voyageForm.value.cargoOwnerName
  515. );
  516. });
  517. if (!b) {
  518. voyageForm.value["cargoOwnerId"] = "";
  519. voyageForm.value["cargoOwnerName"] = "";
  520. }
  521. }
  522. break;
  523. }
  524. case "loadPort": {
  525. let index = ref(-1);
  526. for (let i in colCache.value) {
  527. if (voyageForm.value.loadPort == colCache.value[i].value) {
  528. index.value = i;
  529. break;
  530. }
  531. }
  532. if (index.value != -1) {
  533. voyageForm.value.loadPortId = colCache.value[index.value].key;
  534. } else {
  535. let b = colCache.value.some((item) => {
  536. return (
  537. item.value == voyageForm.value.loadPort &&
  538. item.key == voyageForm.value.loadPortId
  539. );
  540. });
  541. if (!b) {
  542. voyageForm.value["loadPort"] = "";
  543. voyageForm.value["loadPortId"] = "";
  544. }
  545. }
  546. break;
  547. }
  548. case "dischargeProt": {
  549. let index = ref(-1);
  550. for (let i in colCache.value) {
  551. if (voyageForm.value.dischargeProt == colCache.value[i].value) {
  552. index.value = i;
  553. break;
  554. }
  555. }
  556. if (index.value != -1) {
  557. voyageForm.value.dischargeProtId = colCache.value[index.value].key;
  558. } else {
  559. let b = colCache.value.some((item) => {
  560. return (
  561. item.value == voyageForm.value.dischargeProt &&
  562. item.key == voyageForm.value.dischargeProtId
  563. );
  564. });
  565. if (!b) {
  566. voyageForm.value["dischargeProt"] = "";
  567. voyageForm.value["dischargeProtId"] = "";
  568. }
  569. }
  570. break;
  571. }
  572. }
  573. }, 200);
  574. }
  575. let voyageFormRef = ref(null);
  576. async function addVoyage() {
  577. voyageFormRef.value.validate(async (valid) => {
  578. if (valid) {
  579. console.log("提交", voyageForm.value);
  580. discPorts.value = discPorts.value.filter((item) => {
  581. return item.loadPortId && item.loadPort;
  582. });
  583. if (!discPorts.value.length) {
  584. ElNotification({
  585. title: "请选择至少一个装货港",
  586. type: "error",
  587. });
  588. return;
  589. }
  590. let discId = [];
  591. let discStr = [];
  592. for (let i of discPorts.value) {
  593. discId.push(i.loadPortId);
  594. discStr.push(i.loadPort);
  595. }
  596. let res = await api.addVoyage({
  597. ...voyageForm.value,
  598. dischargePortIds: discId.join(","),
  599. dischargePorts: discStr.join(","),
  600. });
  601. if (res.data.status == 0) {
  602. ElNotification({
  603. title: res.data.msg,
  604. type: "success",
  605. });
  606. resetAddVoyageForm();
  607. getVoyageList();
  608. } else {
  609. console.log(res);
  610. ElNotification({
  611. title: res.data.msg,
  612. type: "error",
  613. });
  614. }
  615. } else {
  616. console.log("未提交", voyageForm.value);
  617. }
  618. });
  619. }
  620. let shipsCache = ref([]);
  621. let colCache = ref([]);
  622. let cargoOwnersCache = ref([]);
  623. let searchShip = _.debounce(
  624. async (queryString, cb) => {
  625. if (!queryString) return;
  626. let res = await api.searchShip({
  627. term: queryString,
  628. });
  629. let ships = [];
  630. if (res.data.status == 0) {
  631. ships = res.data.result;
  632. for (let i of ships) {
  633. i.value = `${i.shipName}`;
  634. }
  635. shipsCache.value = ships;
  636. cb(ships);
  637. }
  638. },
  639. 1000,
  640. { leading: true }
  641. );
  642. let selectShip = (item) => {
  643. voyageForm.value.shipId = item.shipId;
  644. };
  645. let searchCargoOwner = _.debounce(
  646. async (queryString, cb) => {
  647. if (!queryString) return;
  648. let res = await api.searchUser({
  649. term: queryString,
  650. identity: 2,
  651. });
  652. let cargoOwners = [];
  653. if (res.data.status == 0) {
  654. cargoOwners = res.data.result;
  655. for (let i of cargoOwners) {
  656. i.value = `${i.userName}`;
  657. }
  658. cargoOwnersCache.value = cargoOwners;
  659. cb(cargoOwners);
  660. }
  661. },
  662. 1000,
  663. { leading: true }
  664. );
  665. let selectCargoOwner = (item) => {
  666. voyageForm.value.cargoOwnerId = item.userId;
  667. };
  668. let getCol = _.debounce(
  669. async (queryString, cb) => {
  670. if (!queryString) return;
  671. let res = await api.getCol({
  672. term: queryString,
  673. });
  674. if (res.data.status == 0) {
  675. colCache.value = [...colCache.value, ...res.data.result];
  676. colCache.value = _.uniqBy(colCache.value, "key");
  677. cb(res.data.result);
  678. }
  679. },
  680. 1000,
  681. { leading: true }
  682. );
  683. let selectLoadPort = (item) => {
  684. voyageForm.value.loadPortId = item.key;
  685. voyageForm.value.loadPort = item.value;
  686. };
  687. let selectDischargeProt = (item, index) => {
  688. discPorts.value[index] = { loadPortId: item.key, loadPort: item.value };
  689. };
  690. function resetAddVoyageForm() {
  691. voyageAddDialogVisible.value = false;
  692. voyageFormRef.value.resetFields();
  693. voyageForm.value = {
  694. voyageName: "",
  695. cargoOwnerId: "",
  696. cargoOwnerName: "",
  697. startTime: "",
  698. endTime: "",
  699. loadPort: "",
  700. dischargeProt: "",
  701. cargo: "",
  702. tons: 0,
  703. loadPortId: "",
  704. dischargeProtId: "",
  705. shipId: "",
  706. shipName: "",
  707. pieces: 0,
  708. };
  709. discPorts.value = [{}];
  710. }
  711. let sortradio = ref(0);
  712. let isUpLoading = ref(false);
  713. function upFYDISuccess(e) {
  714. if (e.status == 0) {
  715. ElNotification.success({
  716. title: "成功",
  717. duration: 2000,
  718. message: e.msg,
  719. });
  720. } else {
  721. ElNotification.error({
  722. title: "失败",
  723. duration: 2000,
  724. message: e.msg,
  725. });
  726. }
  727. isUpLoading.value = false;
  728. FYDIModalVisable.value = false;
  729. FYDIParams.value.cargoOwnerId = "";
  730. cargoOwnerCompanyStr.value = "";
  731. }
  732. function beforeFYDI() {
  733. isUpLoading.value = true;
  734. }
  735. let FYDIModalVisable = ref(false);
  736. let FYDIParams = ref({
  737. cargoOwnerId: "",
  738. });
  739. let cargoOwnerCompanyStr = ref("");
  740. function selectCargoOwnerUpload(item) {
  741. cargoOwnerCompanyStr.value = item.key;
  742. FYDIParams.value.cargoOwnerId = item.value;
  743. }
  744. function FYDIModalClose() {
  745. isUpLoading.value = false;
  746. FYDIModalVisable.value = false;
  747. FYDIParams.value.cargoOwnerId = "";
  748. cargoOwnerCompanyStr.value = "";
  749. }
  750. function rowStyle({ row }) {
  751. let rowStyle = {};
  752. if (row.daysInPort >= 30) {
  753. rowStyle.color = "red";
  754. return rowStyle;
  755. }
  756. }
  757. let discPorts = ref([{}]);
  758. function addDiscPort() {
  759. discPorts.value.push({});
  760. }
  761. onMounted(() => {
  762. getVoyageList();
  763. });
  764. </script>
  765. <style scoped>
  766. .search-btn {
  767. display: inline-block;
  768. width: 60px;
  769. height: 32px;
  770. background: #0094fe;
  771. border-radius: 2px;
  772. font-size: 14px;
  773. font-family: PingFangSC-Regular, PingFang SC;
  774. font-weight: 400;
  775. color: #ffffff;
  776. text-align: center;
  777. line-height: 32px;
  778. margin-left: 10px;
  779. cursor: pointer;
  780. }
  781. .cargo-owner-add {
  782. width: 80px;
  783. height: 32px;
  784. border-radius: 2px;
  785. border: 1px solid #0094fe;
  786. font-size: 14px;
  787. font-family: PingFangSC-Regular, PingFang SC;
  788. font-weight: 400;
  789. color: #0094fe;
  790. line-height: 32px;
  791. text-align: center;
  792. cursor: pointer;
  793. }
  794. :deep().el-dialog {
  795. width: 560px;
  796. padding: 20px 50px;
  797. border-radius: 6px;
  798. }
  799. :deep() .el-dialog__title {
  800. font-size: 18px;
  801. font-family: PingFangSC-Regular, PingFang SC;
  802. font-weight: 400;
  803. color: #0094fe;
  804. }
  805. .normal-label {
  806. font-size: 14px;
  807. font-family: PingFangSC-Regular, PingFang SC;
  808. font-weight: 400;
  809. color: #353a42;
  810. margin-right: 10px;
  811. }
  812. .show-input {
  813. width: 280px;
  814. height: 32px;
  815. background: #ffffff;
  816. border-radius: 2px;
  817. border: 1px solid #dee0e3;
  818. font-size: 14px;
  819. font-family: PingFangSC-Regular, PingFang SC;
  820. font-weight: 400;
  821. color: #333333;
  822. line-height: 32px;
  823. padding-left: 12px;
  824. margin-right: 40px;
  825. }
  826. .radio-btns {
  827. height: 38px;
  828. width: 70px;
  829. border: 1px solid #1486f9;
  830. line-height: 38px;
  831. text-align: center;
  832. font-size: 14px;
  833. font-family: PingFangSC-Regular, PingFang SC;
  834. font-weight: 400;
  835. color: #0094fe;
  836. cursor: pointer;
  837. }
  838. .left-radius {
  839. border-top-left-radius: 19px;
  840. border-bottom-left-radius: 19px;
  841. width: 80px;
  842. }
  843. .right-radius {
  844. border-top-right-radius: 19px;
  845. border-bottom-right-radius: 19px;
  846. width: 80px;
  847. }
  848. .currentbtn {
  849. background: #1486f9;
  850. color: #fff;
  851. }
  852. .search-btn {
  853. display: inline-block;
  854. width: 60px;
  855. height: 38px;
  856. background: #0094fe;
  857. border-radius: 2px;
  858. font-size: 14px;
  859. font-family: PingFangSC-Regular, PingFang SC;
  860. font-weight: 400;
  861. color: #ffffff;
  862. text-align: center;
  863. line-height: 38px;
  864. margin-left: 10px;
  865. cursor: pointer;
  866. }
  867. .voyage-add {
  868. width: 80px;
  869. height: 36px;
  870. border-radius: 2px;
  871. border: 1px solid #0094fe;
  872. font-size: 14px;
  873. font-family: PingFangSC-Regular, PingFang SC;
  874. font-weight: 400;
  875. color: #0094fe;
  876. line-height: 36px;
  877. text-align: center;
  878. cursor: pointer;
  879. }
  880. :deep() .el-dialog {
  881. width: 800px;
  882. }
  883. :deep() .el-form-item {
  884. margin-right: 22px;
  885. width: 300px;
  886. }
  887. :deep() .el-autocomplete {
  888. width: 220px;
  889. }
  890. .el-radio {
  891. margin-right: 10px;
  892. }
  893. .el-radio:last-child {
  894. margin-right: 20px;
  895. }
  896. </style>