index.vue 42 KB

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