index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-row>
  5. <el-form-item label="编号" prop="fNo">
  6. <el-input
  7. v-model="queryParams.fNo"
  8. style="width:200px"
  9. placeholder="请输入编号"
  10. clearable
  11. size="small"
  12. />
  13. </el-form-item>
  14. <el-form-item label="名称" prop="fName">
  15. <el-input
  16. v-model="queryParams.fName"
  17. style="width:200px"
  18. placeholder="请输入编号"
  19. clearable
  20. size="small"
  21. />
  22. </el-form-item>
  23. <el-form-item label="状态" prop="fStatus">
  24. <el-select
  25. v-model="queryParams.fStatus"
  26. style="width: 200px"
  27. placeholder="请选择状态"
  28. clearable
  29. size="small"
  30. @keyup.enter.native="handleQuery"
  31. >
  32. <el-option label="正常" value="T"/>
  33. <el-option label="停用" value="F"/>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="录入区间" prop="cLoadDate">
  37. <el-date-picker
  38. v-model="queryParams.cLoadDate"
  39. type="daterange"
  40. value-format="yyyy-MM-dd"
  41. range-separator="至"
  42. start-placeholder="开始日期"
  43. end-placeholder="结束日期"
  44. style="width: 250px"
  45. >
  46. </el-date-picker>
  47. </el-form-item>
  48. </el-row>
  49. <div v-show="queryParamsHidden">
  50. <el-row>
  51. <el-form-item label="录入人" prop="createBy">
  52. <el-input
  53. v-model="queryParams.createBy"
  54. style="width: 200px"
  55. placeholder="请输入录入人"
  56. clearable
  57. size="small"
  58. @keyup.enter.native="handleQuery"
  59. />
  60. </el-form-item>
  61. <el-form-item label="国家代码" prop="fNationality">
  62. <el-input
  63. v-model="queryParams.fNationality"
  64. style="width: 200px"
  65. placeholder="请输入录入人"
  66. clearable
  67. size="small"
  68. @keyup.enter.native="handleQuery"
  69. />
  70. </el-form-item>
  71. <el-form-item label="船舶呼号" prop="fImo">
  72. <el-input
  73. v-model="queryParams.fImo"
  74. style="width: 200px"
  75. placeholder="请输入录入人"
  76. clearable
  77. size="small"
  78. @keyup.enter.native="handleQuery"
  79. />
  80. </el-form-item>
  81. <el-form-item label="备注" prop="remark">
  82. <el-input
  83. v-model="queryParams.remark"
  84. type="textarea"
  85. style="width: 200px"
  86. clearable
  87. size="small"
  88. />
  89. </el-form-item>
  90. </el-row>
  91. </div>
  92. </el-form>
  93. <el-row :gutter="10" class="mb8">
  94. <el-col :span="1.5">
  95. <el-button
  96. type="success"
  97. icon="el-icon-plus"
  98. size="mini"
  99. @click="handleAdd"
  100. v-hasPermi="['shipping:vessel:add']"
  101. >新增</el-button>
  102. </el-col>
  103. <el-col :span="1.5">
  104. <el-button
  105. type="warning"
  106. icon="el-icon-edit"
  107. size="mini"
  108. :disabled="single"
  109. @click="handleUpdate"
  110. v-hasPermi="['shipping:vessel:edit']"
  111. >修改</el-button>
  112. </el-col>
  113. <el-col :span="1.5">
  114. <el-button
  115. type="danger"
  116. icon="el-icon-delete"
  117. size="mini"
  118. :disabled="multiple"
  119. @click="handleDelete"
  120. v-hasPermi="['shipping:vessel:remove']"
  121. >删除</el-button>
  122. </el-col>
  123. <el-col :span="1.5">
  124. <el-button
  125. type="primary"
  126. icon="el-icon-download"
  127. size="mini"
  128. @click="handleExport"
  129. v-hasPermi="['shipping:vessel:import']"
  130. >导入</el-button>
  131. </el-col>
  132. <el-col :span="1.5">
  133. <el-button
  134. type="primary"
  135. icon="el-icon-download"
  136. size="mini"
  137. @click="handleExport"
  138. v-hasPermi="['shipping:vessel:export']"
  139. >导出</el-button>
  140. </el-col>
  141. <el-col :span="1.5">
  142. <el-button
  143. type="info"
  144. icon="el-icon-download"
  145. size="mini"
  146. @click="handleExport"
  147. v-hasPermi="['basicdata:vessel:list']"
  148. >取消</el-button>
  149. </el-col>
  150. <el-col style="position: absolute;left:70%" :span="5" >
  151. <el-button size="small" @click="queryParamsHidden ? (queryParamsHidden = false) : (queryParamsHidden = true)">{{ queryParamsHidden ? '隐藏' : '更多' }}</el-button>
  152. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  153. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  154. </el-col>
  155. <div class="tabSetting">
  156. <right-toolbar
  157. :showSearch.sync="showSearch"
  158. @queryTable="getList"
  159. ></right-toolbar>
  160. <div style="margin: 0 12px">
  161. <el-button
  162. icon="el-icon-setting"
  163. size="mini"
  164. circle
  165. @click="showSetting = !showSetting"
  166. ></el-button>
  167. </div>
  168. </div>
  169. </el-row>
  170. <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag>
  171. <template slot="title">
  172. <div class="avue-crud__dialog__header">
  173. <span class="el-dialog__title">
  174. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  175. </span>
  176. </div>
  177. </template>
  178. <div>配置排序列数据(拖动调整顺序)</div>
  179. <div style="margin-left: 17px">
  180. <el-checkbox
  181. v-model="allCheck"
  182. label="全选"
  183. @change="allChecked"
  184. ></el-checkbox>
  185. </div>
  186. <div style="padding: 4px; display: flex; justify-content: center">
  187. <draggable
  188. v-model="setRowList"
  189. group="site"
  190. animation="300"
  191. @start="onStart"
  192. @end="onEnd"
  193. handle=".indraggable"
  194. >
  195. <transition-group>
  196. <div
  197. v-for="item in setRowList"
  198. :key="item.surface"
  199. class="listStyle"
  200. >
  201. <div style="width: 500px" class="indraggable">
  202. <div class="progress" :style="{ width: item.width + 'px' }">
  203. <el-checkbox
  204. :label="item.name"
  205. v-model="item.checked"
  206. :true-label="0"
  207. :false-label="1"
  208. >{{ item.name }}
  209. </el-checkbox>
  210. </div>
  211. </div>
  212. <el-input-number
  213. v-model.number="item.width"
  214. controls-position="right"
  215. :min="1"
  216. :max="500"
  217. size="mini"
  218. ></el-input-number>
  219. </div>
  220. </transition-group>
  221. </draggable>
  222. </div>
  223. <span slot="footer" class="dialog-footer">
  224. <el-button @click="showSetting = false">取 消</el-button>
  225. <el-button @click="delRow" type="danger">重 置</el-button>
  226. <el-button type="primary" @click="save()">确 定</el-button>
  227. </span>
  228. </el-dialog>
  229. <el-table v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">
  230. <el-table-column type="selection" width="55" align="center" />
  231. <el-table-column type="index" width="55" label="行号" align="center" fixed="left"/>
  232. <el-table-column
  233. v-for="(item, index) in getRowList"
  234. :key="index"
  235. :label="item.name"
  236. :width="item.width"
  237. :prop="item.label"
  238. align="center"
  239. :fixed="item.fixed"
  240. :show-overflow-tooltip="true"
  241. sortable
  242. >
  243. <template slot-scope="scope">
  244. <span v-if="item.label == 'fNo'">{{scope.row.fNo}}</span>
  245. <span v-if="item.label == 'fName'">{{scope.row.fName}}</span>
  246. <span v-if="item.label == 'fEname'">{{scope.row.fEname}}</span>
  247. <span v-if="item.label == 'fNationality'">{{scope.row.fNationality}}</span>
  248. <span v-if="item.label == 'fImo'">{{scope.row.fImo}}</span>
  249. <span v-if="item.label == 'fStatus'">{{scope.row.fStatus}}</span>
  250. <span v-if="item.label == 'remark'">{{scope.row.remark}}</span>
  251. <span v-if="item.label == 'createBy'">{{scope.row.createBy}}</span>
  252. <span v-if="item.label == 'createTime'">{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
  253. <span v-if="item.label == 'updateBy'">{{scope.row.updateBy}}</span>
  254. <span v-if="item.label == 'updateTime'">{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
  255. </template>
  256. </el-table-column>
  257. <!-- <el-table-column label="编号" align="center" prop="fNo" width="100px"/>-->
  258. <!-- <el-table-column :show-overflow-tooltip="true" label="名称" align="center" prop="fName" width="100px"/>-->
  259. <!-- <el-table-column :show-overflow-tooltip="true" label="英文全称" align="center" width="100px" prop="fEname" />-->
  260. <!-- <el-table-column :show-overflow-tooltip="true" label="国家代码" align="center" prop="fNationality" />-->
  261. <!-- <el-table-column :show-overflow-tooltip="true" label="船舶呼号" align="center" prop="fImo" />-->
  262. <!-- <el-table-column :show-overflow-tooltip="true" label="状态" align="center" prop="fStatus" />-->
  263. <!-- <el-table-column :show-overflow-tooltip="true" label="备注" align="center" prop="remark" />-->
  264. <!-- <el-table-column label="录入人" align="center" prop="createBy" />-->
  265. <!-- <el-table-column label="录入时间" align="center" prop="createTime" width="100">-->
  266. <!-- <template slot-scope="scope">-->
  267. <!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
  268. <!-- </template>-->
  269. <!-- </el-table-column>-->
  270. <!-- <el-table-column label="最新修改人" align="center" prop="updateBy" width="100px"/>-->
  271. <!-- <el-table-column label="最新修改时间" align="center" prop="updateTime" width="100px">-->
  272. <!-- <template slot-scope="scope">-->
  273. <!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>-->
  274. <!-- </template>-->
  275. <!-- </el-table-column>-->
  276. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="120px">
  277. <template slot-scope="scope">
  278. <el-button
  279. size="mini"
  280. type="text"
  281. icon="el-icon-edit"
  282. v-hasPermi="['shipping:vessel:edit']"
  283. @click="handleUpdate(scope.row)"
  284. >查看</el-button>
  285. <el-button
  286. size="mini"
  287. type="text"
  288. icon="el-icon-delete"
  289. v-hasPermi="['shipping:vessel:remove']"
  290. @click="handleDelete(scope.row)"
  291. >移除</el-button>
  292. </template>
  293. </el-table-column>
  294. </el-table>
  295. <pagination
  296. v-show="total>0"
  297. :total="total"
  298. :page.sync="queryParams.pageNum"
  299. :limit.sync="queryParams.pageSize"
  300. @pagination="getList"
  301. />
  302. <!-- 添加或修改客户详情对话框 -->
  303. <el-dialog
  304. v-dialogDrag
  305. :fullscreen="dialogFull"
  306. :title="title"
  307. :visible.sync="open"
  308. close-on-click-modal="false"
  309. width="60%"
  310. :close-on-click-modal="false"
  311. append-to-body>
  312. <template slot="title">
  313. <div class="avue-crud__dialog__header">
  314. <span class="el-dialog__title">
  315. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  316. </span>
  317. <div class="avue-crud__dialog__menu enlarge" @click="full">
  318. <i style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
  319. </div>
  320. </div>
  321. </template>
  322. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  323. <el-row>
  324. <el-col :span="12">
  325. <el-form-item label="编号" prop="fNo">
  326. <el-input
  327. v-model="form.fNo"
  328. style="width: 80%"
  329. placeholder="请输入编号"
  330. :disabled="doNot"
  331. />
  332. </el-form-item>
  333. </el-col>
  334. <el-col :span="12">
  335. <el-form-item label="全称" prop="fName">
  336. <el-input
  337. v-model="form.fName"
  338. style="width: 80%"
  339. placeholder="请输入全称"
  340. :disabled="doNot"/>
  341. </el-form-item>
  342. </el-col>
  343. </el-row>
  344. <el-row>
  345. <el-col :span="12">
  346. <el-form-item label="英文名" prop="fEname">
  347. <el-input v-model="form.fEname" style="width: 80%" placeholder="请输入英文名" :disabled="doNot"/>
  348. </el-form-item>
  349. </el-col>
  350. <el-col :span="12">
  351. <el-form-item label="国家代码" prop="fNationality">
  352. <el-input
  353. v-model="form.fNationality"
  354. style="width: 80%"
  355. placeholder="请输入全称"
  356. :disabled="doNot"/>
  357. </el-form-item>
  358. </el-col>
  359. </el-row>
  360. <el-row>
  361. <el-col :span="12">
  362. <el-form-item label="船舶呼号" prop="fImo">
  363. <el-input
  364. v-model="form.fImo"
  365. style="width: 80%"
  366. placeholder="请输入全称"
  367. :disabled="doNot"/>
  368. </el-form-item>
  369. </el-col>
  370. <el-col :span="12">
  371. <el-form-item label="状态" prop="fStatus">
  372. <el-select v-model="form.fStatus" style="width: 80%" placeholder="请输入英文名称" :disabled="doNot">
  373. <el-option label="正常" value="T"/>
  374. <el-option label="停用" value="F"/>
  375. </el-select>
  376. </el-form-item>
  377. </el-col>
  378. </el-row>
  379. <el-row>
  380. <el-col :span="24">
  381. <el-form-item label="备注" prop="remark">
  382. <el-input
  383. v-model="form.remark"
  384. style="width: 100%"
  385. placeholder=""
  386. :disabled="doNot"
  387. type="textarea"
  388. :autosize="{ minRows: 2}"
  389. />
  390. </el-form-item>
  391. </el-col>
  392. </el-row>
  393. </el-form>
  394. <div slot="footer" class="dialog-footer">
  395. <el-button type="info" round @click="doNot = false">修 改</el-button>
  396. <el-button type="success" round @click="submitForm" :disabled="doNot">保 存</el-button>
  397. <el-button @click="cancel" round>关 闭</el-button>
  398. </div>
  399. </el-dialog>
  400. </div>
  401. </template>
  402. <script>
  403. import { getyard,listCorps, getCorps, delCorps, addyard,getyardNo, getyardName, changeCorpsStatus,exportCorps } from "@/api/kaihe/shipDynamics/vesselList";
  404. import Vue from 'vue'
  405. import draggable from "vuedraggable";
  406. import { getportinformation } from '@/api/kaihe/basicdata/portinformation'
  407. import Cookies from 'js-cookie'
  408. import { addSet, resetModule, select } from '@/api/system/set'
  409. Vue.directive('dialogDrag', {
  410. bind(el, binding, vnode, oldVnode) {
  411. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  412. const dragDom = el.querySelector('.el-dialog')
  413. const enlarge = el.querySelector('.enlarge')
  414. dialogHeaderEl.style.cursor = 'move'
  415. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  416. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  417. if(enlarge){
  418. enlarge.onclick = (e) => {
  419. dragDom.style.top = '0px'
  420. dragDom.style.left = '0px'
  421. }
  422. }
  423. dialogHeaderEl.onmousedown = (e) => {
  424. // 鼠标按下,计算当前元素距离可视区的距离
  425. const disX = e.clientX - dialogHeaderEl.offsetLeft
  426. const disY = e.clientY - dialogHeaderEl.offsetTop
  427. // 获取到的值带px 正则匹配替换
  428. let styL, styT
  429. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  430. if (sty.left.includes('%')) {
  431. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  432. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  433. } else {
  434. styL = +sty.left.replace(/\px/g, '')
  435. styT = +sty.top.replace(/\px/g, '')
  436. }
  437. document.onmousemove = function(e) {
  438. // 通过事件委托,计算移动的距离
  439. const l = e.clientX - disX
  440. const t = e.clientY - disY
  441. // 移动当前元素
  442. if ((t + styT) >= 0){
  443. dragDom.style.top = `${t + styT}px`
  444. }
  445. dragDom.style.left = `${l + styL}px`
  446. // 将此时的位置传出去
  447. // binding.value({x:e.pageX,y:e.pageY})
  448. }
  449. document.onmouseup = function(e) {
  450. document.onmousemove = null
  451. document.onmouseup = null
  452. }
  453. }
  454. }
  455. })
  456. export default {
  457. name: "vessel",
  458. components: {
  459. draggable
  460. },
  461. data() {
  462. return {
  463. setRowList: [],
  464. getRowList: [],
  465. tableDate: [
  466. {
  467. surface: "1",
  468. label: "fNo",
  469. name: "编号",
  470. fixed:"left",
  471. checked: 0,
  472. width: 120,
  473. },
  474. {
  475. surface: "2",
  476. label: "fName",
  477. name: "名称",
  478. fixed:"left",
  479. checked: 0,
  480. width: 120,
  481. },
  482. {
  483. surface: "3",
  484. label: "fEname",
  485. name: "英文全称",
  486. fixed:"left",
  487. checked: 0,
  488. width: 120,
  489. },
  490. {
  491. surface: "4",
  492. label: "fNationality",
  493. name: "国家代码",
  494. fixed:"left",
  495. checked: 0,
  496. width: 120,
  497. },
  498. {
  499. surface: "5",
  500. label: "fImo",
  501. name: "船舶呼号",
  502. fixed:"left",
  503. checked: 0,
  504. width: 120,
  505. },
  506. {
  507. surface: "6",
  508. label: "fStatus",
  509. name: "状态",
  510. fixed:"left",
  511. checked: 0,
  512. width: 120,
  513. },
  514. {
  515. surface: "7",
  516. label: "remark",
  517. name: "备注",
  518. checked: 0,
  519. width: 120,
  520. },
  521. {
  522. surface: "8",
  523. label: "createBy",
  524. name: "录入人",
  525. checked: 0,
  526. width: 120,
  527. },
  528. {
  529. surface: "9",
  530. label: "createTime",
  531. name: "录入时间",
  532. checked: 0,
  533. width: 120,
  534. },
  535. {
  536. surface: "10",
  537. label: "updateBy",
  538. name: "最新修改人",
  539. checked: 0,
  540. width: 120,
  541. },
  542. {
  543. surface: "11",
  544. label: "updateTime",
  545. name: "最新修改时间",
  546. checked: 0,
  547. width: 120,
  548. },
  549. ],
  550. //自定义列宽
  551. allCheck: false,
  552. showSetting:false,
  553. //默认显示第一行
  554. queryParamsHidden:false,
  555. //查看置灰
  556. doNot:true,
  557. //模糊查询港口名称
  558. portNameOptions:[],
  559. //港口类型字典表
  560. fTypesOptions:[],
  561. //模糊查询堆场名称
  562. yardOptions:[],
  563. //全屏放大
  564. dialogFull:false,
  565. // 遮罩层
  566. loading: true,
  567. // 选中数组
  568. ids: [],
  569. // 非单个禁用
  570. single: true,
  571. // 非多个禁用
  572. multiple: true,
  573. // 显示搜索条件
  574. showSearch: true,
  575. // 总条数
  576. total: 0,
  577. // 客户详情表格数据
  578. corpsList: [],
  579. // 弹出层标题
  580. title: "",
  581. // 状态数据字典
  582. statusOptions: [],
  583. // 是否显示弹出层
  584. open: false,
  585. // 查询参数
  586. queryParams: {
  587. pageNum: 1,
  588. pageSize: 10,
  589. fNo:null,
  590. fName:null,
  591. fStatus:null,
  592. cLoadDate:null,
  593. createBy:null,
  594. fNationality:null,
  595. fImo:null,
  596. remark:null
  597. },
  598. // 表单参数
  599. form: {
  600. fNo:null,
  601. fName:null,
  602. fEname:null,
  603. fNationality:null,
  604. fImo:null,
  605. fStatus:'T',
  606. remark:null
  607. },
  608. // 表单校验
  609. rules: {
  610. fImo: [
  611. { required: true, message: "客户类别不能为空", trigger: "blur" }
  612. ],
  613. fNo: [
  614. { required: true, message: "编号不能为空", trigger: "blur" }
  615. ],
  616. fName: [
  617. { required: true, message: "名称不能为空", trigger: "blur" }
  618. ],
  619. fEname: [{ required: true, message: "英文名不能为空", trigger: "blur" },
  620. { validator: function(rule, value, callback) {
  621. // 校验英文的正则
  622. if (/[a-zA-z]$/.test(value) == false) {
  623. callback(new Error("请输入英文字母"));
  624. } else {
  625. //校验通过
  626. callback();
  627. }
  628. },
  629. trigger: "blur"
  630. }
  631. ],
  632. fCname:[
  633. { required: true, message: "简称不能为空", trigger: "blur" }
  634. ],
  635. }
  636. };
  637. },
  638. created() {
  639. this.setRowList = this.tableDate;
  640. this.getRowList = this.tableDate;
  641. this.getList();
  642. this.getDicts("f_types").then(response => {
  643. this.fTypesOptions = response.data;
  644. });
  645. this.portRemoteMethod()
  646. this.getRow()
  647. },
  648. methods: {
  649. //重置列表
  650. delRow() {
  651. this.data = {
  652. tableName: "船舶信息",
  653. userId: Cookies.get("userName"),
  654. };
  655. resetModule(this.data).then((res) => {
  656. if (res.code == 200) {
  657. this.showSetting = false;
  658. this.setRowList = this.tableDate;
  659. console.log(this.setRowList)
  660. this.getRowList = this.tableDate;
  661. }
  662. });
  663. },
  664. //列设置全选
  665. allChecked() {
  666. if (this.allCheck == true) {
  667. this.setRowList.map((e) => {
  668. return (e.checked = 0);
  669. });
  670. } else {
  671. this.setRowList.map((e) => {
  672. return (e.checked = 1);
  673. });
  674. }
  675. },
  676. //查询列数据
  677. getRow() {
  678. let that = this;
  679. this.data = {
  680. tableName: "船舶信息",
  681. userId: Cookies.get("userName"),
  682. };
  683. select(this.data).then((res) => {
  684. if (res.data.length != 0) {
  685. this.getRowList = res.data.filter((e) => e.checked == 0);
  686. this.setRowList = res.data;
  687. this.setRowList = this.setRowList.reduce((res, item) => {
  688. res.push({
  689. surface: item.surface,
  690. label: item.label,
  691. name: item.name,
  692. checked: item.checked,
  693. width: item.width,
  694. fixed: item.fixed
  695. });
  696. return res;
  697. }, []);
  698. }
  699. });
  700. console.log(this.getRowList)
  701. },
  702. //保存列设置
  703. save() {
  704. this.showSetting = false;
  705. this.data = {
  706. tableName: "船舶信息",
  707. userId: Cookies.get("userName"),
  708. sysTableSetList: this.setRowList,
  709. };
  710. addSet(this.data).then((res) => {
  711. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  712. });
  713. },
  714. //开始拖拽事件
  715. onStart() {
  716. this.drag = true;
  717. },
  718. //拖拽结束事件
  719. onEnd() {
  720. this.drag = false;
  721. },
  722. //模糊查询港口名称
  723. portRemoteMethod(){
  724. let queryParams = { pageNum: 1,};
  725. getportinformation(queryParams).then(response =>{
  726. this.portNameOptions = response.rows
  727. })
  728. },
  729. full(){
  730. this.dialogFull = !this.dialogFull
  731. },
  732. /** 查询客户详情列表 */
  733. getList() {
  734. this.loading = true;
  735. console.log(this.queryParams)
  736. listCorps(this.queryParams).then(response => {
  737. this.corpsList = response.rows;
  738. this.total = response.total;
  739. this.loading = false;
  740. });
  741. },
  742. // 取消按钮
  743. cancel() {
  744. this.open = false;
  745. this.reset();
  746. },
  747. // 表单重置
  748. reset() {
  749. this.form = {
  750. fNo:null,
  751. fName:null,
  752. fEname:null,
  753. fNationality:null,
  754. fImo:null,
  755. fStatus:'T',
  756. remark:null
  757. };
  758. this.resetForm("form");
  759. },
  760. // 状态修改
  761. handleStatusChange(row) {
  762. let text = row.fStatus === "0" ? "启用" : "停用";
  763. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  764. confirmButtonText: "确定",
  765. cancelButtonText: "取消",
  766. type: "warning"
  767. }).then(function() {
  768. return changeCorpsStatus(row.fId, row.fStatus);
  769. }).then(() => {
  770. this.msgSuccess(text + "成功");
  771. }).catch(function() {
  772. row.fStatus = row.fStatus === "0" ? "1" : "0";
  773. });
  774. },
  775. /** 搜索按钮操作 */
  776. handleQuery() {
  777. this.queryParams.pageNum = 1;
  778. this.getList();
  779. },
  780. /** 重置按钮操作 */
  781. resetQuery() {
  782. this.queryParams = {
  783. fNo:null,
  784. fName:null,
  785. fStatus:null,
  786. cLoadDate:null,
  787. createBy:null,
  788. fNationality:null,
  789. fImo:null,
  790. remark:null
  791. },
  792. this.resetForm("queryForm");
  793. this.handleQuery();
  794. },
  795. // 多选框选中数据
  796. handleSelectionChange(selection) {
  797. this.ids = selection.map(item => item.fId)
  798. this.single = selection.length!==1
  799. this.multiple = !selection.length
  800. },
  801. /** 新增按钮操作 */
  802. handleAdd() {
  803. this.doNot = false
  804. this.reset();
  805. this.open = true;
  806. this.title = "添加客户详情";
  807. },
  808. /** 修改按钮操作 */
  809. handleUpdate(row) {
  810. this.doNot = true
  811. this.reset();
  812. const fId = row.fId || this.ids
  813. getCorps(fId).then(response => {
  814. this.form = response.data;
  815. this.open = true;
  816. this.title = "修改客户详情";
  817. });
  818. },
  819. /** 提交按钮 */
  820. submitForm() {
  821. this.$refs["form"].validate(valid => {
  822. if (valid) {
  823. addyard(this.form).then(response => {
  824. this.msgSuccess("操作成功");
  825. this.open = false;
  826. this.getList();
  827. })
  828. }
  829. })
  830. },
  831. /** 删除按钮操作 */
  832. handleDelete(row) {
  833. const fIds = row.fId || this.ids;
  834. this.$confirm('是否确认删除客户详情编号为"' + fIds + '"的数据项?', "警告", {
  835. confirmButtonText: "确定",
  836. cancelButtonText: "取消",
  837. type: "warning"
  838. }).then(function() {
  839. return delCorps(fIds);
  840. }).then(() => {
  841. this.getList();
  842. this.msgSuccess("删除成功");
  843. })
  844. },
  845. /** 导出按钮操作 */
  846. handleExport() {
  847. const queryParams = this.queryParams;
  848. this.$confirm('是否确认导出所有客户详情数据项?', "警告", {
  849. confirmButtonText: "确定",
  850. cancelButtonText: "取消",
  851. type: "warning"
  852. }).then(function() {
  853. return exportCorps(queryParams);
  854. }).then(response => {
  855. this.download(response.msg);
  856. })
  857. }
  858. }
  859. };
  860. </script>
  861. <style lang="scss" scoped>
  862. .avue-crud__dialog__header {
  863. display: -webkit-box;
  864. display: -ms-flexbox;
  865. display: flex;
  866. -webkit-box-align: center;
  867. -ms-flex-align: center;
  868. align-items: center;
  869. -webkit-box-pack: justify;
  870. -ms-flex-pack: justify;
  871. justify-content: space-between;
  872. }
  873. .el-dialog__title {
  874. color: rgba(0,0,0,.85);
  875. font-weight: 500;
  876. word-wrap: break-word;
  877. }
  878. .avue-crud__dialog__menu {
  879. padding-right: 20px;
  880. float: left;
  881. }
  882. .avue-crud__dialog__menu i {
  883. color: #909399;
  884. font-size: 15px;
  885. }
  886. .el-icon-full-screen{
  887. cursor: pointer;
  888. }
  889. .el-icon-full-screen:before {
  890. content: "\e719";
  891. }
  892. .tabSetting {
  893. display: flex;
  894. justify-content: flex-end;
  895. }
  896. .listStyle {
  897. display: flex;
  898. border-top: 1px solid #dcdfe6;
  899. border-left: 1px solid #dcdfe6;
  900. border-right: 1px solid #dcdfe6;
  901. }
  902. .listStyle:last-child {
  903. border-bottom: 1px solid #dcdfe6;
  904. }
  905. .progress {
  906. display: flex;
  907. align-items: center;
  908. padding: 2px;
  909. background-color: rgba(0, 0, 0, 0.05);
  910. height: 100%;
  911. }
  912. </style>