guoyujia 4 hónapja
szülő
commit
facfc586d5
1 módosított fájl, 7 hozzáadás és 0 törlés
  1. 7 0
      src/views/business/inventoryCheck/index.vue

+ 7 - 0
src/views/business/inventoryCheck/index.vue

@@ -298,6 +298,7 @@ const takeStockPeriodList = ref([]);
 const hasAlreadyTakeStock = ref(false);
 //列表中已经存在新增的盘点
 const hasAlreadyAddTakeStock = ref(false);
+const canSave = ref(false);
 const loading = ref(false);
 const total = ref(0);
 
@@ -323,6 +324,7 @@ function getTakeStockPeriodList() {
     hasAlreadyTakeStock.value = res.others.hasAddTakeStockStatus;
     hasAlreadyAddTakeStock.value = res.others.hasTakeStockStatus;
     total.value = res.total;
+    canSave.value = true
   });
   loading.value = false;
 }
@@ -342,6 +344,7 @@ function handleAdd() {
 }
 //保存按钮
 function handleSave(row) {
+  canSave.value = true
   if (row.stockTime == null) {
     proxy.$modal.msgError("请选择盘点时间");
     return;
@@ -349,12 +352,16 @@ function handleSave(row) {
   row.stockYear = row.stockTime.substring(0, 4);
   row.stockMonth = row.stockTime.substring(5, 7);
   console.log(row);
+  if(canSave.value){
   addTakeStockPeriod(row).then((res) => {
+    canSave.value = false;
     if (res.code === 200) {
       getTakeStockPeriodList();
     }
+   
   });
 }
+}
 function handleExport(data) {
   console.log(data);
   proxy.download(