Ver Fonte

更新 ocr识别loading;建议填写为空标红

wzh há 3 anos atrás
pai
commit
1ae31a1d5b
1 ficheiros alterados com 58 adições e 11 exclusões
  1. 58 11
      src/views/voyage/voyageDetail.vue

+ 58 - 11
src/views/voyage/voyageDetail.vue

@@ -993,15 +993,17 @@
     </div>
     <div v-if="distributeType == 4">
       <div class="tar">
-        <el-button @click="ocr" type="primary">开始识别</el-button>
+        <el-button @click="ocr" :loading="ocrLoading" type="primary">{{
+          ocrLoading ? "正在识别" : "开始识别"
+        }}</el-button>
       </div>
       <el-table :data="ocrTruckRecordTableData" stripe max-height="500">
-        <el-table-column label="港口名称" min-width="120" align="center">
+        <el-table-column label="港口名称" min-width="200" align="center">
           <template v-slot="scope">
             <el-input size="small" v-model="scope.row.portName"></el-input>
           </template>
         </el-table-column>
-        <el-table-column label="称重时间" min-width="200" align="center">
+        <!-- <el-table-column label="称重时间" min-width="200" align="center">
           <template v-slot="scope">
             <el-date-picker
               size="small"
@@ -1013,10 +1015,27 @@
               placeholder="称重时间"
             ></el-date-picker>
           </template>
+        </el-table-column> -->
+        <el-table-column label="称重时间" min-width="120" align="center">
+          <template v-slot="scope">
+            <el-input
+              :input-style="
+                scope.row.weighTime ? {} : { border: '1px solid red' }
+              "
+              size="small"
+              v-model="scope.row.weighTime"
+            ></el-input>
+          </template>
         </el-table-column>
         <el-table-column label="车号" min-width="120" align="center">
           <template v-slot="scope">
-            <el-input size="small" v-model="scope.row.carNum"></el-input>
+            <el-input
+              :input-style="
+                scope.row.carNum.length == 7 ? {} : { border: '1px solid red' }
+              "
+              size="small"
+              v-model="scope.row.carNum"
+            ></el-input>
           </template>
         </el-table-column>
         <el-table-column label="货物名称" min-width="120" align="center">
@@ -1024,29 +1043,51 @@
             <el-input size="small" v-model="scope.row.cargoName"></el-input>
           </template>
         </el-table-column>
-        <el-table-column label="发货单位" min-width="120" align="center">
+        <el-table-column label="发货单位" min-width="200" align="center">
           <template v-slot="scope">
             <el-input size="small" v-model="scope.row.shippingUnit"></el-input>
           </template>
         </el-table-column>
-        <el-table-column label="收货单位" min-width="120" align="center">
+        <el-table-column label="收货单位" min-width="200" align="center">
           <template v-slot="scope">
-            <el-input size="small" v-model="scope.row.receivingUnit"></el-input>
+            <el-input
+              :input-style="
+                scope.row.receivingUnit ? {} : { border: '1px solid red' }
+              "
+              size="small"
+              v-model="scope.row.receivingUnit"
+            ></el-input>
           </template>
         </el-table-column>
         <el-table-column label="毛重" min-width="120" align="center">
           <template v-slot="scope">
-            <el-input size="small" v-model="scope.row.grossWeight"></el-input>
+            <el-input
+              :input-style="
+                scope.row.grossWeight ? {} : { border: '1px solid red' }
+              "
+              size="small"
+              v-model="scope.row.grossWeight"
+            ></el-input>
           </template>
         </el-table-column>
         <el-table-column label="皮重" min-width="120" align="center">
           <template v-slot="scope">
-            <el-input size="small" v-model="scope.row.tare"></el-input>
+            <el-input
+              :input-style="scope.row.tare ? {} : { border: '1px solid red' }"
+              size="small"
+              v-model="scope.row.tare"
+            ></el-input>
           </template>
         </el-table-column>
         <el-table-column label="净重" min-width="120" align="center">
           <template v-slot="scope">
-            <el-input size="small" v-model="scope.row.netWeight"></el-input>
+            <el-input
+              :input-style="
+                scope.row.netWeight ? {} : { border: '1px solid red' }
+              "
+              size="small"
+              v-model="scope.row.netWeight"
+            ></el-input>
           </template>
         </el-table-column>
         <el-table-column label="货船名称" min-width="120" align="center">
@@ -1982,11 +2023,15 @@ async function deleteOcrRecord(index) {
 
 let distributePoundForm = ref({});
 async function ocr() {
+  ocrLoading.value = true;
   let res = await api.ocr({
     recordIds: recordIds.value,
   });
-  console.log(recordIds.value);
+  ocrLoading.value = false;
   ocrTruckRecordTableData.value = res.data.result;
+  for (let i of ocrTruckRecordTableData.value) {
+    if (i.weighTime) i.weighTime = i.weighTime.substring(0, 10);
+  }
 }
 let isCheckAll = ref(false);
 let isIndeterminate = ref(false);
@@ -2009,6 +2054,8 @@ function checkItem() {
   }
 }
 
+let ocrLoading = ref(false);
+
 onMounted(() => {
   getVoyageDetail();
   getDischargeList();