|
@@ -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)">
|