index.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151
  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:items: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:items: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:items: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:items: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:items: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:yard: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="fPortofloadid" width="100px"/>
  259. <el-table-column :show-overflow-tooltip="true" label="目的港" align="center" width="100px" prop="fDistinationid" />
  260. <el-table-column :show-overflow-tooltip="true" label="中转港" align="center" prop="fPortoftransshipment" />
  261. <el-table-column :show-overflow-tooltip="true" label="预计开船日期" align="center" prop="fEtd" />
  262. <el-table-column :show-overflow-tooltip="true" label="预计到达日期" align="center" prop="fEta" />
  263. <el-table-column :show-overflow-tooltip="true" label="航期" align="center" prop="fDays" />
  264. <el-table-column :show-overflow-tooltip="true" label="有效期起" align="center" prop="fBegindate" />
  265. <el-table-column :show-overflow-tooltip="true" label="有效期至" align="center" prop="fEnd" />
  266. <el-table-column :show-overflow-tooltip="true" label="总teu" align="center" prop="fTeu" />
  267. <el-table-column :show-overflow-tooltip="true" label="航期" align="center" prop="fDates" />
  268. <el-table-column :show-overflow-tooltip="true" label="单价" align="center" prop="fPrice" />
  269. <el-table-column :show-overflow-tooltip="true" label="集装箱" align="center" prop="fCntrid" />
  270. <el-table-column :show-overflow-tooltip="true" label="状态" align="center" prop="fStatus" />
  271. <el-table-column :show-overflow-tooltip="true" label="备注" align="center" prop="remark" />
  272. <el-table-column label="录入人" align="center" prop="createBy" />
  273. <el-table-column label="录入时间" align="center" prop="createTime" width="100">
  274. <template slot-scope="scope">
  275. <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
  276. </template>
  277. </el-table-column>
  278. <el-table-column label="最新修改人" align="center" prop="updateBy" width="100px"/>
  279. <el-table-column label="最新修改时间" align="center" prop="updateTime" width="100px">
  280. <template slot-scope="scope">
  281. <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
  282. </template>
  283. </el-table-column>
  284. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="120px">
  285. <template slot-scope="scope">
  286. <el-button
  287. size="mini"
  288. type="text"
  289. icon="el-icon-edit"
  290. v-hasPermi="['shipping:items:edit']"
  291. @click="handleUpdate(scope.row)"
  292. >查看</el-button>
  293. <el-button
  294. size="mini"
  295. type="text"
  296. icon="el-icon-delete"
  297. v-hasPermi="['shipping:items:remove']"
  298. @click="handleDelete(scope.row)"
  299. >移除</el-button>
  300. </template>
  301. </el-table-column>
  302. </el-table>
  303. <pagination
  304. v-show="total>0"
  305. :total="total"
  306. :page.sync="queryParams.pageNum"
  307. :limit.sync="queryParams.pageSize"
  308. @pagination="getList"
  309. />
  310. <!-- 添加或修改客户详情对话框 -->
  311. <el-dialog
  312. v-dialogDrag
  313. :fullscreen="dialogFull"
  314. :title="title"
  315. :visible.sync="open"
  316. close-on-click-modal="false"
  317. width="80%"
  318. :close-on-click-modal="false"
  319. append-to-body>
  320. <template slot="title">
  321. <div class="avue-crud__dialog__header">
  322. <span class="el-dialog__title">
  323. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  324. </span>
  325. <div class="avue-crud__dialog__menu enlarge" @click="full">
  326. <i style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
  327. </div>
  328. </div>
  329. </template>
  330. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  331. <el-row>
  332. <el-col :span="8">
  333. <el-form-item label="装货港" prop="fPortofloadid" label-width="110px">
  334. <el-select
  335. v-model="form.fPortofloadid"
  336. style="width: 80%"
  337. clearable
  338. filterable
  339. placeholder="请输入模糊查找"
  340. :remote-method="portRemoteMethod"
  341. >
  342. <el-option
  343. v-for="item in this.portOptions"
  344. :key="item.fId"
  345. :label="item.fName"
  346. :value="item.fId"
  347. />
  348. </el-select>
  349. </el-form-item>
  350. </el-col>
  351. <el-col :span="8">
  352. <el-form-item label="目的港" prop="fDistinationid" label-width="110px">
  353. <el-select
  354. v-model="form.fDistinationid"
  355. placeholder="请输入模糊查找"
  356. clearable
  357. filterable
  358. style="width: 80%"
  359. :remote-method="portRemoteMethod"
  360. >
  361. <el-option
  362. v-for="item in this.portOptions"
  363. :key="item.fId"
  364. :label="item.fName"
  365. :value="item.fId"
  366. />
  367. </el-select>
  368. </el-form-item>
  369. </el-col>
  370. <el-col :span="8">
  371. <el-form-item label="中转港" prop="fPortoftransshipment" label-width="110px">
  372. <el-select
  373. v-model="form.fPortoftransshipment"
  374. style="width: 80%"
  375. clearable
  376. filterable
  377. placeholder="请输入模糊查找"
  378. :remote-method="portRemoteMethod"
  379. >
  380. <el-option
  381. v-for="item in this.portOptions"
  382. :key="item.fId"
  383. :label="item.fName"
  384. :value="item.fId"
  385. />
  386. </el-select>
  387. </el-form-item>
  388. </el-col>
  389. </el-row>
  390. <el-row>
  391. <el-col :span="8">
  392. <el-form-item label="预计开船日期" prop="fEtd" label-width="110px">
  393. <el-date-picker
  394. v-model="form.fEtd"
  395. type="date"
  396. value-format="yyyy-MM-dd"
  397. style="width: 80%"
  398. placeholder="选择日期">
  399. </el-date-picker>
  400. </el-form-item>
  401. </el-col>
  402. <el-col :span="8">
  403. <el-form-item label="预计到达日期" prop="fEta" label-width="110px">
  404. <el-date-picker
  405. v-model="form.fEta"
  406. type="date"
  407. value-format="yyyy-MM-dd"
  408. style="width: 80%"
  409. placeholder="选择日期">
  410. </el-date-picker>
  411. </el-form-item>
  412. </el-col>
  413. <el-col :span="8">
  414. <el-form-item prop="fDays" label="航期" label-width="110px">
  415. <el-input
  416. v-model="form.fDays"
  417. style="width: 80%"
  418. value-format="yyyy-MM-dd"
  419. placeholder="请输入"
  420. >
  421. </el-input>
  422. </el-form-item>
  423. </el-col>
  424. <el-col :span="8">
  425. <el-form-item prop="fBegindate" label="有效期起" label-width="110px">
  426. <el-date-picker
  427. v-model="form.fBegindate"
  428. type="date"
  429. style="width: 80%"
  430. value-format="yyyy-MM-dd"
  431. placeholder="选择日期">
  432. </el-date-picker>
  433. </el-form-item>
  434. </el-col>
  435. <el-col :span="8">
  436. <el-form-item label="有效期至" prop="fEnd" label-width="110px">
  437. <el-date-picker
  438. v-model="form.fEnd"
  439. type="date"
  440. style="width: 80%"
  441. value-format="yyyy-MM-dd"
  442. placeholder="选择日期">
  443. </el-date-picker>
  444. </el-form-item>
  445. </el-col>
  446. <el-col :span="8">
  447. <el-form-item label="总teu" prop="fTeu" label-width="110px">
  448. <el-input
  449. v-model="form.fTeu"
  450. style="width: 80%"
  451. placeholder="请输入"
  452. >
  453. </el-input>
  454. </el-form-item>
  455. </el-col>
  456. </el-row>
  457. <el-row>
  458. <el-col :span="8">
  459. <el-form-item label="航期" prop="fDates" label-width="110px">
  460. <el-input
  461. v-model="form.fDates"
  462. style="width: 80%"
  463. />
  464. </el-form-item>
  465. </el-col>
  466. <el-col :span="8">
  467. <el-form-item label="状态" prop="fStatus" label-width="110px">
  468. <el-select
  469. v-model="form.fStatus"
  470. style="width: 80%"
  471. placeholder="请选择状态"
  472. clearable
  473. size="small"
  474. >
  475. <el-option label="正常" value="T"/>
  476. <el-option label="停用" value="F"/>
  477. </el-select>
  478. </el-form-item>
  479. </el-col>
  480. </el-row>
  481. </el-form>
  482. <el-collapse v-model="activeNames">
  483. <el-collapse-item name="1">
  484. <template slot="title" >
  485. <i class="el-icon-s-home"></i>海运运价
  486. </template>
  487. <div>
  488. <el-button
  489. type="primary"
  490. @click.prevent="addRelevant()"
  491. size="small"
  492. >新行
  493. </el-button>
  494. </div>
  495. <el-table
  496. :data="dataList"
  497. tooltip-effect="dark"
  498. ref="checkout"
  499. border
  500. stripe
  501. @selection-change="Selectinventory"
  502. >
  503. <el-table-column type="selection" width="55" align="center" />
  504. <el-table-column label="序号" type="index" width="80" />
  505. <el-table-column prop="fPid" header-align="center" align="center" width="150px" label="船名">
  506. <template slot-scope="scope">
  507. <el-select v-model="scope.row.fPid" filterable>
  508. </el-select>
  509. </template>
  510. </el-table-column>
  511. <el-table-column prop="fCntrid" header-align="center" align="center" width="140px" label="集装箱">
  512. <template slot-scope="scope">
  513. <el-select v-model="scope.row.fCntrid">
  514. </el-select>
  515. </template>
  516. </el-table-column>
  517. <el-table-column
  518. prop="fPrice"
  519. header-align="center"
  520. align="center"
  521. width="140px"
  522. label="单价"
  523. >
  524. <template slot-scope="scope">
  525. <el-input
  526. v-model="scope.row.fPrice"
  527. size="small">
  528. </el-input>
  529. </template>
  530. </el-table-column>
  531. <el-table-column
  532. prop="remark"
  533. header-align="center"
  534. width="140px"
  535. align="center"
  536. label="备注"
  537. >
  538. <template slot-scope="scope">
  539. <el-input
  540. v-model="scope.row.remark"
  541. size="small"
  542. placeholder=""
  543. >
  544. </el-input>
  545. </template>
  546. </el-table-column>
  547. <el-table-column
  548. prop="fStatus"
  549. header-align="center"
  550. align="center"
  551. width="140px"
  552. label="状态"
  553. >
  554. <template slot-scope="scope">
  555. <el-select
  556. v-model="scope.row.fStatus"
  557. >
  558. <el-option label="正常" value="T" />
  559. <el-option label="停用" value="F" />
  560. </el-select>
  561. </template>
  562. </el-table-column>
  563. <el-table-column
  564. header-align="center"
  565. align="center"
  566. label="操作"
  567. width="130PX"
  568. >
  569. <template slot-scope="scope">
  570. <el-button
  571. @click.native.prevent="wDeleteRow(scope.$index, dataList)"
  572. size="small"
  573. >移除</el-button
  574. >
  575. </template>
  576. </el-table-column>
  577. </el-table>
  578. </el-collapse-item>
  579. </el-collapse>
  580. <div slot="footer" class="dialog-footer">
  581. <el-button type="info" round @click="doNot = false">修 改</el-button>
  582. <el-button type="success" round @click="submitForm" :disabled="doNot">保 存</el-button>
  583. <el-button @click="cancel" round>关 闭</el-button>
  584. </div>
  585. </el-dialog>
  586. </div>
  587. </template>
  588. <script>
  589. import { getyard,listCorps, getCorps, delCorps, addyard,getport,getyardNo, getyardName, changeCorpsStatus,exportCorps } from "@/api/kaihe/shipDynamics/oceanFreightRate";
  590. import Vue from 'vue'
  591. import draggable from "vuedraggable";
  592. import { getportinformation } from '@/api/kaihe/basicdata/portinformation'
  593. import Cookies from 'js-cookie'
  594. import { addSet, resetModule, select } from '@/api/system/set'
  595. Vue.directive('dialogDrag', {
  596. bind(el, binding, vnode, oldVnode) {
  597. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  598. const dragDom = el.querySelector('.el-dialog')
  599. const enlarge = el.querySelector('.enlarge')
  600. dialogHeaderEl.style.cursor = 'move'
  601. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  602. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  603. if(enlarge){
  604. enlarge.onclick = (e) => {
  605. dragDom.style.top = '0px'
  606. dragDom.style.left = '0px'
  607. }
  608. }
  609. dialogHeaderEl.onmousedown = (e) => {
  610. // 鼠标按下,计算当前元素距离可视区的距离
  611. const disX = e.clientX - dialogHeaderEl.offsetLeft
  612. const disY = e.clientY - dialogHeaderEl.offsetTop
  613. // 获取到的值带px 正则匹配替换
  614. let styL, styT
  615. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  616. if (sty.left.includes('%')) {
  617. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  618. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  619. } else {
  620. styL = +sty.left.replace(/\px/g, '')
  621. styT = +sty.top.replace(/\px/g, '')
  622. }
  623. document.onmousemove = function(e) {
  624. // 通过事件委托,计算移动的距离
  625. const l = e.clientX - disX
  626. const t = e.clientY - disY
  627. // 移动当前元素
  628. if ((t + styT) >= 0){
  629. dragDom.style.top = `${t + styT}px`
  630. }
  631. dragDom.style.left = `${l + styL}px`
  632. // 将此时的位置传出去
  633. // binding.value({x:e.pageX,y:e.pageY})
  634. }
  635. document.onmouseup = function(e) {
  636. document.onmousemove = null
  637. document.onmouseup = null
  638. }
  639. }
  640. }
  641. })
  642. export default {
  643. name: "vessel",
  644. components: {
  645. draggable
  646. },
  647. data() {
  648. return {
  649. portOptions:[],
  650. dataList: [],
  651. activeNames: ['1'],
  652. setRowList: [],
  653. getRowList: [],
  654. tableDate: [
  655. {
  656. surface: "1",
  657. label: "fNo",
  658. name: "编号",
  659. fixed:"left",
  660. checked: 0,
  661. width: 120,
  662. },
  663. {
  664. surface: "2",
  665. label: "fName",
  666. name: "名称",
  667. fixed:"left",
  668. checked: 0,
  669. width: 120,
  670. },
  671. {
  672. surface: "3",
  673. label: "fEname",
  674. name: "英文全称",
  675. fixed:"left",
  676. checked: 0,
  677. width: 120,
  678. },
  679. {
  680. surface: "4",
  681. label: "fNationality",
  682. name: "国家代码",
  683. fixed:"left",
  684. checked: 0,
  685. width: 120,
  686. },
  687. {
  688. surface: "5",
  689. label: "fImo",
  690. name: "船舶呼号",
  691. fixed:"left",
  692. checked: 0,
  693. width: 120,
  694. },
  695. {
  696. surface: "6",
  697. label: "fStatus",
  698. name: "状态",
  699. fixed:"left",
  700. checked: 0,
  701. width: 120,
  702. },
  703. {
  704. surface: "7",
  705. label: "remark",
  706. name: "备注",
  707. checked: 0,
  708. width: 120,
  709. },
  710. {
  711. surface: "8",
  712. label: "createBy",
  713. name: "录入人",
  714. checked: 0,
  715. width: 120,
  716. },
  717. {
  718. surface: "9",
  719. label: "createTime",
  720. name: "录入时间",
  721. checked: 0,
  722. width: 120,
  723. },
  724. {
  725. surface: "10",
  726. label: "updateBy",
  727. name: "最新修改人",
  728. checked: 0,
  729. width: 120,
  730. },
  731. {
  732. surface: "11",
  733. label: "updateTime",
  734. name: "最新修改时间",
  735. checked: 0,
  736. width: 120,
  737. },
  738. ],
  739. //自定义列宽
  740. allCheck: false,
  741. showSetting:false,
  742. //默认显示第一行
  743. queryParamsHidden:false,
  744. //查看置灰
  745. doNot:true,
  746. //模糊查询港口名称
  747. portNameOptions:[],
  748. //港口类型字典表
  749. fTypesOptions:[],
  750. //模糊查询堆场名称
  751. yardOptions:[],
  752. //全屏放大
  753. dialogFull:false,
  754. // 遮罩层
  755. loading: true,
  756. // 选中数组
  757. ids: [],
  758. // 非单个禁用
  759. single: true,
  760. // 非多个禁用
  761. multiple: true,
  762. // 显示搜索条件
  763. showSearch: true,
  764. // 总条数
  765. total: 0,
  766. // 客户详情表格数据
  767. corpsList: [],
  768. // 弹出层标题
  769. title: "",
  770. // 状态数据字典
  771. statusOptions: [],
  772. // 是否显示弹出层
  773. open: false,
  774. // 查询参数
  775. queryParams: {
  776. pageNum: 1,
  777. pageSize: 10,
  778. fNo:null,
  779. fName:null,
  780. fStatus:null,
  781. cLoadDate:null,
  782. createBy:null,
  783. fNationality:null,
  784. fImo:null,
  785. remark:null
  786. },
  787. // 表单参数
  788. form: {
  789. fPortofloadid:null,
  790. fDistinationid:null,
  791. fPortoftransshipment:null,
  792. fEtd:null,
  793. fEta:null,
  794. fDays:null,
  795. fBegindate:null,
  796. fEnd:null,
  797. fTeu:null,
  798. fDates:null,
  799. fStatus:'T',
  800. },
  801. // 表单校验
  802. rules: {
  803. fTypeid: [
  804. { required: true, message: "客户类别不能为空", trigger: "blur" }
  805. ],
  806. fNo: [
  807. { required: true, message: "编号不能为空", trigger: "blur" }
  808. ],
  809. fName: [
  810. { required: true, message: "名称不能为空", trigger: "blur" }
  811. ],
  812. fCname:[
  813. { required: true, message: "简称不能为空", trigger: "blur" }
  814. ],
  815. fStatus: [
  816. { required: true, message: "状态默认 T ,正常T 停用F 下拉选择不能为空", trigger: "blur" }
  817. ],
  818. }
  819. };
  820. },
  821. created() {
  822. this.setRowList = this.tableDate;
  823. this.getRowList = this.tableDate;
  824. this.getList();
  825. this.getDicts("f_types").then(response => {
  826. this.fTypesOptions = response.data;
  827. });
  828. this.portRemoteMethod()
  829. this.getRow()
  830. },
  831. methods: {
  832. wDeleteRow(index, rows) {
  833. rows.splice(index, 1);
  834. },
  835. addRelevant(){
  836. this.dataList.push({
  837. fPid:null,
  838. fCntrid:null,
  839. fPrice:null,
  840. remarks:null,
  841. fStatus:null
  842. })
  843. },
  844. Selectinventory(selection) {
  845. console.log(selection)
  846. },
  847. //重置列表
  848. delRow() {
  849. this.data = {
  850. tableName: "船舶信息",
  851. userId: Cookies.get("userName"),
  852. };
  853. resetModule(this.data).then((res) => {
  854. if (res.code == 200) {
  855. this.showSetting = false;
  856. this.setRowList = this.tableDate;
  857. this.getRowList = this.tableDate;
  858. }
  859. });
  860. },
  861. //列设置全选
  862. allChecked() {
  863. if (this.allCheck == true) {
  864. this.setRowList.map((e) => {
  865. return (e.checked = 0);
  866. });
  867. } else {
  868. this.setRowList.map((e) => {
  869. return (e.checked = 1);
  870. });
  871. }
  872. },
  873. //查询列数据
  874. getRow() {
  875. let that = this;
  876. this.data = {
  877. tableName: "船舶信息",
  878. userId: Cookies.get("userName"),
  879. };
  880. select(this.data).then((res) => {
  881. if (res.data.length != 0) {
  882. this.getRowList = res.data.filter((e) => e.checked == 0);
  883. this.setRowList = res.data;
  884. this.setRowList = this.setRowList.reduce((res, item) => {
  885. res.push({
  886. surface: item.surface,
  887. label: item.label,
  888. name: item.name,
  889. checked: item.checked,
  890. width: item.width,
  891. fixed: item.fixed
  892. });
  893. return res;
  894. }, []);
  895. }
  896. });
  897. },
  898. //保存列设置
  899. save() {
  900. this.showSetting = false;
  901. this.data = {
  902. tableName: "船舶信息",
  903. userId: Cookies.get("userName"),
  904. sysTableSetList: this.setRowList,
  905. };
  906. addSet(this.data).then((res) => {
  907. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  908. });
  909. },
  910. //开始拖拽事件
  911. onStart() {
  912. this.drag = true;
  913. },
  914. //拖拽结束事件
  915. onEnd() {
  916. this.drag = false;
  917. },
  918. //模糊查询港口名称
  919. portRemoteMethod(){
  920. let queryParams = { pageNum: 1,};
  921. getport(queryParams).then(response =>{
  922. this.portOptions = response.rows
  923. })
  924. },
  925. full(){
  926. this.dialogFull = !this.dialogFull
  927. },
  928. /** 查询客户详情列表 */
  929. getList() {
  930. this.loading = true;
  931. listCorps(this.queryParams).then(response => {
  932. this.corpsList = response.rows;
  933. this.total = response.total;
  934. this.loading = false;
  935. });
  936. },
  937. // 取消按钮
  938. cancel() {
  939. this.open = false;
  940. this.reset();
  941. },
  942. // 表单重置
  943. reset() {
  944. this.form = {
  945. fPortofloadid:null,
  946. fDistinationid:null,
  947. fPortoftransshipment:null,
  948. fEtd:null,
  949. fEta:null,
  950. fDays:null,
  951. fBegindate:null,
  952. fEnd:null,
  953. fTeu:null,
  954. fDates:null,
  955. fStatus:'T',
  956. };
  957. this.resetForm("form");
  958. },
  959. // 状态修改
  960. handleStatusChange(row) {
  961. let text = row.fStatus === "0" ? "启用" : "停用";
  962. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  963. confirmButtonText: "确定",
  964. cancelButtonText: "取消",
  965. type: "warning"
  966. }).then(function() {
  967. return changeCorpsStatus(row.fId, row.fStatus);
  968. }).then(() => {
  969. this.msgSuccess(text + "成功");
  970. }).catch(function() {
  971. row.fStatus = row.fStatus === "0" ? "1" : "0";
  972. });
  973. },
  974. /** 搜索按钮操作 */
  975. handleQuery() {
  976. this.queryParams.pageNum = 1;
  977. this.getList();
  978. },
  979. /** 重置按钮操作 */
  980. resetQuery() {
  981. this.queryParams = {
  982. fNo:null,
  983. fName:null,
  984. fStatus:null,
  985. cLoadDate:null,
  986. createBy:null,
  987. fNationality:null,
  988. fImo:null,
  989. remark:null
  990. },
  991. this.resetForm("queryForm");
  992. this.handleQuery();
  993. },
  994. // 多选框选中数据
  995. handleSelectionChange(selection) {
  996. this.ids = selection.map(item => item.fId)
  997. this.single = selection.length!==1
  998. this.multiple = !selection.length
  999. },
  1000. /** 新增按钮操作 */
  1001. handleAdd() {
  1002. this.doNot = false
  1003. this.reset();
  1004. this.open = true;
  1005. this.title = "添加客户详情";
  1006. },
  1007. /** 修改按钮操作 */
  1008. handleUpdate(row) {
  1009. this.doNot = true
  1010. this.reset();
  1011. const fId = row.fId || this.ids
  1012. getCorps(fId).then(response => {
  1013. this.form = response.data;
  1014. this.open = true;
  1015. this.title = "修改客户详情";
  1016. });
  1017. },
  1018. /** 提交按钮 */
  1019. submitForm() {
  1020. this.$refs["form"].validate(valid => {
  1021. if (valid) {
  1022. console.log(this.form)
  1023. addyard(this.form).then(response => {
  1024. this.msgSuccess("操作成功");
  1025. this.open = false;
  1026. this.getList();
  1027. })
  1028. }
  1029. })
  1030. },
  1031. /** 删除按钮操作 */
  1032. handleDelete(row) {
  1033. const fIds = row.fId || this.ids;
  1034. this.$confirm('是否确认删除客户详情编号为"' + fIds + '"的数据项?', "警告", {
  1035. confirmButtonText: "确定",
  1036. cancelButtonText: "取消",
  1037. type: "warning"
  1038. }).then(function() {
  1039. return delCorps(fIds);
  1040. }).then(() => {
  1041. this.getList();
  1042. this.msgSuccess("删除成功");
  1043. })
  1044. },
  1045. /** 导出按钮操作 */
  1046. handleExport() {
  1047. const queryParams = this.queryParams;
  1048. this.$confirm('是否确认导出所有客户详情数据项?', "警告", {
  1049. confirmButtonText: "确定",
  1050. cancelButtonText: "取消",
  1051. type: "warning"
  1052. }).then(function() {
  1053. return exportCorps(queryParams);
  1054. }).then(response => {
  1055. this.download(response.msg);
  1056. })
  1057. }
  1058. }
  1059. };
  1060. </script>
  1061. <style lang="scss" >
  1062. .avue-crud__dialog__header {
  1063. display: -webkit-box;
  1064. display: -ms-flexbox;
  1065. display: flex;
  1066. -webkit-box-align: center;
  1067. -ms-flex-align: center;
  1068. align-items: center;
  1069. -webkit-box-pack: justify;
  1070. -ms-flex-pack: justify;
  1071. justify-content: space-between;
  1072. }
  1073. .el-dialog__title {
  1074. color: rgba(0,0,0,.85);
  1075. font-weight: 500;
  1076. word-wrap: break-word;
  1077. }
  1078. .avue-crud__dialog__menu {
  1079. padding-right: 20px;
  1080. float: left;
  1081. }
  1082. .avue-crud__dialog__menu i {
  1083. color: #909399;
  1084. font-size: 15px;
  1085. }
  1086. .el-icon-full-screen{
  1087. cursor: pointer;
  1088. }
  1089. .el-icon-full-screen:before {
  1090. content: "\e719";
  1091. }
  1092. .tabSetting {
  1093. display: flex;
  1094. justify-content: flex-end;
  1095. }
  1096. .listStyle {
  1097. display: flex;
  1098. border-top: 1px solid #dcdfe6;
  1099. border-left: 1px solid #dcdfe6;
  1100. border-right: 1px solid #dcdfe6;
  1101. }
  1102. .listStyle:last-child {
  1103. border-bottom: 1px solid #dcdfe6;
  1104. }
  1105. .progress {
  1106. display: flex;
  1107. align-items: center;
  1108. padding: 2px;
  1109. background-color: rgba(0, 0, 0, 0.05);
  1110. height: 100%;
  1111. }
  1112. .el-collapse-item__header {
  1113. font-size: 16px;
  1114. font-weight: bolder;
  1115. padding-left: 5px;
  1116. }
  1117. </style>