index.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  1. <template>
  2. <div class="app-container">
  3. <el-menu
  4. :default-active="activeIndex"
  5. class="el-menu-demo"
  6. mode="horizontal"
  7. @select="handleSelect"
  8. text-color="#000"
  9. active-text-color="#ffd04b"
  10. >
  11. <el-menu-item index="0">全部</el-menu-item>
  12. <el-menu-item index="1">待审核</el-menu-item>
  13. <el-menu-item index="2">订舱审核通过</el-menu-item>
  14. <el-menu-item index="3">待配船</el-menu-item>
  15. <el-menu-item index="4">配船审核通过</el-menu-item>
  16. <!-- <el-menu-item index="5">已撤销</el-menu-item>-->
  17. <el-menu-item index="10">已驳回</el-menu-item>
  18. <el-menu-item index="12">运单变更</el-menu-item>
  19. </el-menu>
  20. <el-form
  21. :model="queryParams"
  22. ref="queryForm"
  23. :inline="true"
  24. v-show="showSearch"
  25. label-width="68px"
  26. style="margin-top: 20px"
  27. >
  28. <el-row>
  29. <el-col :span="6">
  30. <el-form-item label="船名" prop="fVslid">
  31. <el-select
  32. size="small"
  33. style="width: 240px"
  34. v-model="queryParams.fVslid"
  35. >
  36. <el-option
  37. v-for="item in vesselOptions"
  38. :key="item.fId"
  39. :label="item.fName"
  40. :value="item.fId"
  41. />
  42. </el-select>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="6">
  46. <el-form-item label="航次" prop="fVoyid">
  47. <el-select
  48. v-model="queryParams.fVoyid"
  49. filterable
  50. clearable
  51. remote
  52. size="small"
  53. style="width: 240px"
  54. >
  55. <el-option
  56. v-for="item in voyageOptions"
  57. :key="item.fId"
  58. :label="item.fNo"
  59. :value="item.fId"
  60. />
  61. </el-select>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="6">
  65. <el-form-item label="订舱日期" prop="cLoadDate">
  66. <el-date-picker
  67. v-model="queryParams.cLoadDate"
  68. type="daterange"
  69. range-separator="至"
  70. style="width: 240px"
  71. value-format="yyyy-MM-dd HH:mm:ss"
  72. :default-time="['00:00:00', '23:59:59']"
  73. start-placeholder="开始日期"
  74. end-placeholder="结束日期"
  75. size="small"
  76. >
  77. </el-date-picker>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="6">
  81. <el-form-item label="起运港口" prop="fLoadportid">
  82. <el-select
  83. v-model="queryParams.fLoadportid"
  84. filterable
  85. remote
  86. clearable
  87. size="small"
  88. style="width: 240px"
  89. class="elSelect"
  90. placeholder="请输入模糊查找目的港口"
  91. >
  92. <el-scrollbar>
  93. <el-option
  94. v-for="(dict, index) in fMblnoOptions"
  95. :key="index"
  96. :label="dict.fName"
  97. :value="dict.fId"
  98. ></el-option>
  99. </el-scrollbar>
  100. </el-select>
  101. </el-form-item>
  102. </el-col>
  103. </el-row>
  104. <el-collapse-transition>
  105. <div v-show="show">
  106. <el-row>
  107. <el-col :span="6">
  108. <el-form-item label="目的港口" prop="fDestportid">
  109. <el-select
  110. v-model="queryParams.fDestportid"
  111. filterable
  112. clearable
  113. remote
  114. size="small"
  115. style="width: 240px"
  116. class="elSelect"
  117. placeholder="请输入模糊查找目的港口"
  118. >
  119. <el-scrollbar>
  120. <el-option
  121. v-for="(dict, index) in fMblnoOptions"
  122. :key="index"
  123. :label="dict.fName"
  124. :value="dict.fId"
  125. ></el-option>
  126. </el-scrollbar>
  127. </el-select>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="6">
  131. <el-form-item label="提单号" prop="fMblno">
  132. <el-input
  133. size="small"
  134. style="width: 240px"
  135. clearable
  136. v-model="queryParams.fMblno"
  137. ></el-input>
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="6">
  141. <el-form-item label="订舱单位" prop="fCorpid">
  142. <el-select
  143. v-model="queryParams.fCorpid"
  144. clearable
  145. filterable
  146. size="small"
  147. placeholder="请选择订舱单位"
  148. style="width: 240px"
  149. >
  150. <el-option
  151. v-for="(item, index) in fCorpid"
  152. :key="index.fId"
  153. :label="item.fName"
  154. :value="item.fId"
  155. ></el-option>
  156. </el-select>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :span="6">
  160. <el-form-item label="业务员" prop="createBy">
  161. <el-select
  162. v-model="queryParams.createBy"
  163. clearable
  164. filterable
  165. size="small"
  166. placeholder="请选择业务员"
  167. style="width: 240px"
  168. >
  169. <el-option
  170. v-for="(item, index) in createBy"
  171. :key="index.userId"
  172. :label="item.userName"
  173. :value="item.userId"
  174. ></el-option>
  175. </el-select>
  176. </el-form-item>
  177. </el-col>
  178. </el-row>
  179. <el-row>
  180. <el-col :span="6">
  181. <el-form-item label="箱号" prop="fCntrno">
  182. <el-input
  183. size="small"
  184. style="width: 240px"
  185. clearable
  186. v-model="queryParams.fCntrno"
  187. placeholder="请输入箱号"
  188. ></el-input>
  189. </el-form-item>
  190. </el-col>
  191. <el-col :span="6">
  192. <el-form-item label="开船日期" prop="timeInterval">
  193. <el-date-picker
  194. v-model="queryParams.timeInterval"
  195. type="daterange"
  196. range-separator="至"
  197. style="width: 240px"
  198. value-format="yyyy-MM-dd HH:mm:ss"
  199. :default-time="['00:00:00', '23:59:59']"
  200. start-placeholder="开始日期"
  201. end-placeholder="结束日期"
  202. size="small"
  203. >
  204. </el-date-picker>
  205. </el-form-item>
  206. </el-col>
  207. </el-row>
  208. </div>
  209. </el-collapse-transition>
  210. </el-form>
  211. <el-row :gutter="10" class="mb8">
  212. <div style="float: left">
  213. <el-button
  214. type="cyan"
  215. icon="el-icon-search"
  216. size="mini"
  217. @click="handleQuery"
  218. >搜索</el-button
  219. >
  220. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  221. >重置</el-button
  222. >
  223. <el-button
  224. v-show="show"
  225. @click="show = !show"
  226. icon="el-icon-arrow-up"
  227. size="mini"
  228. >展开</el-button
  229. >
  230. <el-button
  231. v-show="!show"
  232. @click="show = !show"
  233. icon="el-icon-arrow-down"
  234. size="mini"
  235. >展开</el-button
  236. >
  237. <el-button
  238. type="primary"
  239. icon="el-icon-download"
  240. size="mini"
  241. @click="handleExport"
  242. >导出</el-button
  243. >
  244. <el-button
  245. type="primary"
  246. plain
  247. icon="el-icon-search"
  248. size="mini"
  249. @click="matchingShip(false)"
  250. :disabled="
  251. selection.length == 0
  252. ? true
  253. : false ||
  254. selection.findIndex(function (item) {
  255. return item.vslName !== selection[0].vslName;
  256. }) === -1
  257. ? selection.findIndex(function (item) {
  258. return item.voyNo !== selection[0].voyNo;
  259. }) === -1
  260. ? false
  261. : true
  262. : true
  263. "
  264. >配船</el-button
  265. >
  266. <el-button
  267. type="info"
  268. plain
  269. icon="el-icon-search"
  270. size="mini"
  271. @click="cancelShip"
  272. :disabled="selection.length == 0 ? true : false"
  273. >取消配船</el-button
  274. >
  275. </div>
  276. <div class="tabSetting">
  277. <right-toolbar
  278. :showSearch.sync="showSearch"
  279. @queryTable="getList"
  280. ></right-toolbar>
  281. <div style="margin: 0 12px">
  282. <el-button
  283. icon="el-icon-setting"
  284. size="mini"
  285. circle
  286. @click="showSetting = !showSetting"
  287. ></el-button>
  288. </div>
  289. </div>
  290. </el-row>
  291. <el-dialog
  292. title="提示"
  293. :visible.sync="showSetting"
  294. width="700px"
  295. v-dialogDrag
  296. >
  297. <template slot="title">
  298. <div class="avue-crud__dialog__header">
  299. <span class="el-dialog__title">
  300. <span
  301. style="
  302. display: inline-block;
  303. width: 3px;
  304. height: 20px;
  305. margin-right: 5px;
  306. float: left;
  307. margin-top: 2px;
  308. "
  309. ></span>
  310. </span>
  311. </div>
  312. </template>
  313. <div>配置排序列数据(拖动调整顺序)</div>
  314. <div style="margin-left: 17px">
  315. <el-checkbox
  316. v-model="allCheck"
  317. label="全选"
  318. @change="allChecked"
  319. ></el-checkbox>
  320. </div>
  321. <div style="padding: 4px; display: flex; justify-content: center">
  322. <draggable
  323. v-model="setRowList"
  324. group="site"
  325. animation="300"
  326. @start="onStart"
  327. @end="onEnd"
  328. handle=".indraggable"
  329. >
  330. <transition-group>
  331. <div
  332. v-for="item in setRowList"
  333. :key="item.surface"
  334. class="listStyle"
  335. >
  336. <div style="width: 500px" class="indraggable">
  337. <div class="progress" :style="{ width: item.width + 'px' }">
  338. <el-checkbox
  339. :label="item.name"
  340. v-model="item.checked"
  341. :true-label="0"
  342. :false-label="1"
  343. >{{ item.name }}
  344. </el-checkbox>
  345. </div>
  346. </div>
  347. <el-input-number
  348. v-model.number="item.width"
  349. controls-position="right"
  350. :min="1"
  351. :max="500"
  352. size="mini"
  353. ></el-input-number>
  354. </div>
  355. </transition-group>
  356. </draggable>
  357. </div>
  358. <span slot="footer" class="dialog-footer">
  359. <el-button @click="showSetting = false">取 消</el-button>
  360. <el-button @click="delRow" type="danger">重 置</el-button>
  361. <el-button type="primary" @click="save()">确 定</el-button>
  362. </span>
  363. </el-dialog>
  364. <el-table
  365. v-loading="loading"
  366. :data="corpsList"
  367. show-summary
  368. :summary-method="getSummaries"
  369. @selection-change="handleSelectionChange"
  370. :height="height"
  371. >
  372. <el-table-column type="selection" width="60" align="center" />
  373. <el-table-column label="行号" align="center" type="index" />
  374. <el-table-column
  375. v-for="(item, index) in getRowList"
  376. :key="index"
  377. :label="item.name"
  378. :width="item.width"
  379. :prop="item.label"
  380. align="center"
  381. :fixed="item.fixed"
  382. :show-overflow-tooltip="true"
  383. sortable
  384. >
  385. <template slot-scope="scope">
  386. <span v-if="item.label == 'createTime'">{{
  387. scope.row.createTime.slice(0, 10)
  388. }}</span>
  389. <span v-else-if="item.label == 'fCargoPlanning'">{{
  390. scope.row.fCargoPlanning == "1" ? "否" : "是"
  391. }}</span>
  392. <span v-else>{{ scope.row[item.label] }}</span>
  393. </template>
  394. </el-table-column>
  395. <!-- <el-table-column label="订舱号" align="center" prop="fBillno"/>-->
  396. <!-- <el-table-column label="运输条款" align="center" prop="fServiceitems" />-->
  397. <!-- <el-table-column label="收货人" align="center" prop="fConsigneername"/>-->
  398. <!-- <el-table-column label="航线" align="center" prop="fName"/>-->
  399. <!-- <el-table-column label="箱型" align="center" prop="fNo"/>-->
  400. <!-- <el-table-column label="箱量" align="center" prop="fCntrcount"/>-->
  401. <!-- <el-table-column label="装货时间" align="center" prop="fBsdate"/>-->
  402. <el-table-column
  403. label="操作"
  404. fixed="right"
  405. align="center"
  406. class-name="small-padding fixed-width"
  407. min-width="160px"
  408. >
  409. <template slot-scope="scope">
  410. <el-button
  411. size="mini"
  412. type="text"
  413. icon="el-icon-edit"
  414. @click="handleUpdate(scope.row, 1)"
  415. v-hasPermi="['warehouse:warehousebills:webVersionOrderDetails']"
  416. >查看
  417. </el-button>
  418. <!-- <el-button-->
  419. <!-- size="mini"-->
  420. <!-- type="text"-->
  421. <!-- icon="el-icon-delete"-->
  422. <!-- @click="handleDelete(scope.row)"-->
  423. <!-- >移除</el-button>-->
  424. </template>
  425. </el-table-column>
  426. <!-- <el-table-column-->
  427. <!-- class-name="small-padding fixed-width"-->
  428. <!-- v-for="(item,index) in boxDistributionName"-->
  429. <!-- :key="item.index"-->
  430. <!-- :label="item"-->
  431. <!-- :value="item.index"-->
  432. <!-- :prop="item"-->
  433. <!-- >-->
  434. <!-- </el-table-column>-->
  435. </el-table>
  436. <pagination
  437. v-show="total > 0"
  438. :total="total"
  439. :page.sync="queryParams.pageNum"
  440. :limit.sync="queryParams.pageSize"
  441. @pagination="getList"
  442. />
  443. <el-dialog title="配船" :visible.sync="shipAllocation" width="50%">
  444. <el-form :inline="true" :model="ship" class="demo-form-inline">
  445. <el-row>
  446. <el-col :span="12">
  447. <el-form-item label="船名">
  448. <el-select
  449. size="small"
  450. width="240px"
  451. v-model="ship.fVslid"
  452. @change="voyageRemthods"
  453. >
  454. <el-option
  455. v-for="item in vesselOptions"
  456. :key="item.fId"
  457. :label="item.fName"
  458. :value="item.fId"
  459. />
  460. </el-select>
  461. </el-form-item>
  462. </el-col>
  463. <el-col :span="12">
  464. <el-form-item label="航次">
  465. <el-select
  466. v-model="ship.fVoyid"
  467. filterable
  468. remote
  469. size="small"
  470. style="width: 200px"
  471. >
  472. <el-option
  473. v-for="item in voyageOptions"
  474. :key="item.fId"
  475. :label="item.fNo"
  476. :value="item.fId"
  477. />
  478. </el-select>
  479. </el-form-item>
  480. </el-col>
  481. </el-row>
  482. </el-form>
  483. <span slot="footer" class="dialog-footer">
  484. <el-button @click="shipAllocation = false">取 消</el-button>
  485. <el-button type="primary" @click="matchingShip(true)">确 定</el-button>
  486. </span>
  487. </el-dialog>
  488. </div>
  489. </template>
  490. <script>
  491. import {
  492. bookingParty,
  493. selectUserByRole,
  494. listCorps,
  495. getcntrName,
  496. delCorps,
  497. changeCorpsStatus,
  498. exportInventory,
  499. cancelAllocation,
  500. confirmAllocation,
  501. } from "@/api/kaihe/domesticTrade/myOrder";
  502. import Cookies from "js-cookie";
  503. import { addSet, resetModule, select } from "@/api/system/set";
  504. import Vue from "vue";
  505. import draggable from "vuedraggable";
  506. import { getVesselName } from "@/api/finance/applyForInvoice/chargeInvoice";
  507. import { getVoyageName } from "@/api/finance/applyForInvoice/feeDetail";
  508. import { portInquiry } from "@/api/kaihe/domesticTrade/orderInformation";
  509. import { defaultDate } from "@/utils/date";
  510. Vue.directive("dialogDrag", {
  511. bind(el, binding, vnode, oldVnode) {
  512. const dialogHeaderEl = el.querySelector(".el-dialog__header");
  513. const dragDom = el.querySelector(".el-dialog");
  514. const enlarge = el.querySelector(".enlarge");
  515. dialogHeaderEl.style.cursor = "move";
  516. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  517. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  518. if (enlarge) {
  519. enlarge.onclick = (e) => {
  520. dragDom.style.top = "0px";
  521. dragDom.style.left = "0px";
  522. };
  523. }
  524. dialogHeaderEl.onmousedown = (e) => {
  525. // 鼠标按下,计算当前元素距离可视区的距离
  526. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  527. const disY = e.clientY - dialogHeaderEl.offsetTop;
  528. // 获取到的值带px 正则匹配替换
  529. let styL, styT;
  530. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  531. if (sty.left.includes("%")) {
  532. styL =
  533. +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
  534. styT =
  535. +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
  536. } else {
  537. styL = +sty.left.replace(/\px/g, "");
  538. styT = +sty.top.replace(/\px/g, "");
  539. }
  540. document.onmousemove = function (e) {
  541. // 通过事件委托,计算移动的距离
  542. const l = e.clientX - disX;
  543. const t = e.clientY - disY;
  544. // 移动当前元素
  545. if (t + styT >= 0) {
  546. dragDom.style.top = `${t + styT}px`;
  547. }
  548. dragDom.style.left = `${l + styL}px`;
  549. // 将此时的位置传出去
  550. // binding.value({x:e.pageX,y:e.pageY})
  551. };
  552. document.onmouseup = function (e) {
  553. document.onmousemove = null;
  554. document.onmouseup = null;
  555. };
  556. };
  557. },
  558. });
  559. export default {
  560. name: "myOrder",
  561. components: {
  562. draggable,
  563. },
  564. data() {
  565. return {
  566. height:window.innerHeight - 380+'px',
  567. voyageOptions: [],
  568. vesselOptions: [],
  569. show: false,
  570. activeIndex: "0",
  571. setRowList: [],
  572. getRowList: [],
  573. tableDate: [
  574. {
  575. surface: "1",
  576. label: "fBillno",
  577. name: "订舱号",
  578. checked: 0,
  579. width: 120,
  580. },
  581. {
  582. surface: "2",
  583. label: "fServiceitems",
  584. name: "运输条款",
  585. checked: 0,
  586. width: 120,
  587. },
  588. {
  589. surface: "3",
  590. label: "fConsigneername",
  591. name: "收货人",
  592. checked: 0,
  593. width: 120,
  594. },
  595. {
  596. surface: "4",
  597. label: "fName",
  598. name: "航线",
  599. checked: 0,
  600. width: 120,
  601. },
  602. {
  603. surface: "5",
  604. label: "fNo",
  605. name: "箱型",
  606. checked: 0,
  607. width: 120,
  608. },
  609. {
  610. surface: "6",
  611. label: "fCntrcount",
  612. name: "箱量",
  613. checked: 0,
  614. width: 120,
  615. },
  616. {
  617. surface: "7",
  618. label: "loadCntr",
  619. name: "返箱数",
  620. checked: 0,
  621. width: 120,
  622. },
  623. {
  624. surface: "8",
  625. label: "fBsdate",
  626. name: "装货时间",
  627. checked: 0,
  628. width: 120,
  629. },
  630. {
  631. surface: "9",
  632. label: "fBillstatus",
  633. name: "状态",
  634. checked: 0,
  635. width: 120,
  636. },
  637. {
  638. surface: "10",
  639. label: "vslName",
  640. name: "船名",
  641. checked: 0,
  642. width: 120,
  643. },
  644. {
  645. surface: "11",
  646. label: "voyNo",
  647. name: "航次",
  648. checked: 0,
  649. width: 120,
  650. },
  651. {
  652. surface: "12",
  653. label: "fMblno",
  654. name: "提单号",
  655. checked: 0,
  656. width: 120,
  657. },
  658. {
  659. surface: "13",
  660. label: "corpName",
  661. name: "订舱单位",
  662. checked: 0,
  663. width: 120,
  664. },
  665. {
  666. surface: "14",
  667. label: "goodsName",
  668. name: "货名",
  669. checked: 0,
  670. width: 120,
  671. },
  672. {
  673. surface: "15",
  674. label: "createBy",
  675. name: "订舱人",
  676. checked: 0,
  677. width: 120,
  678. },
  679. {
  680. surface: "16",
  681. label: "createTime",
  682. name: "订舱时间",
  683. checked: 0,
  684. width: 120,
  685. },
  686. {
  687. surface: "17",
  688. label: "loadportName",
  689. name: "起运港",
  690. checked: 0,
  691. width: 120,
  692. },
  693. {
  694. surface: "18",
  695. label: "destportName",
  696. name: "目的港",
  697. checked: 0,
  698. width: 120,
  699. },
  700. {
  701. surface: "19",
  702. label: "moneyStatus",
  703. name: "费用状态",
  704. checked: 0,
  705. width: 120,
  706. },
  707. {
  708. surface: "20",
  709. label: "fCargoPlanning",
  710. name: "配船",
  711. checked: 0,
  712. width: 120,
  713. },
  714. {
  715. surface: "21",
  716. label: "remark",
  717. name: "备注",
  718. checked: 0,
  719. width: 120,
  720. },
  721. ],
  722. //自定义列宽
  723. allCheck: false,
  724. showSetting: false,
  725. shipAllocation: false,
  726. ship: {
  727. fVoyid: "",
  728. fVslid: "",
  729. },
  730. serviceitems: [],
  731. container: [],
  732. // 遮罩层
  733. loading: true,
  734. // 选中数组
  735. ids: [],
  736. selection: [],
  737. // 非单个禁用
  738. single: true,
  739. // 非多个禁用
  740. multiple: true,
  741. // 显示搜索条件
  742. showSearch: true,
  743. // 总条数
  744. total: 0,
  745. // 客户详情表格数据
  746. corpsList: [],
  747. // 查询参数
  748. queryParams: {
  749. pageNum: 1,
  750. pageSize: 10,
  751. cLoadDate: defaultDate(),
  752. },
  753. fMblnoOptions: [],
  754. createBy: [],
  755. fCorpid: [],
  756. };
  757. },
  758. created() {
  759. this.setRowList = this.tableDate;
  760. this.getRowList = this.tableDate;
  761. portInquiry().then((res) => {
  762. this.fMblnoOptions = res.rows;
  763. });
  764. selectUserByRole().then((res) => {
  765. this.createBy = res.rows;
  766. });
  767. bookingParty().then((res) => {
  768. this.fCorpid = res.rows;
  769. });
  770. this.getList();
  771. this.cntrRemoteMethod();
  772. this.vessleRemthod();
  773. this.voyageRemthods();
  774. this.getDicts("f_serviceitems").then((response) => {
  775. if (response.data) {
  776. this.serviceitems = response.data;
  777. }
  778. });
  779. this.getRow();
  780. },
  781. activated() {
  782. this.getList();
  783. // this.queryParams.timeInterval = this.queryParams.timeInterval
  784. // ? this.queryParams.timeInterval
  785. // : defaultDate();
  786. },
  787. methods: {
  788. voyageRemthods() {
  789. getVoyageName({ fPid: this.ship.fVslid }).then((response) => {
  790. this.voyageOptions = response.rows;
  791. if (this.ship.fVslid) this.ship.fVoyid = "";
  792. });
  793. },
  794. //获取船名
  795. vessleRemthod() {
  796. getVesselName().then((response) => {
  797. this.vesselOptions = response.rows;
  798. });
  799. },
  800. handleSelect(key, keyPath) {
  801. if (key === "0") {
  802. this.queryParams = {
  803. pageNum: 1,
  804. pageSize: 10,
  805. };
  806. } else if (key === "1") {
  807. this.queryParams.fBillstatus = 4;
  808. } else if (key === "2") {
  809. this.queryParams.fBillstatus = 6;
  810. } else if (key === "3") {
  811. this.queryParams.fBillstatus = 9;
  812. } else if (key === "4") {
  813. this.queryParams.fBillstatus = 11;
  814. } else if (key === "7") {
  815. this.queryParams.fBillstatus = 12;
  816. } else if (key === "10") {
  817. this.queryParams.fBillstatus = 10;
  818. } else if (key === "12") {
  819. this.queryParams.fBillstatus = 12;
  820. }
  821. listCorps(this.queryParams).then((response) => {
  822. this.corpsList = response.rows;
  823. this.total = response.total;
  824. this.loading = false;
  825. });
  826. },
  827. //重置列表
  828. delRow() {
  829. this.data = {
  830. tableName: "我的订单",
  831. userId: Cookies.get("userName"),
  832. };
  833. resetModule(this.data).then((res) => {
  834. if (res.code == 200) {
  835. this.showSetting = false;
  836. this.setRowList = this.tableDate;
  837. this.getRowList = this.tableDate;
  838. }
  839. });
  840. },
  841. //列设置全选
  842. allChecked() {
  843. if (this.allCheck == true) {
  844. this.setRowList.map((e) => {
  845. return (e.checked = 0);
  846. });
  847. } else {
  848. this.setRowList.map((e) => {
  849. return (e.checked = 1);
  850. });
  851. }
  852. },
  853. //查询列数据
  854. getRow() {
  855. let that = this;
  856. this.data = {
  857. tableName: "我的订单",
  858. userId: Cookies.get("userName"),
  859. };
  860. select(this.data).then((res) => {
  861. if (res.data.length != 0) {
  862. this.getRowList = res.data.filter((e) => e.checked == 0);
  863. this.setRowList = res.data;
  864. this.setRowList = this.setRowList.reduce((res, item) => {
  865. res.push({
  866. surface: item.surface,
  867. label: item.label,
  868. name: item.name,
  869. checked: item.checked,
  870. width: item.width,
  871. fixed: item.fixed,
  872. });
  873. return res;
  874. }, []);
  875. }
  876. });
  877. },
  878. //保存列设置
  879. save() {
  880. this.showSetting = false;
  881. this.data = {
  882. tableName: "我的订单",
  883. userId: Cookies.get("userName"),
  884. sysTableSetList: this.setRowList,
  885. };
  886. addSet(this.data).then((res) => {
  887. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  888. });
  889. },
  890. //开始拖拽事件
  891. onStart() {
  892. this.drag = true;
  893. },
  894. //拖拽结束事件
  895. onEnd() {
  896. this.drag = false;
  897. },
  898. //箱型下拉查询
  899. cntrRemoteMethod() {
  900. let queryParams = { pageNum: 1 };
  901. getcntrName(queryParams).then((response) => {
  902. this.container = response.rows;
  903. });
  904. },
  905. /** 删除按钮操作 */
  906. handleDelete(row) {
  907. const fIds = row.fId || this.ids;
  908. this.$confirm(
  909. '是否确认删除客户详情编号为"' + fIds + '"的数据项?',
  910. "警告",
  911. {
  912. confirmButtonText: "确定",
  913. cancelButtonText: "取消",
  914. type: "warning",
  915. }
  916. )
  917. .then(function () {
  918. return delCorps(fIds);
  919. })
  920. .then(() => {
  921. this.getList();
  922. this.msgSuccess("删除成功");
  923. });
  924. },
  925. //查看跳转
  926. handleUpdate(row, num) {
  927. let res = {};
  928. res = {
  929. fId: row.fId,
  930. num: num,
  931. };
  932. this.$router.push({
  933. path: "/domesticTrade/orderInformation",
  934. query: { data: JSON.stringify(res) },
  935. });
  936. },
  937. //模糊查询地点
  938. addressMethod() {
  939. let queryParams = { pageNum: 1 };
  940. getaddress(queryParams).then((response) => {
  941. this.addressOptions = response.rows;
  942. });
  943. },
  944. /** 查询客户详情列表 */
  945. getList() {
  946. listCorps(this.queryParams).then((response) => {
  947. this.corpsList = response.rows;
  948. this.total = response.total;
  949. this.loading = false;
  950. });
  951. },
  952. // 从表重置
  953. contList() {
  954. this.contactList = [];
  955. },
  956. // 状态修改
  957. handleStatusChange(row) {
  958. let text = row.fStatus === "0" ? "启用" : "停用";
  959. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  960. confirmButtonText: "确定",
  961. cancelButtonText: "取消",
  962. type: "warning",
  963. })
  964. .then(function () {
  965. return changeCorpsStatus(row.fId, row.fStatus);
  966. })
  967. .then(() => {
  968. this.msgSuccess(text + "成功");
  969. })
  970. .catch(function () {
  971. row.fStatus = row.fStatus === "0" ? "1" : "0";
  972. });
  973. },
  974. /** 配船按钮操作 */
  975. matchingShip(type) {
  976. if (type === false) {
  977. this.shipAllocation = true;
  978. this.ship.fVoyid = this.selection[0].fVoyid;
  979. this.ship.fVslid = this.selection[0].fVslid;
  980. // this.ship.fPid = this.selection[0].fVslid
  981. } else {
  982. this.ship.fCargoPlanning = 0;
  983. this.ship.orderId = [];
  984. this.selection.forEach((item) => this.ship.orderId.push(item.fId));
  985. confirmAllocation(this.ship).then((res) => {
  986. console.log(res);
  987. this.shipAllocation = false;
  988. this.getList();
  989. this.$message({
  990. showClose: true,
  991. message: "配船成功",
  992. type: "success",
  993. });
  994. });
  995. }
  996. },
  997. /** 取消配船按钮操作 */
  998. cancelShip() {
  999. let data = [];
  1000. this.selection.forEach((item) => data.push(item.fId));
  1001. cancelAllocation(data).then((res) => {
  1002. this.$message({
  1003. showClose: true,
  1004. message: "取消配船成功",
  1005. type: "success",
  1006. });
  1007. this.getList();
  1008. });
  1009. },
  1010. /** 导出按钮操作 */
  1011. handleExport() {
  1012. const queryParams = this.queryParams;
  1013. this.$confirm("是否选择船名航次?", "警告", {
  1014. confirmButtonText: "确定",
  1015. cancelButtonText: "取消",
  1016. type: "warning",
  1017. })
  1018. .then(function () {
  1019. return exportInventory(queryParams);
  1020. })
  1021. .then((response) => {
  1022. this.download(response.msg);
  1023. });
  1024. },
  1025. /** 搜索按钮操作 */
  1026. handleQuery() {
  1027. this.queryParams.pageNum = 1;
  1028. this.queryParams.pageSize = 10;
  1029. this.getList();
  1030. },
  1031. /** 重置按钮操作 */
  1032. resetQuery() {
  1033. this.queryParams = {
  1034. fBillno: null,
  1035. fServiceitems: null,
  1036. fConsigneername: null,
  1037. fCntrid: null,
  1038. fCntrcount: null,
  1039. cLoadDate: null,
  1040. fCntrno: null,
  1041. timeInterval: null,
  1042. };
  1043. this.resetForm("queryForm");
  1044. this.handleQuery();
  1045. },
  1046. // 多选框选中数据
  1047. handleSelectionChange(selection) {
  1048. this.selection = selection;
  1049. this.ids = selection.map((item) => item.fId);
  1050. this.single = selection.length !== 1;
  1051. this.multiple = !selection.length;
  1052. },
  1053. getSummaries(param) {
  1054. const { columns, data } = param;
  1055. const sums = [];
  1056. columns.forEach((item, index) => {
  1057. if (index === 0) {
  1058. sums[index] = "合计";
  1059. return;
  1060. }
  1061. if (item.property == "fCntrcount" || item.property == "loadCntr") {
  1062. let num1 = 0;
  1063. let num2 = 0;
  1064. data.forEach((e) => {
  1065. num1+=e.fCntrcount;
  1066. num2+=e.loadCntr;
  1067. });
  1068. if (item.property == "fCntrcount") {
  1069. sums[index] = num1 ? num1: "0";
  1070. }
  1071. if (item.property == "loadCntr") {
  1072. sums[index] = num2 ? num2: "0";
  1073. }
  1074. }
  1075. });
  1076. return sums;
  1077. },
  1078. },
  1079. };
  1080. </script>
  1081. <style lang="scss" scoped>
  1082. .tabSetting {
  1083. display: flex;
  1084. justify-content: flex-end;
  1085. }
  1086. .listStyle {
  1087. display: flex;
  1088. border-top: 1px solid #dcdfe6;
  1089. border-left: 1px solid #dcdfe6;
  1090. border-right: 1px solid #dcdfe6;
  1091. }
  1092. .listStyle:last-child {
  1093. border-bottom: 1px solid #dcdfe6;
  1094. }
  1095. .progress {
  1096. display: flex;
  1097. align-items: center;
  1098. padding: 2px;
  1099. background-color: rgba(0, 0, 0, 0.05);
  1100. height: 100%;
  1101. }
  1102. </style>
  1103. <style lang="scss">
  1104. .el-table {
  1105. .el-table__body-wrapper {
  1106. z-index: 2;
  1107. }
  1108. }
  1109. </style>