Explorar el Código

新增 航期维护

wzh hace 3 años
padre
commit
943618175f
Se han modificado 1 ficheros con 42 adiciones y 30 borrados
  1. 42 30
      src/views/portsManage/sailingSchedule.vue

+ 42 - 30
src/views/portsManage/sailingSchedule.vue

@@ -23,22 +23,28 @@
             label-width="110px"
             label-position="left"
           >
-            <el-form-item prop="portName" label="港口名称">
+            <el-form-item prop="portName" label="货主名称">
               <el-input
                 style="width: 280px"
                 v-model="ruleForm.portName"
               ></el-input>
             </el-form-item>
-            <el-form-item prop="longitude" label="经度">
+            <el-form-item prop="departurePortId" label="始发港">
               <el-input
                 style="width: 280px"
-                v-model="ruleForm.longitude"
+                v-model="ruleForm.departurePortId"
               ></el-input>
             </el-form-item>
-            <el-form-item prop="latitude" label="纬度">
+            <el-form-item prop="destinationPortId" label="目的地港">
               <el-input
                 style="width: 280px"
-                v-model="ruleForm.latitude"
+                v-model="ruleForm.destinationPortId"
+              ></el-input>
+            </el-form-item>
+            <el-form-item prop="sailingPeriod" label="航期">
+              <el-input
+                style="width: 280px"
+                v-model="ruleForm.sailingPeriod"
               ></el-input>
             </el-form-item>
           </el-form>
@@ -62,20 +68,30 @@
           align="center"
         ></el-table-column>
         <el-table-column
-          prop="portName"
-          label="港口名称"
+          prop="cargoOwnerName"
+          label="货主名称"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="departurePort"
+          label="始发港"
           min-width="120"
           align="center"
         ></el-table-column>
         <el-table-column
-          prop="longitude"
-          label="经纬度"
+          prop="destinationPort"
+          label="目的地港"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="sailingPeriod"
+          label="航期"
           min-width="120"
           align="center"
         >
-          <template v-slot="scope">
-            {{ scope.row.longitude }}, {{ scope.row.latitude }}
-          </template>
+          <template v-slot="scope"> {{ scope.row.sailingPeriod }} 天 </template>
         </el-table-column>
         <el-table-column
           prop="createTime"
@@ -87,18 +103,11 @@
             {{ subTimeStr(scope.row.createTime) }}
           </template>
         </el-table-column>
-        <el-table-column label="启用/禁用" min-width="80" align="center">
+        <!-- <el-table-column label="操作" min-width="80" align="center">
           <template v-slot="scope">
-            <el-switch
-              v-model="scope.row.status"
-              active-color="#13ce66"
-              :active-value="0"
-              :inactive-value="1"
-              inactive-color="#ff4949"
-              @change="changeSwitch($event, scope.row.id)"
-            />
+            <el-button size="mini" type="danger">删除</el-button>
           </template>
-        </el-table-column>
+        </el-table-column> -->
       </el-table>
       <div style="width: 100%; text-align: right; margin-top: 43px">
         <el-pagination
@@ -128,13 +137,17 @@ let dialogFormVisible = ref(false);
 let form = ref(null);
 const ruleForm = ref({
   portName: "",
-  longitude: "",
-  latitude: "",
+  departurePortId: "",
+  destinationPortId: "",
 });
 const rules = ref({
   portName: [{ required: true, message: "请填写港口名称", trigger: "blur" }],
-  longitude: [{ required: true, message: "请填写港口经度", trigger: "blur" }],
-  latitude: [{ required: true, message: "请填写港口纬度", trigger: "blur" }],
+  departurePortId: [
+    { required: true, message: "请填写港口经度", trigger: "blur" },
+  ],
+  destinationPortId: [
+    { required: true, message: "请填写港口纬度", trigger: "blur" },
+  ],
 });
 async function getTransPortsList() {
   tableData.value = [];
@@ -143,7 +156,6 @@ async function getTransPortsList() {
     size: 10,
     term: term.value,
   });
-  term.value = "";
   if (res.data.status == 0) {
     tableData.value = res.data.result;
     total.value = res.data.total;
@@ -157,11 +169,11 @@ function resetForm() {
 async function addtTransPort() {
   form.value.validate(async (valid) => {
     if (valid) {
-      let { portName, longitude, latitude } = ruleForm.value;
+      let { portName, departurePortId, destinationPortId } = ruleForm.value;
       let res = await api.addtTransPort({
         portName,
-        longitude,
-        latitude,
+        departurePortId,
+        destinationPortId,
       });
       console.log(res);
       if (res.data.status == 0) {