Kaynağa Gözat

fix(saleOderAftersalesList): 修复售后工单列表初始化加载问题,添加init方法手动触发表格刷新

yusheng 7 ay önce
ebeveyn
işleme
e8f5b9d889

+ 6 - 0
src/views/saleManage/contact/components/darwerComponents/saleOderAftersalesList.vue

@@ -7,6 +7,7 @@
       :datasource="datasource"
       cache-key="systemRoleTable"
       :pageSize="20"
+      :initLoad="false"
     >
     </ele-pro-table>
   </div>
@@ -18,6 +19,7 @@
     getSalesWorkOrderById
   } from '@/api/salesServiceManagement/index';
   import { getByCode } from '@/api/system/dictionary-data';
+import { init } from 'echarts';
 
   export default {
     props: {
@@ -183,6 +185,9 @@
       this.getLevelCode('fault_level');
     },
     methods: {
+       init(){
+          this.$refs.table.reload({ page: 1 });
+       },
       async getLevelCode(code) {
         const res = await getByCode(code);
         if (res?.code === '0') {
@@ -196,6 +201,7 @@
         }
       },
       datasource({ page, limit, where, order }) {
+        console.log('where', this.contactData.id);
         // let isDispatch = '1';
         return getSalesWorkOrder({
           pageNum: page,

+ 2 - 0
src/views/saleManage/contact/components/drawer.vue

@@ -318,6 +318,7 @@
     methods: {
       async open(row, pageName) {
         console.log(row, pageName);
+        this.activeName = '详细信息';
 
         this.row = await contactDetail(row.id);
         if (this.row?.listApply) {
@@ -348,6 +349,7 @@
           this.$refs.supplyListRef.init(this.row);
           
           this.$refs.commentRef.init(this.row.base);
+          this.$refs.saleOderAftersalesListRef.init();
         });
       },
       async commitComment() {

+ 4 - 0
src/views/saleManage/saleOrder/components/darwerComponents/saleOderAftersalesList.vue

@@ -7,6 +7,7 @@
       :datasource="datasource"
       cache-key="systemRoleTable"
       :pageSize="20"
+      :initLoad="false"
     >
     </ele-pro-table>
   </div>
@@ -203,6 +204,9 @@
           ...where,
           orderId: this.saleOrderData.id
         });
+      },
+      init() {
+        this.$refs.table.reload({ page: 1 });
       }
       // async declarationForm(row, type) {
       //   if (type === 'view') {