cargoOwnerDetail.vue 7.0 KB

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