cargoOwnerDetail.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <div class="line-container-p18">
  3. <i class="el-icon-arrow-left"></i>
  4. <div class="dib go-back ml8">返回货主列表</div>
  5. </div>
  6. <div class="container-title">货主信息</div>
  7. <div class="line-container-p24 df aic">
  8. <div class="normal-label">货主名称</div>
  9. <div class="show-input">{{ userName }}</div>
  10. <div class="normal-label">联系人</div>
  11. <div class="show-input">{{ contactName }}</div>
  12. <div class="normal-label">联系人手机号</div>
  13. <div class="show-input">{{ userPhone }}</div>
  14. </div>
  15. <div class="container-title">航次信息</div>
  16. <div class="line-container-p24">
  17. <div class="df aic">
  18. <div
  19. @click="changeVoyageType(1)"
  20. :class="
  21. currentbtn
  22. ? 'currentbtn radio-btns left-radius'
  23. : 'radio-btns left-radius'
  24. "
  25. >
  26. 执行中航次
  27. </div>
  28. <div
  29. @click="changeVoyageType(2)"
  30. :class="
  31. currentbtn
  32. ? ' radio-btns right-radius'
  33. : 'radio-btns right-radius currentbtn'
  34. "
  35. style="margin-right: 40px"
  36. >
  37. 历史航次
  38. </div>
  39. <el-input
  40. placeholder="请输入货主名称/联系人/联系人手机号"
  41. prefix-icon="el-icon-search"
  42. v-model="term"
  43. style="height: 32px; width: 330px; line-height: 32px"
  44. ></el-input>
  45. <div class="seach-btn" @click="getVoyageList">查询</div>
  46. </div>
  47. <el-table :data="tableData" stripe style="width: 100%">
  48. <el-table-column
  49. type="index"
  50. label="序号"
  51. min-width="80"
  52. align="center"
  53. ></el-table-column>
  54. <el-table-column
  55. prop="userName"
  56. label="航次名称"
  57. min-width="120"
  58. align="center"
  59. ></el-table-column>
  60. <el-table-column
  61. prop="contactName"
  62. label="装货港-卸货港"
  63. min-width="120"
  64. align="center"
  65. ></el-table-column>
  66. <el-table-column
  67. prop="开始时间-结束时间"
  68. label="联系人手机号"
  69. min-width="160"
  70. align="center"
  71. ></el-table-column>
  72. <el-table-column
  73. prop="createTime"
  74. label="货种"
  75. min-width="200"
  76. align="center"
  77. ></el-table-column>
  78. <el-table-column
  79. prop="createTime"
  80. label="吨位(吨)"
  81. min-width="200"
  82. align="center"
  83. ></el-table-column>
  84. <el-table-column
  85. prop="createTime"
  86. label="船舶状态"
  87. min-width="200"
  88. align="center"
  89. ></el-table-column>
  90. <el-table-column
  91. prop="createTime"
  92. label="备注"
  93. min-width="200"
  94. align="center"
  95. ></el-table-column>
  96. <el-table-column label="操作" min-width="80" align="center">
  97. <template v-slot="scope">
  98. <el-button
  99. @click="voyageDetail(scope.row, tableData)"
  100. type="text"
  101. size="small"
  102. >
  103. 查看详情
  104. </el-button>
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. <div style="width: 100%; text-align: right; margin-top: 43px">
  109. <el-pagination
  110. background
  111. layout="prev, pager, next"
  112. :total="total"
  113. @current-change="pageChange"
  114. ></el-pagination>
  115. </div>
  116. </div>
  117. </template>
  118. <script>
  119. import { ref, h, reactive, toRefs, onMounted } from "vue";
  120. import { Notification, Msgbox, Message } from "element3";
  121. import store from "../../store";
  122. import router from "../../router";
  123. import { useRoute } from "vue-router";
  124. import api from "../../apis/fetch";
  125. export default {
  126. setup() {
  127. const route = useRoute();
  128. let currentbtn = ref(true);
  129. let userName = ref();
  130. let contactName = ref();
  131. let userPhone = ref();
  132. let status = ref(1);
  133. let term = ref();
  134. let currentPage = ref(1);
  135. async function getUserDetail() {
  136. let res = await api.getUserDetail({
  137. userId: route.query.userId,
  138. });
  139. if (res.data.status == 0) {
  140. console.log(res.data.result.userName);
  141. userName.value = res.data.result.userName;
  142. contactName.value = res.data.result.contactName;
  143. userPhone.value = res.data.result.userPhone;
  144. }
  145. }
  146. getUserDetail();
  147. getVoyageList();
  148. async function getVoyageList() {
  149. let res = await api.getVoyageList({
  150. cargoOwnerId: route.query.userId,
  151. shipId: 0,
  152. status: status.value,
  153. term: term.value,
  154. currentPage: currentPage.value,
  155. size: 10,
  156. });
  157. console.log(res);
  158. }
  159. function changeVoyageType(s) {
  160. currentbtn.value = s == 1;
  161. status.value = s;
  162. getVoyageList();
  163. }
  164. function pageChange(e) {
  165. currentPage.value = e;
  166. getVoyageList();
  167. }
  168. function voyageDetail() {
  169. router.push({
  170. path: "/voyage/voyageDetail",
  171. query: {},
  172. });
  173. }
  174. return {
  175. userName,
  176. contactName,
  177. userPhone,
  178. status,
  179. term,
  180. currentPage,
  181. currentbtn,
  182. changeVoyageType,
  183. getVoyageList,
  184. voyageDetail,
  185. pageChange,
  186. };
  187. },
  188. };
  189. </script>
  190. <style scoped>
  191. .go-back {
  192. font-size: 16px;
  193. font-family: PingFangSC-Medium, PingFang SC;
  194. font-weight: 500;
  195. color: #333d43;
  196. line-height: 100%;
  197. cursor: pointer;
  198. }
  199. .normal-label {
  200. font-size: 14px;
  201. font-family: PingFangSC-Regular, PingFang SC;
  202. font-weight: 400;
  203. color: #353a42;
  204. margin-right: 10px;
  205. }
  206. .show-input {
  207. width: 280px;
  208. height: 32px;
  209. background: #ffffff;
  210. border-radius: 2px;
  211. border: 1px solid #dee0e3;
  212. font-size: 14px;
  213. font-family: PingFangSC-Regular, PingFang SC;
  214. font-weight: 400;
  215. color: #333333;
  216. line-height: 32px;
  217. padding-left: 12px;
  218. margin-right: 40px;
  219. }
  220. .radio-btns {
  221. height: 34px;
  222. width: 103px;
  223. border: 1px solid #1486f9;
  224. line-height: 34px;
  225. text-align: center;
  226. font-size: 14px;
  227. font-family: PingFangSC-Regular, PingFang SC;
  228. font-weight: 400;
  229. color: #0094fe;
  230. cursor: pointer;
  231. }
  232. .left-radius {
  233. border-top-left-radius: 17px;
  234. border-bottom-left-radius: 17px;
  235. }
  236. .right-radius {
  237. border-top-right-radius: 17px;
  238. border-bottom-right-radius: 17px;
  239. }
  240. .currentbtn {
  241. background: #1486f9;
  242. color: #fff;
  243. }
  244. .seach-btn {
  245. display: inline-block;
  246. width: 60px;
  247. height: 32px;
  248. background: #0094fe;
  249. border-radius: 2px;
  250. font-size: 14px;
  251. font-family: PingFangSC-Regular, PingFang SC;
  252. font-weight: 400;
  253. color: #ffffff;
  254. text-align: center;
  255. line-height: 32px;
  256. margin-left: 10px;
  257. cursor: pointer;
  258. }
  259. :deep().el-input__icon {
  260. line-height: 100% !important;
  261. }
  262. </style>