Sfoglia il codice sorgente

更新 多港口分配单据

wzh 3 anni fa
parent
commit
c1be253c89
1 ha cambiato i file con 28 aggiunte e 1 eliminazioni
  1. 28 1
      src/views/voyage/voyageDetail.vue

+ 28 - 1
src/views/voyage/voyageDetail.vue

@@ -1188,6 +1188,16 @@
     destroy-on-close
     width="80%"
   >
+    <div class="df aic distribute-group">
+      <el-button
+        v-for="(item, index) in voyage.voyageDetails"
+        class="mr20"
+        :type="distributePortId == item.portId ? 'primary' : ''"
+        @click="distributePortId = item.portId"
+        >{{ item.portName }}</el-button
+      >
+    </div>
+    <div class="hr m10-0"></div>
     <div class="df aic distribute-group">
       <el-button
         class="mr20"
@@ -2254,6 +2264,7 @@ let isDistributeModalVisable = ref(false);
 let previewList = ref([]);
 let checkedImages = ref([]);
 let distributeType = ref(-1);
+let distributePortId = ref(-1);
 let checkedPreviewList = ref([]);
 let recordIds = ref("");
 let ocrTruckRecordTableData = ref([]);
@@ -2279,6 +2290,7 @@ function showDistributeModal() {
 function distributeModalClose() {
   isDistributeModalVisable.value = false;
   distributeType.value = -1;
+  distributePortId.value = -1;
   distributePoundForm.value = {
     dischargeTime: "",
     dischargeTons: "",
@@ -2288,6 +2300,13 @@ function distributeModalClose() {
 }
 
 async function submitDistribute() {
+  if (distributePortId.value == -1) {
+    ElMessage({
+      type: "error",
+      message: "请选择要分配的港口!",
+    });
+    return;
+  }
   if (distributeType.value == -1) {
     ElMessage({
       type: "error",
@@ -2298,8 +2317,16 @@ async function submitDistribute() {
   let postData = {};
   let type = distributeType.value;
   if (2 == type) {
-    postData = { poundBillData: distributePoundForm.value };
+    postData = {
+      poundBillData: {
+        ...distributePoundForm.value,
+        portId: distributePortId.value,
+      },
+    };
   } else if (4 == type) {
+    for (let i of ocrTruckRecordTableData.value) {
+      i.portId = distributePortId.value;
+    }
     postData = { carLoadDatas: ocrTruckRecordTableData.value };
   }
   let res = await api.distribute({