index.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124
  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. >
  371. <el-table-column type="selection" width="60" align="center" />
  372. <el-table-column label="行号" align="center" type="index" />
  373. <el-table-column
  374. v-for="(item, index) in getRowList"
  375. :key="index"
  376. :label="item.name"
  377. :width="item.width"
  378. :prop="item.label"
  379. align="center"
  380. :fixed="item.fixed"
  381. :show-overflow-tooltip="true"
  382. sortable
  383. >
  384. <template slot-scope="scope">
  385. <span v-if="item.label == 'createTime'">{{
  386. scope.row.createTime.slice(0, 10)
  387. }}</span>
  388. <span v-else-if="item.label == 'fCargoPlanning'">{{
  389. scope.row.fCargoPlanning == "1" ? "否" : "是"
  390. }}</span>
  391. <span v-else>{{ scope.row[item.label] }}</span>
  392. </template>
  393. </el-table-column>
  394. <!-- <el-table-column label="订舱号" align="center" prop="fBillno"/>-->
  395. <!-- <el-table-column label="运输条款" align="center" prop="fServiceitems" />-->
  396. <!-- <el-table-column label="收货人" align="center" prop="fConsigneername"/>-->
  397. <!-- <el-table-column label="航线" align="center" prop="fName"/>-->
  398. <!-- <el-table-column label="箱型" align="center" prop="fNo"/>-->
  399. <!-- <el-table-column label="箱量" align="center" prop="fCntrcount"/>-->
  400. <!-- <el-table-column label="装货时间" align="center" prop="fBsdate"/>-->
  401. <el-table-column
  402. label="操作"
  403. fixed="right"
  404. align="center"
  405. class-name="small-padding fixed-width"
  406. min-width="160px"
  407. >
  408. <template slot-scope="scope">
  409. <el-button
  410. size="mini"
  411. type="text"
  412. icon="el-icon-edit"
  413. @click="handleUpdate(scope.row, 1)"
  414. v-hasPermi="['warehouse:warehousebills:webVersionOrderDetails']"
  415. >查看
  416. </el-button>
  417. <!-- <el-button-->
  418. <!-- size="mini"-->
  419. <!-- type="text"-->
  420. <!-- icon="el-icon-delete"-->
  421. <!-- @click="handleDelete(scope.row)"-->
  422. <!-- >移除</el-button>-->
  423. </template>
  424. </el-table-column>
  425. <!-- <el-table-column-->
  426. <!-- class-name="small-padding fixed-width"-->
  427. <!-- v-for="(item,index) in boxDistributionName"-->
  428. <!-- :key="item.index"-->
  429. <!-- :label="item"-->
  430. <!-- :value="item.index"-->
  431. <!-- :prop="item"-->
  432. <!-- >-->
  433. <!-- </el-table-column>-->
  434. </el-table>
  435. <pagination
  436. v-show="total > 0"
  437. :total="total"
  438. :page.sync="queryParams.pageNum"
  439. :limit.sync="queryParams.pageSize"
  440. @pagination="getList"
  441. />
  442. <el-dialog title="配船" :visible.sync="shipAllocation" width="50%">
  443. <el-form :inline="true" :model="ship" class="demo-form-inline">
  444. <el-row>
  445. <el-col :span="12">
  446. <el-form-item label="船名">
  447. <el-select
  448. size="small"
  449. width="240px"
  450. v-model="ship.fVslid"
  451. @change="voyageRemthods"
  452. >
  453. <el-option
  454. v-for="item in vesselOptions"
  455. :key="item.fId"
  456. :label="item.fName"
  457. :value="item.fId"
  458. />
  459. </el-select>
  460. </el-form-item>
  461. </el-col>
  462. <el-col :span="12">
  463. <el-form-item label="航次">
  464. <el-select
  465. v-model="ship.fVoyid"
  466. filterable
  467. remote
  468. size="small"
  469. style="width: 200px"
  470. >
  471. <el-option
  472. v-for="item in voyageOptions"
  473. :key="item.fId"
  474. :label="item.fNo"
  475. :value="item.fId"
  476. />
  477. </el-select>
  478. </el-form-item>
  479. </el-col>
  480. </el-row>
  481. </el-form>
  482. <span slot="footer" class="dialog-footer">
  483. <el-button @click="shipAllocation = false">取 消</el-button>
  484. <el-button type="primary" @click="matchingShip(true)">确 定</el-button>
  485. </span>
  486. </el-dialog>
  487. </div>
  488. </template>
  489. <script>
  490. import {
  491. bookingParty,
  492. selectUserByRole,
  493. listCorps,
  494. getcntrName,
  495. delCorps,
  496. changeCorpsStatus,
  497. exportInventory,
  498. cancelAllocation,
  499. confirmAllocation,
  500. } from "@/api/kaihe/domesticTrade/myOrder";
  501. import Cookies from "js-cookie";
  502. import { addSet, resetModule, select } from "@/api/system/set";
  503. import Vue from "vue";
  504. import draggable from "vuedraggable";
  505. import { getVesselName } from "@/api/finance/applyForInvoice/chargeInvoice";
  506. import { getVoyageName } from "@/api/finance/applyForInvoice/feeDetail";
  507. import { portInquiry } from "@/api/kaihe/domesticTrade/orderInformation";
  508. import { defaultDate } from "@/utils/date";
  509. Vue.directive("dialogDrag", {
  510. bind(el, binding, vnode, oldVnode) {
  511. const dialogHeaderEl = el.querySelector(".el-dialog__header");
  512. const dragDom = el.querySelector(".el-dialog");
  513. const enlarge = el.querySelector(".enlarge");
  514. dialogHeaderEl.style.cursor = "move";
  515. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  516. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  517. if (enlarge) {
  518. enlarge.onclick = (e) => {
  519. dragDom.style.top = "0px";
  520. dragDom.style.left = "0px";
  521. };
  522. }
  523. dialogHeaderEl.onmousedown = (e) => {
  524. // 鼠标按下,计算当前元素距离可视区的距离
  525. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  526. const disY = e.clientY - dialogHeaderEl.offsetTop;
  527. // 获取到的值带px 正则匹配替换
  528. let styL, styT;
  529. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  530. if (sty.left.includes("%")) {
  531. styL =
  532. +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
  533. styT =
  534. +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
  535. } else {
  536. styL = +sty.left.replace(/\px/g, "");
  537. styT = +sty.top.replace(/\px/g, "");
  538. }
  539. document.onmousemove = function (e) {
  540. // 通过事件委托,计算移动的距离
  541. const l = e.clientX - disX;
  542. const t = e.clientY - disY;
  543. // 移动当前元素
  544. if (t + styT >= 0) {
  545. dragDom.style.top = `${t + styT}px`;
  546. }
  547. dragDom.style.left = `${l + styL}px`;
  548. // 将此时的位置传出去
  549. // binding.value({x:e.pageX,y:e.pageY})
  550. };
  551. document.onmouseup = function (e) {
  552. document.onmousemove = null;
  553. document.onmouseup = null;
  554. };
  555. };
  556. },
  557. });
  558. export default {
  559. name: "myOrder",
  560. components: {
  561. draggable,
  562. },
  563. data() {
  564. return {
  565. voyageOptions: [],
  566. vesselOptions: [],
  567. show: false,
  568. activeIndex: "0",
  569. setRowList: [],
  570. getRowList: [],
  571. tableDate: [
  572. {
  573. surface: "1",
  574. label: "fBillno",
  575. name: "订舱号",
  576. checked: 0,
  577. width: 120,
  578. },
  579. {
  580. surface: "2",
  581. label: "fServiceitems",
  582. name: "运输条款",
  583. checked: 0,
  584. width: 120,
  585. },
  586. {
  587. surface: "3",
  588. label: "fConsigneername",
  589. name: "收货人",
  590. checked: 0,
  591. width: 120,
  592. },
  593. {
  594. surface: "4",
  595. label: "fName",
  596. name: "航线",
  597. checked: 0,
  598. width: 120,
  599. },
  600. {
  601. surface: "5",
  602. label: "fNo",
  603. name: "箱型",
  604. checked: 0,
  605. width: 120,
  606. },
  607. {
  608. surface: "6",
  609. label: "fCntrcount",
  610. name: "箱量",
  611. checked: 0,
  612. width: 120,
  613. },
  614. {
  615. surface: "7",
  616. label: "loadCntr",
  617. name: "返箱数",
  618. checked: 0,
  619. width: 120,
  620. },
  621. {
  622. surface: "8",
  623. label: "fBsdate",
  624. name: "装货时间",
  625. checked: 0,
  626. width: 120,
  627. },
  628. {
  629. surface: "9",
  630. label: "fBillstatus",
  631. name: "状态",
  632. checked: 0,
  633. width: 120,
  634. },
  635. {
  636. surface: "10",
  637. label: "vslName",
  638. name: "船名",
  639. checked: 0,
  640. width: 120,
  641. },
  642. {
  643. surface: "11",
  644. label: "voyNo",
  645. name: "航次",
  646. checked: 0,
  647. width: 120,
  648. },
  649. {
  650. surface: "12",
  651. label: "fMblno",
  652. name: "提单号",
  653. checked: 0,
  654. width: 120,
  655. },
  656. {
  657. surface: "13",
  658. label: "corpName",
  659. name: "订舱单位",
  660. checked: 0,
  661. width: 120,
  662. },
  663. {
  664. surface: "14",
  665. label: "goodsName",
  666. name: "货名",
  667. checked: 0,
  668. width: 120,
  669. },
  670. {
  671. surface: "15",
  672. label: "createBy",
  673. name: "订舱人",
  674. checked: 0,
  675. width: 120,
  676. },
  677. {
  678. surface: "16",
  679. label: "createTime",
  680. name: "订舱时间",
  681. checked: 0,
  682. width: 120,
  683. },
  684. {
  685. surface: "17",
  686. label: "loadportName",
  687. name: "起运港",
  688. checked: 0,
  689. width: 120,
  690. },
  691. {
  692. surface: "18",
  693. label: "destportName",
  694. name: "目的港",
  695. checked: 0,
  696. width: 120,
  697. },
  698. {
  699. surface: "19",
  700. label: "moneyStatus",
  701. name: "费用状态",
  702. checked: 0,
  703. width: 120,
  704. },
  705. {
  706. surface: "20",
  707. label: "fCargoPlanning",
  708. name: "配船",
  709. checked: 0,
  710. width: 120,
  711. },
  712. {
  713. surface: "21",
  714. label: "remark",
  715. name: "备注",
  716. checked: 0,
  717. width: 120,
  718. },
  719. ],
  720. //自定义列宽
  721. allCheck: false,
  722. showSetting: false,
  723. shipAllocation: false,
  724. ship: {
  725. fVoyid: "",
  726. fVslid: "",
  727. },
  728. serviceitems: [],
  729. container: [],
  730. // 遮罩层
  731. loading: true,
  732. // 选中数组
  733. ids: [],
  734. selection: [],
  735. // 非单个禁用
  736. single: true,
  737. // 非多个禁用
  738. multiple: true,
  739. // 显示搜索条件
  740. showSearch: true,
  741. // 总条数
  742. total: 0,
  743. // 客户详情表格数据
  744. corpsList: [],
  745. // 查询参数
  746. queryParams: {
  747. pageNum: 1,
  748. pageSize: 10,
  749. cLoadDate: defaultDate(),
  750. },
  751. fMblnoOptions: [],
  752. createBy: [],
  753. fCorpid: [],
  754. };
  755. },
  756. created() {
  757. this.setRowList = this.tableDate;
  758. this.getRowList = this.tableDate;
  759. portInquiry().then((res) => {
  760. this.fMblnoOptions = res.rows;
  761. });
  762. selectUserByRole().then((res) => {
  763. this.createBy = res.rows;
  764. });
  765. bookingParty().then((res) => {
  766. this.fCorpid = res.rows;
  767. });
  768. this.getList();
  769. this.cntrRemoteMethod();
  770. this.vessleRemthod();
  771. this.voyageRemthods();
  772. this.getDicts("f_serviceitems").then((response) => {
  773. if (response.data) {
  774. this.serviceitems = response.data;
  775. }
  776. });
  777. this.getRow();
  778. },
  779. activated() {
  780. this.getList();
  781. // this.queryParams.timeInterval = this.queryParams.timeInterval
  782. // ? this.queryParams.timeInterval
  783. // : defaultDate();
  784. },
  785. methods: {
  786. voyageRemthods() {
  787. getVoyageName({ fPid: this.ship.fVslid }).then((response) => {
  788. this.voyageOptions = response.rows;
  789. if (this.ship.fVslid) this.ship.fVoyid = "";
  790. });
  791. },
  792. //获取船名
  793. vessleRemthod() {
  794. getVesselName().then((response) => {
  795. this.vesselOptions = response.rows;
  796. });
  797. },
  798. handleSelect(key, keyPath) {
  799. if (key === "0") {
  800. this.queryParams = {
  801. pageNum: 1,
  802. pageSize: 10,
  803. };
  804. } else if (key === "1") {
  805. this.queryParams.fBillstatus = 4;
  806. } else if (key === "2") {
  807. this.queryParams.fBillstatus = 6;
  808. } else if (key === "3") {
  809. this.queryParams.fBillstatus = 9;
  810. } else if (key === "4") {
  811. this.queryParams.fBillstatus = 11;
  812. } else if (key === "7") {
  813. this.queryParams.fBillstatus = 12;
  814. } else if (key === "10") {
  815. this.queryParams.fBillstatus = 10;
  816. } else if (key === "12") {
  817. this.queryParams.fBillstatus = 12;
  818. }
  819. listCorps(this.queryParams).then((response) => {
  820. this.corpsList = response.rows;
  821. this.total = response.total;
  822. this.loading = false;
  823. });
  824. },
  825. //重置列表
  826. delRow() {
  827. this.data = {
  828. tableName: "我的订单",
  829. userId: Cookies.get("userName"),
  830. };
  831. resetModule(this.data).then((res) => {
  832. if (res.code == 200) {
  833. this.showSetting = false;
  834. this.setRowList = this.tableDate;
  835. this.getRowList = this.tableDate;
  836. }
  837. });
  838. },
  839. //列设置全选
  840. allChecked() {
  841. if (this.allCheck == true) {
  842. this.setRowList.map((e) => {
  843. return (e.checked = 0);
  844. });
  845. } else {
  846. this.setRowList.map((e) => {
  847. return (e.checked = 1);
  848. });
  849. }
  850. },
  851. //查询列数据
  852. getRow() {
  853. let that = this;
  854. this.data = {
  855. tableName: "我的订单",
  856. userId: Cookies.get("userName"),
  857. };
  858. select(this.data).then((res) => {
  859. if (res.data.length != 0) {
  860. this.getRowList = res.data.filter((e) => e.checked == 0);
  861. this.setRowList = res.data;
  862. this.setRowList = this.setRowList.reduce((res, item) => {
  863. res.push({
  864. surface: item.surface,
  865. label: item.label,
  866. name: item.name,
  867. checked: item.checked,
  868. width: item.width,
  869. fixed: item.fixed,
  870. });
  871. return res;
  872. }, []);
  873. }
  874. });
  875. },
  876. //保存列设置
  877. save() {
  878. this.showSetting = false;
  879. this.data = {
  880. tableName: "我的订单",
  881. userId: Cookies.get("userName"),
  882. sysTableSetList: this.setRowList,
  883. };
  884. addSet(this.data).then((res) => {
  885. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  886. });
  887. },
  888. //开始拖拽事件
  889. onStart() {
  890. this.drag = true;
  891. },
  892. //拖拽结束事件
  893. onEnd() {
  894. this.drag = false;
  895. },
  896. //箱型下拉查询
  897. cntrRemoteMethod() {
  898. let queryParams = { pageNum: 1 };
  899. getcntrName(queryParams).then((response) => {
  900. this.container = response.rows;
  901. });
  902. },
  903. /** 删除按钮操作 */
  904. handleDelete(row) {
  905. const fIds = row.fId || this.ids;
  906. this.$confirm(
  907. '是否确认删除客户详情编号为"' + fIds + '"的数据项?',
  908. "警告",
  909. {
  910. confirmButtonText: "确定",
  911. cancelButtonText: "取消",
  912. type: "warning",
  913. }
  914. )
  915. .then(function () {
  916. return delCorps(fIds);
  917. })
  918. .then(() => {
  919. this.getList();
  920. this.msgSuccess("删除成功");
  921. });
  922. },
  923. //查看跳转
  924. handleUpdate(row, num) {
  925. let res = {};
  926. res = {
  927. fId: row.fId,
  928. num: num,
  929. };
  930. this.$router.push({
  931. path: "/domesticTrade/orderInformation",
  932. query: { data: JSON.stringify(res) },
  933. });
  934. },
  935. //模糊查询地点
  936. addressMethod() {
  937. let queryParams = { pageNum: 1 };
  938. getaddress(queryParams).then((response) => {
  939. this.addressOptions = response.rows;
  940. });
  941. },
  942. /** 查询客户详情列表 */
  943. getList() {
  944. listCorps(this.queryParams).then((response) => {
  945. this.corpsList = response.rows;
  946. this.total = response.total;
  947. this.loading = false;
  948. });
  949. },
  950. // 从表重置
  951. contList() {
  952. this.contactList = [];
  953. },
  954. // 状态修改
  955. handleStatusChange(row) {
  956. let text = row.fStatus === "0" ? "启用" : "停用";
  957. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  958. confirmButtonText: "确定",
  959. cancelButtonText: "取消",
  960. type: "warning",
  961. })
  962. .then(function () {
  963. return changeCorpsStatus(row.fId, row.fStatus);
  964. })
  965. .then(() => {
  966. this.msgSuccess(text + "成功");
  967. })
  968. .catch(function () {
  969. row.fStatus = row.fStatus === "0" ? "1" : "0";
  970. });
  971. },
  972. /** 配船按钮操作 */
  973. matchingShip(type) {
  974. if (type === false) {
  975. this.shipAllocation = true;
  976. this.ship.fVoyid = this.selection[0].fVoyid;
  977. this.ship.fVslid = this.selection[0].fVslid;
  978. // this.ship.fPid = this.selection[0].fVslid
  979. } else {
  980. this.ship.fCargoPlanning = 0;
  981. this.ship.orderId = [];
  982. this.selection.forEach((item) => this.ship.orderId.push(item.fId));
  983. confirmAllocation(this.ship).then((res) => {
  984. console.log(res);
  985. this.shipAllocation = false;
  986. this.getList();
  987. this.$message({
  988. showClose: true,
  989. message: "配船成功",
  990. type: "success",
  991. });
  992. });
  993. }
  994. },
  995. /** 取消配船按钮操作 */
  996. cancelShip() {
  997. let data = [];
  998. this.selection.forEach((item) => data.push(item.fId));
  999. cancelAllocation(data).then((res) => {
  1000. this.$message({
  1001. showClose: true,
  1002. message: "取消配船成功",
  1003. type: "success",
  1004. });
  1005. this.getList();
  1006. });
  1007. },
  1008. /** 导出按钮操作 */
  1009. handleExport() {
  1010. const queryParams = this.queryParams;
  1011. this.$confirm("是否选择船名航次?", "警告", {
  1012. confirmButtonText: "确定",
  1013. cancelButtonText: "取消",
  1014. type: "warning",
  1015. })
  1016. .then(function () {
  1017. return exportInventory(queryParams);
  1018. })
  1019. .then((response) => {
  1020. this.download(response.msg);
  1021. });
  1022. },
  1023. /** 搜索按钮操作 */
  1024. handleQuery() {
  1025. this.queryParams.pageNum = 1;
  1026. this.queryParams.pageSize = 10;
  1027. this.getList();
  1028. },
  1029. /** 重置按钮操作 */
  1030. resetQuery() {
  1031. this.queryParams = {
  1032. fBillno: null,
  1033. fServiceitems: null,
  1034. fConsigneername: null,
  1035. fCntrid: null,
  1036. fCntrcount: null,
  1037. cLoadDate: null,
  1038. fCntrno: null,
  1039. timeInterval: null,
  1040. };
  1041. this.resetForm("queryForm");
  1042. this.handleQuery();
  1043. },
  1044. // 多选框选中数据
  1045. handleSelectionChange(selection) {
  1046. this.selection = selection;
  1047. this.ids = selection.map((item) => item.fId);
  1048. this.single = selection.length !== 1;
  1049. this.multiple = !selection.length;
  1050. },
  1051. getSummaries(param) {
  1052. const { columns, data } = param;
  1053. const sums = [];
  1054. columns.forEach((item, index) => {
  1055. if (index === 0) {
  1056. sums[index] = "合计";
  1057. return;
  1058. }
  1059. if (item.property == "fCntrcount" || item.property == "loadCntr") {
  1060. let num1 = 0;
  1061. let num2 = 0;
  1062. data.forEach((e) => {
  1063. num1+=e.fCntrcount;
  1064. num2+=e.loadCntr;
  1065. });
  1066. if (item.property == "fCntrcount") {
  1067. sums[index] = num1 ? num1: "0";
  1068. }
  1069. if (item.property == "loadCntr") {
  1070. sums[index] = num2 ? num2: "0";
  1071. }
  1072. }
  1073. });
  1074. return sums;
  1075. },
  1076. },
  1077. };
  1078. </script>
  1079. <style lang="scss" scoped>
  1080. .tabSetting {
  1081. display: flex;
  1082. justify-content: flex-end;
  1083. }
  1084. .listStyle {
  1085. display: flex;
  1086. border-top: 1px solid #dcdfe6;
  1087. border-left: 1px solid #dcdfe6;
  1088. border-right: 1px solid #dcdfe6;
  1089. }
  1090. .listStyle:last-child {
  1091. border-bottom: 1px solid #dcdfe6;
  1092. }
  1093. .progress {
  1094. display: flex;
  1095. align-items: center;
  1096. padding: 2px;
  1097. background-color: rgba(0, 0, 0, 0.05);
  1098. height: 100%;
  1099. }
  1100. </style>
  1101. <style lang="scss">
  1102. .el-table {
  1103. .el-table__body-wrapper {
  1104. z-index: 2;
  1105. }
  1106. }
  1107. </style>