index.vue 29 KB

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