index.vue 36 KB

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