Browse Source

需求池442 当登记状态已完成时,合规信息无编辑、开票登记、到款登记功能

hbchen 1 year ago
parent
commit
491a9bdddd
2 changed files with 19 additions and 7 deletions
  1. 2 2
      .env.development
  2. 17 5
      src/views/financialManagement/financialList.vue

+ 2 - 2
.env.development

@@ -1,5 +1,5 @@
 # 接口地址
-VITE_APP_API_URL="http://192.168.77.4:8619/api"
-# VITE_APP_API_URL="http://8.136.199.33:8619/api"
+# VITE_APP_API_URL="http://192.168.77.4:8619/api"
+VITE_APP_API_URL="http://8.136.199.33:8619/api"
 # crm系统地址
 VITE_CRM_SYSTEM_URL="https://rddptest.hzinsights.com/login"

+ 17 - 5
src/views/financialManagement/financialList.vue

@@ -207,6 +207,15 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
       })
     }).catch(()=>{})
   }
+  /**
+   * 设置row-key,优化表格渲染,主要由于表格操作栏混合使用了 v-permission指令和v-if指令,猜测el-table底层默认是用索引作为每行的key值
+   * 可能造导致vue3底层更新表格 在对比 新树和老树 时通过索引找到的不是原来的Node,导致报错,故给表格行设置唯一的key值
+   * 以上纯属瞎猜
+   */
+  const setRowKey=(row)=>{
+    return row.contract_register_id
+  }
+
   //  ---------------------created
   // 由于三级路由还是在当前页面,所以判断路径,避免重复请求
   if(route.path=='/financial/list'){
@@ -300,7 +309,8 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
           </div>
           <div class="financial-table-zone">
             <!-- 表格 -->
-            <el-table :data="financial.tableData" border max-height="640px" size="default"> 
+            <el-table :data="financial.tableData" border max-height="640px" size="default" 
+            :row-key="setRowKey"> 
               <el-table-column label="合同编号" align="center" show-overflow-tooltip 
               prop="contract_code" fixed="left" min-width="150"></el-table-column>
               <el-table-column label="客户名称" align="center" prop="company_name"
@@ -379,8 +389,8 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
                       @click="registration('view',row.contract_register_id)">
                         查看
                       </span>
-                      <span class="table-option-buttons" v-permission="'financial:list:complianceEdit'"
-                      @click="registration('compliance',row.contract_register_id)">
+                      <span class="table-option-buttons" v-if="row.register_status!=2" v-permission="'financial:list:complianceEdit'"
+                      @click="registration('compliance',row.contract_register_id)" >
                         编辑
                       </span>
                       <span class="table-option-buttons"  v-permission="'financial:list:delete'"
@@ -388,11 +398,13 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
                         删除
                       </span>
                       <span class="table-option-buttons" v-permission="'financial:list:invoice'"
-                      @click="registration('invoice',row.contract_register_id)" v-if="row.has_invoice==1 && row.contract_status!=4">
+                      @click="registration('invoice',row.contract_register_id)" 
+                      v-if="row.has_invoice==1 && row.contract_status!=4 && row.register_status!=2">
                         开票登记
                       </span>
                       <span class="table-option-buttons" v-permission="'financial:list:placement'"
-                      @click="registration('placement',row.contract_register_id)" v-if="row.has_invoice==1 && row.contract_status!=4">
+                      @click="registration('placement',row.contract_register_id)" 
+                      v-if="row.has_invoice==1 && row.contract_status!=4 && row.register_status!=2">
                         到款登记
                       </span>
                       <span class="table-option-buttons" @click="changeContractStatus(row)">