Ver Fonte

feat(ship): 添加船籍信息选择和展示功能

- 在 ShipInfo 组件中添加船籍选择下拉框
- 在 shipList 和 certsManage 组件中添加船籍列展示
- 新增 getProvinceSelect API 获取船籍省份选项
wzg há 10 meses atrás
pai
commit
2325d9b0c1

+ 5 - 0
src/apis/fetch.js

@@ -252,4 +252,9 @@ export default {
   uploadCrewFile(data) {
     return $http("/ship/crew/uploadCert", data);
   },
+
+  // 修改船舶-基础信息-船籍省份选择
+  getProvinceSelect() {
+    return $http("/ship/province/select");
+  },
 };

+ 31 - 1
src/components/ShipInfo.vue

@@ -124,6 +124,24 @@
           <view class="unit"></view>
         </div>
       </div>
+      <div class="line">
+        <div class="info-line">
+          <div class="info-line-title">船籍</div>
+          <el-select
+            style="width: 240px"
+            v-model="shipInfos[currentIndex].registryProvince"
+            placeholder="请选择船籍"
+            :disabled="shipInfoDisabled"
+          >
+            <el-option
+              v-for="item in provinceOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </div>
+      </div>
       <div class="line">
         <div class="info-line">
           <div class="info-line-title">船长</div>
@@ -556,12 +574,24 @@ function cancelUpdate() {
 function changeDisable(b) {
   shipInfoDisabled.value = b;
 }
+
+const provinceOptions = ref([]);
+async function getProvinceSelect() {
+  let { data } = await api.getProvinceSelect();
+  if (data.status === 0) {
+    provinceOptions.value = data.result;
+  } else {
+    provinceOptions.value = [];
+  }
+}
 defineExpose({
   initCerts,
   getShipCerts,
   changeDisable,
 });
-onMounted(() => {});
+onMounted(() => {
+  getProvinceSelect();
+});
 </script>
 
 <style scoped>

+ 6 - 0
src/views/shipManage/shipList.vue

@@ -33,6 +33,12 @@
           min-width="100"
           align="center"
         ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="shipRegistryProvince"
+          label="船籍"
+          min-width="80"
+        />
         <el-table-column
           prop="length"
           label="船长(米)"

+ 6 - 0
src/views/workStation/certsManage.vue

@@ -82,6 +82,12 @@
             label="船名"
             min-width="120"
           />
+          <el-table-column
+            align="center"
+            prop="shipRegistryProvince"
+            label="船籍"
+            min-width="80"
+          />
           <el-table-column
             v-if="certType == 6"
             align="center"