checkFireSafetyExamineList.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <div class="full-container-p24">
  3. <div class="df jcsb">
  4. <div class="df aic">
  5. <!-- <el-button-group class="mr30">
  6. <el-button
  7. @click="(type = 1), getFireSafetyCheckList(1)"
  8. :type="type == 1 ? 'primary' : ''"
  9. >
  10. 待审核船舶
  11. </el-button>
  12. <el-button
  13. @click="(type = 2), getFireSafetyCheckList(1)"
  14. :type="type == 2 ? 'primary' : ''"
  15. >
  16. 未审核船舶
  17. </el-button>
  18. </el-button-group> -->
  19. <el-input
  20. placeholder="请输入安检名称"
  21. prefix-icon="el-icon-search"
  22. v-model="term"
  23. clearable
  24. class="mr10"
  25. style="width: 200px"
  26. ></el-input>
  27. <el-button type="primary" @click="getFireSafetyCheckList(1)">
  28. 查询
  29. </el-button>
  30. </div>
  31. <!-- <el-button type="primary" @click="goToAdd">发起船舶安检</el-button> -->
  32. </div>
  33. <div style="margin-top: 24px">
  34. <el-table border :data="tableData" stripe style="width: 100%">
  35. <el-table-column
  36. type="index"
  37. label="序号"
  38. width="80"
  39. align="center"
  40. ></el-table-column>
  41. <el-table-column
  42. prop="shipname"
  43. label="船舶名称"
  44. min-width="120"
  45. align="center"
  46. ></el-table-column>
  47. <el-table-column
  48. prop="securityCheckName"
  49. label="安检名称"
  50. min-width="120"
  51. align="center"
  52. v-if="type == 1"
  53. ></el-table-column>
  54. <el-table-column
  55. prop="createTime"
  56. label="发起安检日期"
  57. min-width="120"
  58. align="center"
  59. v-if="type == 1"
  60. >
  61. <template v-slot="scope">
  62. {{ subTimeStr(scope.row.createTime) }}
  63. </template>
  64. </el-table-column>
  65. <el-table-column
  66. prop="shipOwnerName"
  67. label="船东名称"
  68. min-width="120"
  69. align="center"
  70. v-if="type == 1"
  71. ></el-table-column>
  72. <el-table-column
  73. prop="shipOwnerPhone"
  74. label="船东手机号"
  75. min-width="120"
  76. align="center"
  77. v-if="type == 1"
  78. ></el-table-column>
  79. <el-table-column
  80. prop="mmsi"
  81. label="MMSI"
  82. min-width="120"
  83. align="center"
  84. v-if="type == 2"
  85. ></el-table-column>
  86. <el-table-column
  87. prop="shipname"
  88. label="IMO"
  89. min-width="120"
  90. align="center"
  91. v-if="type == 2"
  92. ></el-table-column>
  93. <el-table-column
  94. prop="length"
  95. label="船长"
  96. min-width="80"
  97. align="center"
  98. v-if="type == 2"
  99. ></el-table-column>
  100. <el-table-column
  101. prop="breadth"
  102. label="船宽"
  103. min-width="80"
  104. align="center"
  105. v-if="type == 2"
  106. ></el-table-column>
  107. <el-table-column
  108. prop="tonnage"
  109. label="船舶总吨"
  110. min-width="100"
  111. align="center"
  112. v-if="type == 2"
  113. ></el-table-column>
  114. <el-table-column
  115. prop="loadTons"
  116. label="载重吨位"
  117. min-width="100"
  118. align="center"
  119. v-if="type == 2"
  120. ></el-table-column>
  121. <el-table-column
  122. prop="draught"
  123. label="吃水"
  124. min-width="80"
  125. align="center"
  126. v-if="type == 2"
  127. ></el-table-column>
  128. <el-table-column
  129. prop="age"
  130. label="船龄"
  131. min-width="80"
  132. align="center"
  133. v-if="type == 2"
  134. ></el-table-column>
  135. <el-table-column label="操作" min-width="120" align="center">
  136. <template v-slot="scope">
  137. <el-button type="primary" link @click="goTo(scope.row.id)">
  138. 详情
  139. </el-button>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. <div class="df aic jcfe mt40 mr20">
  144. <el-pagination
  145. background
  146. layout="prev, pager, next"
  147. :current-page="currentPage"
  148. :total="total"
  149. @current-change="pageChange"
  150. ></el-pagination>
  151. </div>
  152. </div>
  153. </div>
  154. </template>
  155. <script setup>
  156. import { ref, h, reactive, toRefs, onMounted } from "vue";
  157. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  158. import store from "../../store";
  159. import router from "../../router";
  160. import md5 from "md5";
  161. import api from "../../apis/fetch";
  162. import { subTimeStr } from "../../utils/utils";
  163. function goToAdd() {
  164. router.push("/shipSecurityManage/checkShip");
  165. }
  166. let currentPage = ref(1);
  167. let term = ref("");
  168. let tableData = ref([]);
  169. let total = ref(0);
  170. let type = ref(1);
  171. let choiceCompanyId = ref(0);
  172. async function getFireSafetyCheckList(page) {
  173. currentPage.value = page || currentPage.value;
  174. let res = await api.getFireSafetyCheckList({
  175. choiceCompanyId: choiceCompanyId.value,
  176. currentPage: currentPage.value,
  177. size: 10,
  178. term: term.value,
  179. type: type.value,
  180. });
  181. if (res.data.status == 0) {
  182. tableData.value = res.data.result;
  183. total.value = res.data.total;
  184. } else {
  185. tableData.value = [];
  186. total.value = 0;
  187. }
  188. }
  189. async function getSecurityTemplateDetail(id) {
  190. router.push({
  191. path: "/fireSafetyManage/shipCheckTemplateDetail",
  192. query: {
  193. id,
  194. },
  195. });
  196. }
  197. function goTo(id) {
  198. store.commit("addAlive", "checkFireSafetyExamineList");
  199. router.push({
  200. path: "/fireSafetyManage/checkFireSafetyExamine",
  201. query: {
  202. id,
  203. },
  204. });
  205. }
  206. function pageChange(e) {
  207. currentPage.value = e;
  208. getFireSafetyCheckList();
  209. }
  210. onMounted(() => {
  211. getFireSafetyCheckList();
  212. });
  213. </script>
  214. <style scoped>
  215. .seach-btn {
  216. display: inline-block;
  217. width: 60px;
  218. height: 38px;
  219. background: #0094fe;
  220. border-radius: 2px;
  221. font-size: 14px;
  222. font-family: PingFangSC-Regular, PingFang SC;
  223. font-weight: 400;
  224. color: #ffffff;
  225. text-align: center;
  226. line-height: 38px;
  227. margin-left: 10px;
  228. cursor: pointer;
  229. }
  230. .cargo-owner-add {
  231. width: 80px;
  232. height: 32px;
  233. border-radius: 2px;
  234. border: 1px solid #0094fe;
  235. font-size: 14px;
  236. font-family: PingFangSC-Regular, PingFang SC;
  237. font-weight: 400;
  238. color: #0094fe;
  239. line-height: 32px;
  240. text-align: center;
  241. cursor: pointer;
  242. }
  243. :deep().el-dialog {
  244. width: 560px;
  245. padding: 20px 50px;
  246. border-radius: 6px;
  247. }
  248. :deep() .el-dialog__title {
  249. font-size: 18px;
  250. font-family: PingFangSC-Regular, PingFang SC;
  251. font-weight: 400;
  252. color: #0094fe;
  253. }
  254. </style>