index.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467
  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. <el-button
  336. type="primary"
  337. icon="el-icon-search"
  338. size="mini"
  339. @click="transship(true)"
  340. :disabled="selection.length == 0 ? true : false"
  341. >转船</el-button
  342. >
  343. </div>
  344. <div class="tabSetting">
  345. <right-toolbar
  346. :showSearch.sync="showSearch"
  347. @queryTable="getList"
  348. ></right-toolbar>
  349. <div style="margin: 0 12px">
  350. <el-button
  351. icon="el-icon-setting"
  352. size="mini"
  353. circle
  354. @click="showSetting = !showSetting"
  355. ></el-button>
  356. </div>
  357. </div>
  358. </el-row>
  359. <el-dialog
  360. title="提示"
  361. :visible.sync="showSetting"
  362. width="700px"
  363. v-dialogDrag
  364. >
  365. <template slot="title">
  366. <div class="avue-crud__dialog__header">
  367. <span class="el-dialog__title">
  368. <span
  369. style="
  370. display: inline-block;
  371. width: 3px;
  372. height: 20px;
  373. margin-right: 5px;
  374. float: left;
  375. margin-top: 2px;
  376. "
  377. ></span>
  378. </span>
  379. </div>
  380. </template>
  381. <div>配置排序列数据(拖动调整顺序)</div>
  382. <div style="margin-left: 17px">
  383. <el-checkbox
  384. v-model="allCheck"
  385. label="全选"
  386. @change="allChecked"
  387. ></el-checkbox>
  388. </div>
  389. <div style="padding: 4px; display: flex; justify-content: center">
  390. <draggable
  391. v-model="setRowList"
  392. group="site"
  393. animation="300"
  394. @start="onStart"
  395. @end="onEnd"
  396. handle=".indraggable"
  397. >
  398. <transition-group>
  399. <div
  400. v-for="item in setRowList"
  401. :key="item.surface"
  402. class="listStyle"
  403. >
  404. <div style="width: 500px" class="indraggable">
  405. <div class="progress" :style="{ width: item.width + 'px' }">
  406. <el-checkbox
  407. :label="item.name"
  408. v-model="item.checked"
  409. :true-label="0"
  410. :false-label="1"
  411. >{{ item.name }}
  412. </el-checkbox>
  413. </div>
  414. </div>
  415. <el-input-number
  416. v-model.number="item.width"
  417. controls-position="right"
  418. :min="1"
  419. :max="500"
  420. size="mini"
  421. ></el-input-number>
  422. </div>
  423. </transition-group>
  424. </draggable>
  425. </div>
  426. <span slot="footer" class="dialog-footer">
  427. <el-button @click="showSetting = false">取 消</el-button>
  428. <el-button @click="delRow" type="danger">重 置</el-button>
  429. <el-button type="primary" @click="save()">确 定</el-button>
  430. </span>
  431. </el-dialog>
  432. <el-table
  433. v-loading="loading"
  434. :data="corpsList"
  435. show-summary
  436. :summary-method="getSummaries"
  437. @selection-change="handleSelectionChange"
  438. >
  439. <el-table-column type="selection" width="60" align="center" />
  440. <el-table-column label="行号" align="center" type="index" />
  441. <el-table-column
  442. v-for="(item, index) in getRowList"
  443. :key="index"
  444. :label="item.name"
  445. :width="item.width"
  446. :prop="item.label"
  447. align="center"
  448. :fixed="item.fixed"
  449. :show-overflow-tooltip="true"
  450. sortable
  451. >
  452. <template slot-scope="scope">
  453. <span v-if="item.label == 'createTime'">{{
  454. scope.row.createTime.slice(0, 10)
  455. }}</span>
  456. <span v-else-if="item.label == 'fCargoPlanning'">{{
  457. scope.row.fCargoPlanning == "1" ? "否" : "是"
  458. }}</span>
  459. <span v-else-if="item.label == 'fCaregoStatus'">
  460. <p style="color: #67c23a" v-if="scope.row.fCaregoStatus == '放货'">
  461. {{ scope.row.fCaregoStatus }}
  462. </p>
  463. <p
  464. style="color: #f56c6c"
  465. v-else-if="scope.row.fCaregoStatus == '扣货'"
  466. >
  467. {{ scope.row.fCaregoStatus }}
  468. </p>
  469. <p v-else>{{ scope.row.fCaregoStatus }}</p>
  470. </span>
  471. <span v-else-if="item.label == 'fArrivalStatus'">{{
  472. scope.row.fArrivalStatus | transshipName
  473. }}</span>
  474. <span v-else>{{ scope.row[item.label] }}</span>
  475. </template>
  476. </el-table-column>
  477. <!-- <el-table-column label="订舱号" align="center" prop="fBillno"/>-->
  478. <!-- <el-table-column label="运输条款" align="center" prop="fServiceitems" />-->
  479. <!-- <el-table-column label="收货人" align="center" prop="fConsigneername"/>-->
  480. <!-- <el-table-column label="航线" align="center" prop="fName"/>-->
  481. <!-- <el-table-column label="箱型" align="center" prop="fNo"/>-->
  482. <!-- <el-table-column label="箱量" align="center" prop="fCntrcount"/>-->
  483. <!-- <el-table-column label="装货时间" align="center" prop="fBsdate"/>-->
  484. <el-table-column
  485. label="操作"
  486. fixed="right"
  487. align="center"
  488. class-name="small-padding fixed-width"
  489. min-width="160px"
  490. >
  491. <template slot-scope="scope">
  492. <el-button
  493. size="mini"
  494. type="text"
  495. icon="el-icon-edit"
  496. @click="handleUpdate(scope.row, 1)"
  497. v-hasPermi="['warehouse:warehousebills:webVersionOrderDetails']"
  498. >查看
  499. </el-button>
  500. <!-- <el-button-->
  501. <!-- size="mini"-->
  502. <!-- type="text"-->
  503. <!-- icon="el-icon-delete"-->
  504. <!-- @click="handleDelete(scope.row)"-->
  505. <!-- >移除</el-button>-->
  506. </template>
  507. </el-table-column>
  508. <!-- <el-table-column-->
  509. <!-- class-name="small-padding fixed-width"-->
  510. <!-- v-for="(item,index) in boxDistributionName"-->
  511. <!-- :key="item.index"-->
  512. <!-- :label="item"-->
  513. <!-- :value="item.index"-->
  514. <!-- :prop="item"-->
  515. <!-- >-->
  516. <!-- </el-table-column>-->
  517. </el-table>
  518. <pagination
  519. v-show="total > 0"
  520. :total="total"
  521. :page.sync="queryParams.pageNum"
  522. :limit.sync="queryParams.pageSize"
  523. @pagination="getList"
  524. />
  525. <el-dialog title="配船" :visible.sync="shipAllocation" width="50%">
  526. <el-form :inline="true" :model="ship" class="demo-form-inline">
  527. <el-row>
  528. <el-col :span="12">
  529. <el-form-item label="船名">
  530. <el-select
  531. size="small"
  532. width="240px"
  533. v-model="ship.fVslid"
  534. @change="voyageRemthods"
  535. >
  536. <el-option
  537. v-for="item in vesselOptions"
  538. :key="item.fId"
  539. :label="item.fName"
  540. :value="item.fId"
  541. />
  542. </el-select>
  543. </el-form-item>
  544. </el-col>
  545. <el-col :span="12">
  546. <el-form-item label="航次">
  547. <el-select
  548. v-model="ship.fVoyid"
  549. filterable
  550. remote
  551. size="small"
  552. style="width: 200px"
  553. >
  554. <el-option
  555. v-for="item in voyageOptions"
  556. :key="item.fId"
  557. :label="item.fNo"
  558. :value="item.fId"
  559. />
  560. </el-select>
  561. </el-form-item>
  562. </el-col>
  563. </el-row>
  564. </el-form>
  565. <span slot="footer" class="dialog-footer">
  566. <el-button @click="shipAllocation = false">取 消</el-button>
  567. <el-button type="primary" @click="matchingShip(true)">确 定</el-button>
  568. </span>
  569. </el-dialog>
  570. <el-dialog
  571. title="转船"
  572. :visible.sync="transshipVisible"
  573. width="50%"
  574. @closed="transshipClosed"
  575. >
  576. <el-form :inline="true" :model="ship2" class="demo-form-inline">
  577. <el-row>
  578. <el-col :span="12">
  579. <el-form-item label="船名">
  580. <el-select
  581. size="small"
  582. width="240px"
  583. v-model="ship2.fVslid"
  584. @change="voyageRemthods2"
  585. >
  586. <el-option
  587. v-for="item in vesselOptions"
  588. :key="item.fId"
  589. :label="item.fName"
  590. :value="item.fId"
  591. />
  592. </el-select>
  593. </el-form-item>
  594. </el-col>
  595. <el-col :span="12">
  596. <el-form-item label="航次">
  597. <el-select
  598. v-model="ship2.fVoyid"
  599. size="small"
  600. style="width: 200px"
  601. >
  602. <el-option
  603. v-for="item in voyageOptions2"
  604. :key="item.fId"
  605. :label="item.fNo"
  606. :value="item.fId"
  607. />
  608. </el-select>
  609. </el-form-item>
  610. </el-col>
  611. </el-row>
  612. </el-form>
  613. <span slot="footer" class="dialog-footer">
  614. <el-button @click="transshipVisible = false">取 消</el-button>
  615. <el-button type="primary" @click="transship(false)">确 定</el-button>
  616. </span>
  617. </el-dialog>
  618. </div>
  619. </template>
  620. <script>
  621. import {
  622. bookingParty,
  623. selectUserByRole,
  624. listCorps,
  625. getcntrName,
  626. delCorps,
  627. changeCorpsStatus,
  628. exportInventory,
  629. cancelAllocation,
  630. confirmAllocation,
  631. exportItem,
  632. detention,
  633. } from "@/api/kaihe/domesticTrade/myOrder";
  634. import Cookies from "js-cookie";
  635. import { addSet, resetModule, select } from "@/api/system/set";
  636. import Vue from "vue";
  637. import draggable from "vuedraggable";
  638. import {
  639. getVesselName,
  640. transship,
  641. } from "@/api/finance/applyForInvoice/chargeInvoice";
  642. import {
  643. getVoyageName,
  644. getVoyageName2,
  645. } from "@/api/finance/applyForInvoice/feeDetail";
  646. import { portInquiry } from "@/api/kaihe/domesticTrade/orderInformation";
  647. import { defaultDate } from "@/utils/date";
  648. Vue.directive("dialogDrag", {
  649. bind(el, binding, vnode, oldVnode) {
  650. const dialogHeaderEl = el.querySelector(".el-dialog__header");
  651. const dragDom = el.querySelector(".el-dialog");
  652. const enlarge = el.querySelector(".enlarge");
  653. dialogHeaderEl.style.cursor = "move";
  654. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  655. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  656. if (enlarge) {
  657. enlarge.onclick = (e) => {
  658. dragDom.style.top = "0px";
  659. dragDom.style.left = "0px";
  660. };
  661. }
  662. dialogHeaderEl.onmousedown = (e) => {
  663. // 鼠标按下,计算当前元素距离可视区的距离
  664. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  665. const disY = e.clientY - dialogHeaderEl.offsetTop;
  666. // 获取到的值带px 正则匹配替换
  667. let styL, styT;
  668. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  669. if (sty.left.includes("%")) {
  670. styL =
  671. +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
  672. styT =
  673. +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
  674. } else {
  675. styL = +sty.left.replace(/\px/g, "");
  676. styT = +sty.top.replace(/\px/g, "");
  677. }
  678. document.onmousemove = function (e) {
  679. // 通过事件委托,计算移动的距离
  680. const l = e.clientX - disX;
  681. const t = e.clientY - disY;
  682. // 移动当前元素
  683. if (t + styT >= 0) {
  684. dragDom.style.top = `${t + styT}px`;
  685. }
  686. dragDom.style.left = `${l + styL}px`;
  687. // 将此时的位置传出去
  688. // binding.value({x:e.pageX,y:e.pageY})
  689. };
  690. document.onmouseup = function (e) {
  691. document.onmousemove = null;
  692. document.onmouseup = null;
  693. };
  694. };
  695. },
  696. });
  697. export default {
  698. name: "myOrder",
  699. components: {
  700. draggable,
  701. },
  702. data() {
  703. return {
  704. transshipVisible: false,
  705. voyageOptions: [],
  706. voyageOptions2: [],
  707. vesselOptions: [],
  708. show: false,
  709. activeIndex: "0",
  710. setRowList: [],
  711. getRowList: [],
  712. tableDate: [
  713. {
  714. surface: "1",
  715. label: "fBillno",
  716. name: "订舱号",
  717. checked: 0,
  718. width: 120,
  719. },
  720. {
  721. surface: "2",
  722. label: "fServiceitems",
  723. name: "运输条款",
  724. checked: 0,
  725. width: 140,
  726. },
  727. {
  728. surface: "3",
  729. label: "fConsigneername",
  730. name: "收货人",
  731. checked: 0,
  732. width: 120,
  733. },
  734. {
  735. surface: "4",
  736. label: "fName",
  737. name: "航线",
  738. checked: 0,
  739. width: 120,
  740. },
  741. {
  742. surface: "5",
  743. label: "fNo",
  744. name: "箱型",
  745. checked: 0,
  746. width: 120,
  747. },
  748. {
  749. surface: "6",
  750. label: "fCntrcount",
  751. name: "箱量",
  752. checked: 0,
  753. width: 120,
  754. },
  755. {
  756. surface: "7",
  757. label: "loadCntr",
  758. name: "返箱数",
  759. checked: 0,
  760. width: 120,
  761. },
  762. {
  763. surface: "8",
  764. label: "fBsdate",
  765. name: "装货时间",
  766. checked: 0,
  767. width: 120,
  768. },
  769. {
  770. surface: "9",
  771. label: "fAtd",
  772. name: "开船日期",
  773. checked: 0,
  774. width: 120,
  775. },
  776. {
  777. surface: "10",
  778. label: "fBillstatus",
  779. name: "状态",
  780. checked: 0,
  781. width: 120,
  782. },
  783. {
  784. surface: "11",
  785. label: "vslName",
  786. name: "船名",
  787. checked: 0,
  788. width: 120,
  789. },
  790. {
  791. surface: "12",
  792. label: "voyNo",
  793. name: "航次",
  794. checked: 0,
  795. width: 120,
  796. },
  797. {
  798. surface: "13",
  799. label: "fMblno",
  800. name: "提单号",
  801. checked: 0,
  802. width: 120,
  803. },
  804. {
  805. surface: "14",
  806. label: "corpName",
  807. name: "订舱单位",
  808. checked: 0,
  809. width: 120,
  810. },
  811. {
  812. surface: "15",
  813. label: "goodsName",
  814. name: "货名",
  815. checked: 0,
  816. width: 120,
  817. },
  818. {
  819. surface: "16",
  820. label: "createBy",
  821. name: "订舱人",
  822. checked: 0,
  823. width: 120,
  824. },
  825. {
  826. surface: "17",
  827. label: "createTime",
  828. name: "订舱时间",
  829. checked: 0,
  830. width: 120,
  831. },
  832. {
  833. surface: "18",
  834. label: "loadportName",
  835. name: "起运港",
  836. checked: 0,
  837. width: 120,
  838. },
  839. {
  840. surface: "19",
  841. label: "destportName",
  842. name: "目的港",
  843. checked: 0,
  844. width: 120,
  845. },
  846. {
  847. surface: "20",
  848. label: "moneyStatus",
  849. name: "费用状态",
  850. checked: 0,
  851. width: 120,
  852. },
  853. {
  854. surface: "21",
  855. label: "fReceivable",
  856. name: "应收",
  857. checked: 0,
  858. width: 120,
  859. },
  860. {
  861. surface: "22",
  862. label: "fRecycle",
  863. name: "实收",
  864. checked: 0,
  865. width: 120,
  866. },
  867. {
  868. surface: "23",
  869. label: "fDue",
  870. name: "应付",
  871. checked: 0,
  872. width: 120,
  873. },
  874. {
  875. surface: "24",
  876. label: "fPay",
  877. name: "实付",
  878. checked: 0,
  879. width: 120,
  880. },
  881. {
  882. surface: "25",
  883. label: "fCaregoStatus",
  884. name: "货物状态",
  885. checked: 0,
  886. width: 120,
  887. },
  888. {
  889. surface: "26",
  890. label: "fCargoPlanning",
  891. name: "配船",
  892. checked: 0,
  893. width: 120,
  894. },
  895. {
  896. surface: "27",
  897. label: "fArrivalStatus",
  898. name: "离港状态",
  899. checked: 0,
  900. width: 120,
  901. },
  902. {
  903. surface: "28",
  904. label: "fShipTwoName",
  905. name: "二程船名",
  906. checked: 0,
  907. width: 120,
  908. },
  909. {
  910. surface: "29",
  911. label: "fVoyTwoName",
  912. name: "二程航次",
  913. checked: 0,
  914. width: 120,
  915. },
  916. // {
  917. // surface: "30",
  918. // label: "fShipThreeName",
  919. // name: "三程船名",
  920. // checked: 0,
  921. // width: 120,
  922. // },
  923. // {
  924. // surface: "31",
  925. // label: "fVoyThreeName",
  926. // name: "三程航次",
  927. // checked: 0,
  928. // width: 120,
  929. // },
  930. {
  931. surface: "32",
  932. label: "remark",
  933. name: "备注",
  934. checked: 0,
  935. width: 120,
  936. },
  937. ],
  938. //自定义列宽
  939. allCheck: false,
  940. showSetting: false,
  941. shipAllocation: false,
  942. ship: {
  943. fVoyid: "",
  944. fVslid: "",
  945. },
  946. ship2: {
  947. fVoyid: "",
  948. fVslid: "",
  949. },
  950. serviceitems: [],
  951. container: [],
  952. // 遮罩层
  953. loading: true,
  954. // 选中数组
  955. ids: [],
  956. selection: [],
  957. // 非单个禁用
  958. single: true,
  959. // 非多个禁用
  960. multiple: true,
  961. // 显示搜索条件
  962. showSearch: true,
  963. // 总条数
  964. total: 0,
  965. // 客户详情表格数据
  966. corpsList: [],
  967. // 查询参数
  968. queryParams: {
  969. pageNum: 1,
  970. pageSize: 10,
  971. cLoadDate: defaultDate(),
  972. },
  973. fMblnoOptions: [],
  974. createBy: [],
  975. fCorpid: [],
  976. caregoList: [],
  977. };
  978. },
  979. created() {
  980. this.setRowList = this.tableDate;
  981. this.getRowList = this.tableDate;
  982. portInquiry().then((res) => {
  983. this.fMblnoOptions = res.rows;
  984. });
  985. selectUserByRole().then((res) => {
  986. this.createBy = res.rows;
  987. });
  988. bookingParty().then((res) => {
  989. this.fCorpid = res.rows;
  990. });
  991. this.getList();
  992. this.cntrRemoteMethod();
  993. this.vessleRemthod();
  994. this.voyageRemthods();
  995. this.getDicts("f_serviceitems").then((response) => {
  996. if (response.data) {
  997. this.serviceitems = response.data;
  998. }
  999. });
  1000. this.getDicts("carego_status").then((response) => {
  1001. if (response.data) {
  1002. this.caregoList = response.data;
  1003. }
  1004. });
  1005. this.getRow();
  1006. },
  1007. activated() {
  1008. this.getList();
  1009. // this.queryParams.timeInterval = this.queryParams.timeInterval
  1010. // ? this.queryParams.timeInterval
  1011. // : defaultDate();
  1012. },
  1013. filters: {
  1014. transshipName(row) {
  1015. if (row == 0) {
  1016. return "未离港";
  1017. } else if (row == 1) {
  1018. return "离港出运";
  1019. } else if (row == 2) {
  1020. return "到港卸船";
  1021. } else {
  1022. return "-";
  1023. }
  1024. },
  1025. },
  1026. methods: {
  1027. voyageRemthods() {
  1028. getVoyageName({ fPid: this.ship.fVslid }).then((response) => {
  1029. this.voyageOptions = response.rows;
  1030. if (this.ship.fVslid) this.ship.fVoyid = "";
  1031. });
  1032. },
  1033. voyageRemthods2() {
  1034. getVoyageName2({ fPid: this.ship2.fVslid }).then((response) => {
  1035. this.voyageOptions2 = response.data;
  1036. if (this.ship2.fVslid) this.ship2.fVoyid = "";
  1037. });
  1038. },
  1039. transship(Bool) {
  1040. if (Bool) {
  1041. for (let i = 0; i < this.selection.length; i++) {
  1042. if (this.selection[i].fArrivalStatus != 2) {
  1043. return this.$message.error(
  1044. "订舱号:" + this.selection[i].fBillno + "未到港"
  1045. );
  1046. }
  1047. if (this.selection[i].fShipTwoName && this.selection[i].fVoyTwoName) {
  1048. return this.$message.error(
  1049. "订舱号:" + this.selection[i].fBillno + "已转船"
  1050. );
  1051. }
  1052. }
  1053. } else {
  1054. let ids = [];
  1055. this.selection.forEach((e) => {
  1056. ids.push(e.fId);
  1057. });
  1058. transship({
  1059. fVslid: this.ship2.fVslid,
  1060. fVoyid: this.ship2.fVoyid,
  1061. orderList: ids,
  1062. }).then((res) => {
  1063. if (res.code == 200) {
  1064. this.$message.success("转船成功");
  1065. this.getList();
  1066. }
  1067. });
  1068. }
  1069. this.transshipVisible = Bool;
  1070. },
  1071. transshipClosed() {
  1072. this.ship2 = {
  1073. fVoyid: "",
  1074. fVslid: "",
  1075. };
  1076. this.voyageOptions2 = [];
  1077. },
  1078. //获取船名
  1079. vessleRemthod() {
  1080. getVesselName().then((response) => {
  1081. this.vesselOptions = response.rows;
  1082. });
  1083. },
  1084. handleSelect(key, keyPath) {
  1085. if (key === "0") {
  1086. this.queryParams = {
  1087. pageNum: 1,
  1088. pageSize: 10,
  1089. };
  1090. } else if (key === "1") {
  1091. this.queryParams.fBillstatus = 4;
  1092. } else if (key === "2") {
  1093. this.queryParams.fBillstatus = 6;
  1094. } else if (key === "3") {
  1095. this.queryParams.fBillstatus = 9;
  1096. } else if (key === "4") {
  1097. this.queryParams.fBillstatus = 11;
  1098. } else if (key === "7") {
  1099. this.queryParams.fBillstatus = 12;
  1100. } else if (key === "10") {
  1101. this.queryParams.fBillstatus = 10;
  1102. } else if (key === "12") {
  1103. this.queryParams.fBillstatus = 12;
  1104. }
  1105. listCorps(this.queryParams).then((response) => {
  1106. this.corpsList = response.rows;
  1107. this.total = response.total;
  1108. this.loading = false;
  1109. });
  1110. },
  1111. //重置列表
  1112. delRow() {
  1113. this.data = {
  1114. tableName: "我的订单",
  1115. userId: Cookies.get("userName"),
  1116. };
  1117. resetModule(this.data).then((res) => {
  1118. if (res.code == 200) {
  1119. this.showSetting = false;
  1120. this.setRowList = this.tableDate;
  1121. this.getRowList = this.tableDate;
  1122. }
  1123. });
  1124. },
  1125. //列设置全选
  1126. allChecked() {
  1127. if (this.allCheck == true) {
  1128. this.setRowList.map((e) => {
  1129. return (e.checked = 0);
  1130. });
  1131. } else {
  1132. this.setRowList.map((e) => {
  1133. return (e.checked = 1);
  1134. });
  1135. }
  1136. },
  1137. //查询列数据
  1138. getRow() {
  1139. let that = this;
  1140. this.data = {
  1141. tableName: "我的订单",
  1142. userId: Cookies.get("userName"),
  1143. };
  1144. select(this.data).then((res) => {
  1145. if (res.data.length != 0) {
  1146. this.getRowList = res.data.filter((e) => e.checked == 0);
  1147. this.setRowList = res.data;
  1148. this.setRowList = this.setRowList.reduce((res, item) => {
  1149. res.push({
  1150. surface: item.surface,
  1151. label: item.label,
  1152. name: item.name,
  1153. checked: item.checked,
  1154. width: item.width,
  1155. fixed: item.fixed,
  1156. });
  1157. return res;
  1158. }, []);
  1159. }
  1160. });
  1161. },
  1162. //保存列设置
  1163. save() {
  1164. this.showSetting = false;
  1165. this.data = {
  1166. tableName: "我的订单",
  1167. userId: Cookies.get("userName"),
  1168. sysTableSetList: this.setRowList,
  1169. };
  1170. addSet(this.data).then((res) => {
  1171. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1172. });
  1173. },
  1174. //开始拖拽事件
  1175. onStart() {
  1176. this.drag = true;
  1177. },
  1178. //拖拽结束事件
  1179. onEnd() {
  1180. this.drag = false;
  1181. },
  1182. inDetention(type) {
  1183. let ids = [];
  1184. this.selection.forEach((e) => {
  1185. ids.push(e.fId);
  1186. });
  1187. detention({ fCaregoStatus: type, orderList: ids }).then((res) => {
  1188. if (res.code == 200) {
  1189. this.getList();
  1190. if (type == 3) {
  1191. this.$message.success("扣货成功");
  1192. } else {
  1193. this.$message.success("取消扣货成功");
  1194. }
  1195. }
  1196. });
  1197. },
  1198. //箱型下拉查询
  1199. cntrRemoteMethod() {
  1200. let queryParams = { pageNum: 1 };
  1201. getcntrName(queryParams).then((response) => {
  1202. this.container = response.rows;
  1203. });
  1204. },
  1205. vslidChange() {
  1206. getVoyageName({ fPid: this.queryParams.fVslid }).then((response) => {
  1207. this.voyageOptions = response.rows;
  1208. if (this.queryParams.fVoyid) {
  1209. this.queryParams.fVoyid = "";
  1210. }
  1211. });
  1212. },
  1213. /** 删除按钮操作 */
  1214. handleDelete(row) {
  1215. const fIds = row.fId || this.ids;
  1216. this.$confirm(
  1217. '是否确认删除客户详情编号为"' + fIds + '"的数据项?',
  1218. "警告",
  1219. {
  1220. confirmButtonText: "确定",
  1221. cancelButtonText: "取消",
  1222. type: "warning",
  1223. }
  1224. )
  1225. .then(function () {
  1226. return delCorps(fIds);
  1227. })
  1228. .then(() => {
  1229. this.getList();
  1230. this.msgSuccess("删除成功");
  1231. });
  1232. },
  1233. //查看跳转
  1234. handleUpdate(row, num) {
  1235. let res = {};
  1236. res = {
  1237. fId: row.fId,
  1238. num: num,
  1239. };
  1240. this.$router.push({
  1241. path: "/domesticTrade/orderInformation",
  1242. query: { data: JSON.stringify(res) },
  1243. });
  1244. },
  1245. //模糊查询地点
  1246. addressMethod() {
  1247. let queryParams = { pageNum: 1 };
  1248. getaddress(queryParams).then((response) => {
  1249. this.addressOptions = response.rows;
  1250. });
  1251. },
  1252. /** 查询客户详情列表 */
  1253. getList() {
  1254. listCorps(this.queryParams).then((response) => {
  1255. if (response.rows) {
  1256. response.rows.forEach((e) => {
  1257. e.fServiceitems = e.fServiceitems + "-" + e.fDestportMode;
  1258. if (e.fAtd) {
  1259. e.fAtd = e.fAtd.slice(0, 10);
  1260. }
  1261. });
  1262. }
  1263. this.corpsList = response.rows;
  1264. this.total = response.total;
  1265. this.loading = false;
  1266. });
  1267. },
  1268. // 从表重置
  1269. contList() {
  1270. this.contactList = [];
  1271. },
  1272. // 状态修改
  1273. handleStatusChange(row) {
  1274. let text = row.fStatus === "0" ? "启用" : "停用";
  1275. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  1276. confirmButtonText: "确定",
  1277. cancelButtonText: "取消",
  1278. type: "warning",
  1279. })
  1280. .then(function () {
  1281. return changeCorpsStatus(row.fId, row.fStatus);
  1282. })
  1283. .then(() => {
  1284. this.msgSuccess(text + "成功");
  1285. })
  1286. .catch(function () {
  1287. row.fStatus = row.fStatus === "0" ? "1" : "0";
  1288. });
  1289. },
  1290. /** 配船按钮操作 */
  1291. matchingShip(type) {
  1292. if (type === false) {
  1293. this.shipAllocation = true;
  1294. this.ship.fVoyid = this.selection[0].fVoyid;
  1295. this.ship.fVslid = this.selection[0].fVslid;
  1296. // this.ship.fPid = this.selection[0].fVslid
  1297. } else {
  1298. this.ship.fCargoPlanning = 0;
  1299. this.ship.orderId = [];
  1300. this.selection.forEach((item) => this.ship.orderId.push(item.fId));
  1301. confirmAllocation(this.ship).then((res) => {
  1302. console.log(res);
  1303. this.shipAllocation = false;
  1304. this.getList();
  1305. this.$message({
  1306. showClose: true,
  1307. message: "配船成功",
  1308. type: "success",
  1309. });
  1310. });
  1311. }
  1312. },
  1313. /** 取消配船按钮操作 */
  1314. cancelShip() {
  1315. let data = [];
  1316. this.selection.forEach((item) => data.push(item.fId));
  1317. cancelAllocation(data).then((res) => {
  1318. this.$message({
  1319. showClose: true,
  1320. message: "取消配船成功",
  1321. type: "success",
  1322. });
  1323. this.getList();
  1324. });
  1325. },
  1326. /** 导出按钮操作 */
  1327. handleExport() {
  1328. // exportInventory(this.queryParams).then((response) => {
  1329. // this.download(response.msg);
  1330. // });
  1331. const queryParams = this.queryParams;
  1332. this.$confirm("是否选择船名航次?", "警告", {
  1333. confirmButtonText: "确定",
  1334. cancelButtonText: "取消",
  1335. type: "warning",
  1336. })
  1337. .then(function () {
  1338. return exportInventory(queryParams);
  1339. })
  1340. .then((response) => {
  1341. this.download(response.msg);
  1342. });
  1343. },
  1344. handleExportItem() {
  1345. exportItem(this.queryParams).then((response) => {
  1346. this.download(response.msg);
  1347. });
  1348. // const queryParams = this.queryParams;
  1349. // this.$confirm("是否选择船名航次?", "警告", {
  1350. // confirmButtonText: "确定",
  1351. // cancelButtonText: "取消",
  1352. // type: "warning",
  1353. // })
  1354. // .then(function () {
  1355. // return exportItem(queryParams);
  1356. // })
  1357. // .then((response) => {
  1358. // this.download(response.msg);
  1359. // });
  1360. },
  1361. /** 搜索按钮操作 */
  1362. handleQuery() {
  1363. this.queryParams.pageNum = 1;
  1364. this.queryParams.pageSize = 10;
  1365. this.getList();
  1366. },
  1367. /** 重置按钮操作 */
  1368. resetQuery() {
  1369. this.queryParams = {
  1370. fBillno: null,
  1371. fServiceitems: null,
  1372. fConsigneername: null,
  1373. fCntrid: null,
  1374. fCntrcount: null,
  1375. cLoadDate: null,
  1376. fCntrno: null,
  1377. timeInterval: null,
  1378. };
  1379. this.resetForm("queryForm");
  1380. this.handleQuery();
  1381. getVoyageName({ fPid: this.queryParams.fVslid }).then((response) => {
  1382. this.voyageOptions = response.rows;
  1383. if (this.queryParams.fVoyid) {
  1384. this.queryParams.fVoyid = "";
  1385. }
  1386. });
  1387. },
  1388. // 多选框选中数据
  1389. handleSelectionChange(selection) {
  1390. this.selection = selection;
  1391. this.ids = selection.map((item) => item.fId);
  1392. this.single = selection.length !== 1;
  1393. this.multiple = !selection.length;
  1394. },
  1395. getSummaries(param) {
  1396. const { columns, data } = param;
  1397. const sums = [];
  1398. columns.forEach((item, index) => {
  1399. if (index === 0) {
  1400. sums[index] = "合计";
  1401. return;
  1402. }
  1403. if (item.property == "fCntrcount" || item.property == "loadCntr") {
  1404. let num1 = 0;
  1405. let num2 = 0;
  1406. data.forEach((e) => {
  1407. num1 += e.fCntrcount;
  1408. num2 += e.loadCntr;
  1409. });
  1410. if (item.property == "fCntrcount") {
  1411. sums[index] = num1 ? num1 : "0";
  1412. }
  1413. if (item.property == "loadCntr") {
  1414. sums[index] = num2 ? num2 : "0";
  1415. }
  1416. }
  1417. });
  1418. return sums;
  1419. },
  1420. },
  1421. };
  1422. </script>
  1423. <style lang="scss" scoped>
  1424. .tabSetting {
  1425. display: flex;
  1426. justify-content: flex-end;
  1427. }
  1428. .listStyle {
  1429. display: flex;
  1430. border-top: 1px solid #dcdfe6;
  1431. border-left: 1px solid #dcdfe6;
  1432. border-right: 1px solid #dcdfe6;
  1433. }
  1434. .listStyle:last-child {
  1435. border-bottom: 1px solid #dcdfe6;
  1436. }
  1437. .progress {
  1438. display: flex;
  1439. align-items: center;
  1440. padding: 2px;
  1441. background-color: rgba(0, 0, 0, 0.05);
  1442. height: 100%;
  1443. }
  1444. </style>
  1445. <style lang="scss">
  1446. .el-table {
  1447. .el-table__body-wrapper {
  1448. z-index: 2;
  1449. }
  1450. }
  1451. </style>