刘洋 hai 5 meses
pai
achega
d2663d20a3

+ 8 - 4
src/views/service-unit/dispatch/dispatch-manage/create-sop.vue

@@ -102,7 +102,7 @@
           upload-url="/api/admin/tb/crm/detail/sop/import"
           :format="['xls', 'xlsx']"
           :uploadData="{ crmNo: props.dispatchInfo.crmNo }"
-          @onSuccess="fetchData"
+          @onSuccess="search"
           :failRule="uploadFailRule"
         >
           <t-button variant="outline">
@@ -200,7 +200,7 @@
     <AllocationDialog
       v-model:visible="showAllocationDialog"
       :curRow="curRow"
-      @success="fetchData"
+      @success="search"
       :isCloud="isCloud"
     ></AllocationDialog>
   </my-drawer>
@@ -304,7 +304,11 @@ const addSopItem = (item) => {
     isCloud.value
   ).then(() => {
     MessagePlugin.success(curRow.value?.id ? '修改成功' : '新增成功');
-    fetchData();
+    if (curRow.value?.id) {
+      fetchData();
+    } else {
+      search();
+    }
   });
 };
 const editSopItem = (row) => {
@@ -412,7 +416,7 @@ const getInfo = () => {
   });
 };
 const whenOpen = () => {
-  fetchData();
+  search();
   getInfo();
 };