index.vue 43 KB

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