index.vue 50 KB

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