index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <div>
  3. <div style="width: 80%;background-color: #545c64;margin: 0 auto;display: flex;justify-content:space-around;">
  4. <el-menu
  5. :default-active="activeIndex2"
  6. class="el-menu-demo"
  7. mode="horizontal"
  8. @select="handleSelect"
  9. background-color="#545c64"
  10. text-color="#fff"
  11. active-text-color="#ffd04b">
  12. <el-menu-item index="1">门到门</el-menu-item>
  13. <el-menu-item index="2">门到港</el-menu-item>
  14. <el-menu-item index="3">港到门</el-menu-item>
  15. <el-menu-item index="4">港到港</el-menu-item>
  16. </el-menu>
  17. </div>
  18. <div class="outermost">
  19. <div v-if="selection === '1'">
  20. <el-input placeholder="请输入发货地址">
  21. <template slot="prepend">发货地址</template>
  22. <el-button slot="append" icon="el-icon-d-caret" @click="whether = !whether">
  23. {{ whether === false ? '指定港口' : '取消指定港口' }}
  24. </el-button>
  25. </el-input>
  26. <el-input placeholder="请输入货物名称">
  27. <template slot="prepend">货物名称</template>
  28. </el-input>
  29. <el-input placeholder="请输入收货地址">
  30. <template slot="prepend">收货地址</template>
  31. </el-input>
  32. <el-input placeholder="请输入预计装货时间">
  33. <template slot="prepend">预计装货时间</template>
  34. </el-input>
  35. <el-input placeholder="请输入起运港口" v-if="whether === true">
  36. <template slot="prepend">起运港口</template>
  37. </el-input>
  38. <el-input placeholder="请输入目的港口" v-if="whether === true">
  39. <template slot="prepend">目的港口</template>
  40. </el-input>
  41. <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
  42. <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
  43. </div>
  44. <div v-if="selection === '2'">
  45. <el-input placeholder="请输入发货地址">
  46. <template slot="prepend">发货地址</template>
  47. <el-button slot="append" icon="el-icon-d-caret" @click="whether = !whether">
  48. {{ whether === false ? '指定港口' : '取消指定港口' }}
  49. </el-button>
  50. </el-input>
  51. <el-input placeholder="请输入货物名称">
  52. <template slot="prepend">货物名称</template>
  53. </el-input>
  54. <el-input placeholder="请输入预计装货时间">
  55. <template slot="prepend">预计装货时间</template>
  56. </el-input>
  57. <el-input placeholder="请输入起运港口" v-if="whether === true">
  58. <template slot="prepend">起运港口</template>
  59. </el-input>
  60. <el-input placeholder="请输入目的港口" v-if="whether === true">
  61. <template slot="prepend">目的港口</template>
  62. </el-input>
  63. <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
  64. <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
  65. </div>
  66. <div v-if="selection === '3'">
  67. <el-input placeholder="请输入起运港口">
  68. <template slot="prepend">起运港口</template>
  69. </el-input>
  70. <el-input placeholder="请输入目的港口" v-if="whether === true">
  71. <template slot="prepend">目的港口</template>
  72. </el-input>
  73. <el-input placeholder="请输入货物名称">
  74. <template slot="prepend">货物名称</template>
  75. </el-input>
  76. <el-input placeholder="请输入收货地址">
  77. <template slot="prepend">收货地址</template>
  78. <el-button slot="append" icon="el-icon-d-caret" @click="whether = !whether">
  79. {{ whether === false ? '指定港口' : '取消指定港口' }}
  80. </el-button>
  81. </el-input>
  82. <el-input placeholder="请输入预计装货时间">
  83. <template slot="prepend">预计装货时间</template>
  84. </el-input>
  85. <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
  86. <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
  87. </div>
  88. <div v-if="selection === '4'">
  89. <div style="width: 400px;align-items: center;display: flex;">
  90. <el-button disabled style="border: 1px solid #DCDFE6;color:#95989d;background-color: #f5f7fa;border-top-right-radius:0;border-bottom-right-radius:0">起运港口</el-button>
  91. <el-select
  92. v-model="portToPort.fPortofloadid"
  93. filterable
  94. remote
  95. @change="handleQuery"
  96. style="width: 100%;"
  97. class="elSelect"
  98. :remote-method="handleQuery"
  99. placeholder="请输入模糊查找起运港口"
  100. >
  101. <el-scrollbar>
  102. <el-option
  103. v-for="(dict, index) in fMblnoOptions"
  104. :key="dict.fId"
  105. :label="dict.fName"
  106. :value="dict.fId"
  107. ></el-option>
  108. </el-scrollbar>
  109. </el-select>
  110. </div>
  111. <div style="width: 400px;align-items: center;display: flex;">
  112. <el-button disabled style="border: 1px solid #DCDFE6;color:#95989d;background-color: #f5f7fa;border-top-right-radius:0;border-bottom-right-radius:0">目的港口</el-button>
  113. <el-select
  114. v-model="portToPort.fPortofloadid"
  115. filterable
  116. remote
  117. @change="handleQuery"
  118. style="width: 100%;"
  119. class="elSelect"
  120. :remote-method="handleQuery"
  121. placeholder="请输入模糊查找目的港口"
  122. >
  123. <el-scrollbar>
  124. <el-option
  125. v-for="(dict, index) in fMblnoOptions"
  126. :key="dict.fId"
  127. :label="dict.fName"
  128. :value="dict.fId"
  129. ></el-option>
  130. </el-scrollbar>
  131. </el-select>
  132. </div>
  133. <!-- <el-input placeholder="请输入目的港口" v-model="portToPort.fDistinationid">-->
  134. <!-- <template slot="prepend">目的港口</template>-->
  135. <!-- </el-input>-->
  136. <el-input placeholder="请输入货物名称">
  137. <template slot="prepend">货物名称</template>
  138. </el-input>
  139. <el-input placeholder="请输入预计装货时间" v-model="portToPort.fEta">
  140. <template slot="prepend">预计装货时间</template>
  141. </el-input>
  142. <button class="stealthbutton"></button>
  143. <button class="stealthbutton"></button>
  144. </div>
  145. <div>
  146. <el-button type="primary" v-if="activeIndex2 === '1'||activeIndex2 === '2'||activeIndex2 === '3'" disabled>船期查询</el-button>
  147. <el-button type="primary" @click="schedule" v-else>船期查询</el-button>
  148. </div>
  149. <el-divider>查询船期</el-divider>
  150. <div style="margin: 0 auto;" v-if="detailedList.length === 0">
  151. <i class="el-icon-s-release" style="font-size: 100px;color: #b7b7b7"></i>
  152. <p>暂无数据</p>
  153. </div>
  154. <div style="width: 100%;" v-for="(item,index) in detailedList" :key="index">
  155. <div
  156. style="width: 100%;padding: 10px;margin-left: -10px;display: flex;justify-content: space-around;border: 1px solid #E8E8E8;box-shadow: 0 2px 7px 0 rgba(71,71,71,.2);">
  157. <div style="width: 50%;line-height: 40px;">
  158. <div
  159. style="background-color: #f10724;width: 80px;margin-top: 15px;margin-right: 5px;margin-left: 5px;height: 30px;line-height: 30px;border-radius: 20px;color: #ffffff;float: left">
  160. {{item.portofloadidName}}
  161. </div>
  162. <div style="width: 40px;height: 60px;float: left">
  163. <div style="width: 100%;height: 30px;">
  164. <img style="width: 50%;" src="../../assets/ship.png" alt="">
  165. </div>
  166. <div style="width: 100%;height: 30px;line-height: 30px;border-top: 1px solid #f33434">
  167. </div>
  168. </div>
  169. <div
  170. style="background-color: #f10724;width: 80px;margin-top: 15px;margin-right: 5px;margin-left: 5px;height: 30px;line-height: 30px;border-radius: 20px;color: #ffffff;float: left">
  171. {{item.portoftransshipmentName}}
  172. </div>
  173. <div style="width: 40px;height: 60px;float: left">
  174. <div style="width: 100%;height: 30px;">
  175. <img style="width: 50%;" src="../../assets/ship.png" alt="">
  176. </div>
  177. <div style="width: 100%;height: 30px;line-height: 30px;border-top: 1px solid #f33434">
  178. </div>
  179. </div>
  180. <div
  181. style="background-color: #f10724;width: 80px;margin-top: 15px;margin-right: 5px;margin-left: 5px;height: 30px;line-height: 30px;border-radius: 20px;color: #ffffff;float: left">
  182. {{item.portofdischargeidName}}
  183. </div>
  184. </div>
  185. <div
  186. style="width: 25%;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-left: 1px solid #E8E8E8">
  187. <div>
  188. <span style="color: #999999">全程运输时长:</span>
  189. <span style="font-weight:bold">{{item.fDays}}天</span>
  190. <br>
  191. <span style="color: #999999">单证有效时间:</span>
  192. <span style="font-weight:bold">{{item.closing}}天</span>
  193. </div>
  194. </div>
  195. <div style="width: 30%;border-left: 1px solid #E8E8E8;display:flex;justify-content: space-around">
  196. <div>
  197. <div>20GP</div>
  198. <div style="color:#bc1920 ">
  199. <span>¥</span>
  200. <span style="font-size: 20px;">{{item.twenty}}</span>
  201. <span>起</span>
  202. </div>
  203. </div>
  204. <div>
  205. <div>40HC</div>
  206. <div style="color:#bc1920 ">
  207. <span>¥</span>
  208. <span style="font-size: 20px;">{{ item.fortyHc }}</span>
  209. <span>起</span>
  210. </div>
  211. </div>
  212. <div>
  213. <div>40RH</div>
  214. <div style="color:#bc1920 ">
  215. <span>¥</span>
  216. <span>{{ item.fortyRh }}</span>
  217. <span>起</span>
  218. </div>
  219. </div>
  220. </div>
  221. <div class="query">
  222. <el-button type="primary" @click="item.introduction = !item.introduction">{{item.introduction === false?'查看船期':'关闭列表'}}</el-button>
  223. </div>
  224. </div>
  225. <div style="width: 98%;background-color: #99a9bf;margin: 0 auto" v-if="item.introduction === true">
  226. <div style="float: left;padding: 5px;color:#ffffff;">
  227. <span>{{item.portofloadidName}}</span>
  228. <span>{{ item.portofdischargeidName }}</span>
  229. </div>
  230. <div style="border: 1px solid #EBEEF5">
  231. <el-table
  232. :data="item.freight"
  233. style="width: 100%"
  234. :header-cell-style="{textAlign: 'center'}"
  235. :cell-style="{ textAlign: 'center' }">
  236. <el-table-column
  237. prop="fEta"
  238. label="预计开航">
  239. </el-table-column>
  240. <el-table-column
  241. prop="fEtd"
  242. label="预计抵港">
  243. </el-table-column>
  244. <el-table-column
  245. prop="fCutoffdate"
  246. label="截港日期">
  247. </el-table-column>
  248. <el-table-column
  249. prop="pidName"
  250. label="船名航次">
  251. </el-table-column>
  252. <el-table-column
  253. prop="twenty"
  254. label="20GP">
  255. </el-table-column>
  256. <el-table-column
  257. prop="fortyHc"
  258. label="40HC">
  259. </el-table-column>
  260. <el-table-column
  261. prop="fortyRh"
  262. label="40RH">
  263. </el-table-column>
  264. <el-table-column
  265. label="操作">
  266. <el-button type="primary">订舱</el-button>
  267. </el-table-column>
  268. </el-table>
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. </template>
  275. <script>
  276. import { request } from '../../request/request';
  277. import Cookies from 'js-cookie';
  278. export default {
  279. name: 'inquiryAndOrder',
  280. data() {
  281. return {
  282. fMblnoOptions:[],
  283. portToPort:{
  284. fPortofloadid:'',
  285. fDistinationid:'',
  286. fEta:'',
  287. portofloadidName:''
  288. },
  289. detailedList:[],
  290. value1: '',
  291. selection: '1',
  292. whether: false,
  293. activeIndex: '1',
  294. activeIndex2: '4',
  295. labelPosition: 'right',
  296. formLabelAlign: {
  297. name: '',
  298. region: '',
  299. type: ''
  300. },
  301. list:[],
  302. tableData: []
  303. };
  304. },
  305. methods: {
  306. handleSelect(key, keyPath) {
  307. this.whether = false;
  308. this.activeIndex2 = key
  309. console.log(key, keyPath);
  310. this.selection = key;
  311. },
  312. schedule(){
  313. console.log(this.detailedList);
  314. // v-if="selection === '1'"
  315. // switch (this.selection){
  316. // case '1':
  317. // break
  318. // case '2':
  319. // break
  320. // case '3':
  321. // break
  322. // case '4':
  323. // break
  324. // default:
  325. // break
  326. // }
  327. request({
  328. url: '/shipping/voyage/freightList',
  329. method: 'get',
  330. params: this.portToPort
  331. }).then(res => {
  332. // console.log(res);
  333. this.detailedList = []
  334. this.list = res.data.rows
  335. res.data.rows.map(((item, index)=> {
  336. this.detailedList.push(Object.assign({},item,{introduction:false}))
  337. }))
  338. // console.log(this.detailedList);
  339. }).catch(err => {
  340. console.log(err);
  341. })
  342. },
  343. handleQuery(){
  344. // this.fMblnoOptions
  345. request({
  346. url: '/shipping/address/selectPortName',
  347. method: 'get',
  348. params: {
  349. fName:this.portToPort.fPortofloadid
  350. }
  351. }).then(res => {
  352. console.log(res);
  353. this.fMblnoOptions = res.data.rows
  354. console.log(this.fMblnoOptions);
  355. }).catch(err => {
  356. console.log(err);
  357. })
  358. }
  359. }
  360. };
  361. </script>
  362. <style scoped lang="scss">
  363. .query {
  364. width: 15%;
  365. margin: 0 auto;
  366. display: flex;
  367. align-items: center;
  368. justify-content: center;
  369. border-left: 1px solid #E8E8E8
  370. }
  371. .outermost {
  372. width: 80%;
  373. margin: auto auto 100px auto;
  374. padding-top: 20px;
  375. display: flex;
  376. justify-content: space-between;
  377. flex-wrap: wrap;
  378. }
  379. .stealthbutton {
  380. width: 400px;
  381. height: 0;
  382. border: none;
  383. padding: 0;
  384. }
  385. .outermost > div:nth-child(1) {
  386. width: 80%;
  387. display: flex;
  388. display: -webkit-flex;
  389. justify-content: space-around;
  390. flex-direction: row;
  391. flex-wrap: wrap;
  392. }
  393. .outermost > div:nth-child(2) {
  394. width: 20%;
  395. margin: 0 auto;
  396. display: flex;
  397. align-items: center;
  398. justify-content: center
  399. }
  400. .outermost > div:nth-child(1) > .el-input {
  401. width: 400px;
  402. margin-top: 5px;
  403. margin-bottom: 5px;
  404. }
  405. </style>