cargoOwnerDetail.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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="width: 330px"
  44. clearable
  45. ></el-input>
  46. <div class="seach-btn" @click="getVoyageList">查询</div>
  47. </div>
  48. <el-table :data="tableData" stripe style="width: 100%; margin-top: 20px">
  49. <el-table-column
  50. type="index"
  51. label="序号"
  52. min-width="80"
  53. align="center"
  54. ></el-table-column>
  55. <el-table-column
  56. prop="voyageName"
  57. label="航次名称"
  58. min-width="160"
  59. align="center"
  60. ></el-table-column>
  61. <el-table-column
  62. prop="loadDiscPort"
  63. label="装货港-卸货港"
  64. min-width="200"
  65. align="center"
  66. ></el-table-column>
  67. <el-table-column
  68. prop="startEndTime"
  69. label="开始时间-结束时间"
  70. min-width="200"
  71. align="center"
  72. ></el-table-column>
  73. <el-table-column
  74. prop="cargo"
  75. label="货种"
  76. min-width="100"
  77. align="center"
  78. ></el-table-column>
  79. <el-table-column
  80. prop="tons"
  81. label="吨位(吨)"
  82. min-width="100"
  83. align="center"
  84. ></el-table-column>
  85. <el-table-column
  86. prop="transStatus"
  87. label="船舶状态"
  88. min-width="200"
  89. align="center"
  90. ></el-table-column>
  91. <el-table-column
  92. prop="createTime"
  93. label="备注"
  94. min-width="200"
  95. align="center"
  96. ></el-table-column>
  97. <el-table-column label="操作" min-width="80" align="center">
  98. <template v-slot="scope">
  99. <el-button
  100. @click="voyageDetail(scope.row.id, tableData)"
  101. type="text"
  102. size="small"
  103. >
  104. 查看详情
  105. </el-button>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <div style="width: 100%; text-align: right; margin-top: 43px">
  110. <el-pagination
  111. background
  112. layout="prev, pager, next"
  113. :total="total"
  114. @current-change="pageChange"
  115. ></el-pagination>
  116. </div>
  117. </div>
  118. </template>
  119. <script>
  120. import { ref, h, reactive, toRefs, onMounted } from "vue";
  121. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  122. import store from "../../store";
  123. import router from "../../router";
  124. import { useRoute } from "vue-router";
  125. import api from "../../apis/fetch";
  126. export default {
  127. setup() {
  128. const route = useRoute();
  129. let currentbtn = ref(true);
  130. let userName = ref();
  131. let contactName = ref();
  132. let userPhone = ref();
  133. let status = ref(1);
  134. let term = ref();
  135. let currentPage = ref(1);
  136. async function getUserDetail() {
  137. let res = await api.getUserDetail({
  138. userId: route.query.userId,
  139. });
  140. if (res.data.status == 0) {
  141. userName.value = res.data.result.userName;
  142. contactName.value = res.data.result.contactName;
  143. userPhone.value = res.data.result.userPhone;
  144. } else {
  145. console.log(res);
  146. }
  147. }
  148. getUserDetail();
  149. getVoyageList();
  150. const tableData = ref();
  151. async function getVoyageList() {
  152. let res = await api.getVoyageList({
  153. cargoOwnerId: route.query.userId,
  154. shipId: 0,
  155. status: status.value,
  156. term: term.value,
  157. currentPage: currentPage.value,
  158. size: 10,
  159. });
  160. if (res.data.status == 0) {
  161. tableData.value = res.data.result;
  162. } else {
  163. console.log(res);
  164. }
  165. }
  166. function changeVoyageType(s) {
  167. currentPage.value = 1;
  168. tableData.value = [];
  169. currentbtn.value = s == 1;
  170. status.value = s;
  171. getVoyageList();
  172. }
  173. function pageChange(e) {
  174. currentPage.value = e;
  175. getVoyageList();
  176. }
  177. function voyageDetail(id) {
  178. router.push({
  179. path: "/voyage/voyageDetail",
  180. query: {
  181. id,
  182. },
  183. });
  184. }
  185. return {
  186. userName,
  187. contactName,
  188. userPhone,
  189. status,
  190. term,
  191. currentPage,
  192. currentbtn,
  193. changeVoyageType,
  194. getVoyageList,
  195. voyageDetail,
  196. pageChange,
  197. tableData,
  198. };
  199. },
  200. };
  201. </script>
  202. <style scoped>
  203. .go-back {
  204. font-size: 16px;
  205. font-family: PingFangSC-Medium, PingFang SC;
  206. font-weight: 500;
  207. color: #333d43;
  208. line-height: 100%;
  209. cursor: pointer;
  210. }
  211. .normal-label {
  212. font-size: 14px;
  213. font-family: PingFangSC-Regular, PingFang SC;
  214. font-weight: 400;
  215. color: #353a42;
  216. margin-right: 10px;
  217. }
  218. .show-input {
  219. width: 280px;
  220. height: 32px;
  221. background: #ffffff;
  222. border-radius: 2px;
  223. border: 1px solid #dee0e3;
  224. font-size: 14px;
  225. font-family: PingFangSC-Regular, PingFang SC;
  226. font-weight: 400;
  227. color: #333333;
  228. line-height: 32px;
  229. padding-left: 12px;
  230. margin-right: 40px;
  231. }
  232. .radio-btns {
  233. height: 38px;
  234. width: 103px;
  235. border: 1px solid #1486f9;
  236. line-height: 38px;
  237. text-align: center;
  238. font-size: 14px;
  239. font-family: PingFangSC-Regular, PingFang SC;
  240. font-weight: 400;
  241. color: #0094fe;
  242. cursor: pointer;
  243. }
  244. .left-radius {
  245. border-top-left-radius: 19px;
  246. border-bottom-left-radius: 19px;
  247. }
  248. .right-radius {
  249. border-top-right-radius: 19px;
  250. border-bottom-right-radius: 19px;
  251. }
  252. .currentbtn {
  253. background: #1486f9;
  254. color: #fff;
  255. }
  256. .seach-btn {
  257. display: inline-block;
  258. width: 60px;
  259. height: 38px;
  260. background: #0094fe;
  261. border-radius: 2px;
  262. font-size: 14px;
  263. font-family: PingFangSC-Regular, PingFang SC;
  264. font-weight: 400;
  265. color: #ffffff;
  266. text-align: center;
  267. line-height: 38px;
  268. margin-left: 15px;
  269. cursor: pointer;
  270. box-sizing: border-box;
  271. }
  272. </style>