Browse Source

更新 样式

wzg 2 năm trước cách đây
mục cha
commit
7f4003944c
1 tập tin đã thay đổi với 32 bổ sung5 xóa
  1. 32 5
      src/views/order/orderList.vue

+ 32 - 5
src/views/order/orderList.vue

@@ -278,6 +278,13 @@
                 @click="currentVoyageIndex = index"
               >
                 {{ orderForm.voyages[index].shipName || "待选择船舶" }}
+                <div
+                  v-if="orderForm.voyages.length > 1"
+                  @click.capture="removeVoyage(index)"
+                  class="remove"
+                >
+                  ×
+                </div>
               </el-button>
             </el-button-group>
             <el-button
@@ -320,7 +327,7 @@
           </el-form-item>
           <el-form-item
             v-for="(item, index) in orderForm.voyages[currentVoyageIndex]
-              .dischargePorts"
+              ?.dischargePorts"
             :key="item"
             :label="'第 ' + (index + 1) + ' 卸货港'"
           >
@@ -338,7 +345,7 @@
               ></RemoteSelect>
               <el-button
                 v-if="
-                  orderForm.voyages[currentVoyageIndex].dischargePorts.length >
+                  orderForm.voyages[currentVoyageIndex]?.dischargePorts.length >
                   1
                 "
                 style="padding: 0 8px"
@@ -359,7 +366,8 @@
 
           <el-form-item
             v-if="
-              orderForm.voyages[currentVoyageIndex].dischargePorts.length % 2 !=
+              orderForm.voyages[currentVoyageIndex]?.dischargePorts.length %
+                2 !=
               0
             "
           ></el-form-item>
@@ -410,7 +418,7 @@
           >
             <el-table-column
               prop="voyageName"
-              label="订单编号"
+              label="航次编号"
               width="160"
               align="center"
             ></el-table-column>
@@ -837,7 +845,6 @@ let selectCargo = (item) => {
 function resetAddorderForm() {
   orderAddDialogVisible.value = false;
   setTimeout(() => {
-    orderFormRef.value.resetFields();
     shipStr.value = "";
     cargoOwnerStr.value = "";
     loadPortStr.value = "";
@@ -1029,6 +1036,11 @@ function removeDischargePort(index) {
   );
 }
 
+function removeVoyage(index) {
+  currentVoyageIndex.value = 0;
+  orderForm.value.voyages.splice(index, 1);
+}
+
 onMounted(() => {
   getOrderList();
 });
@@ -1176,4 +1188,19 @@ onMounted(() => {
 .el-button {
   margin-left: 0;
 }
+
+.remove {
+  position: absolute;
+  top: -15px;
+  right: -1px;
+  background: red;
+  color: #fff;
+  height: 20px;
+  width: 20px;
+  text-align: center;
+  line-height: 20px;
+  border-radius: 10px;
+  font-size: 14px;
+  z-index: 1000;
+}
 </style>