index.vue 52 KB

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