|
@@ -158,12 +158,13 @@
|
|
|
element-loading-text="Loading"
|
|
|
border
|
|
|
fit
|
|
|
+
|
|
|
:row-style="rowClass"
|
|
|
show-summary
|
|
|
:summary-method="$getSummaries"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column align="center" type="selection" width="55" fixed="left" />
|
|
|
+ <el-table-column align="center" type="selection" width="55" fixed="left" :selectable="selectable" />
|
|
|
<el-table-column align="left" label="订单类型" prop="type" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.type | orderTypeFilter }}
|
|
@@ -696,6 +697,22 @@ export default {
|
|
|
}).then(res => {
|
|
|
this.categoryList = res.data.records
|
|
|
})
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 根据条件禁用行复选框
|
|
|
+ * 函数返回值为false则禁用选择(反之亦然)
|
|
|
+ * @param {Object} row - 行数据
|
|
|
+ * @param {String} index - 索引值
|
|
|
+ * @return Boolean
|
|
|
+ */
|
|
|
+ selectable: function(row, index) {
|
|
|
+ if (row.automaticStatus) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ // 函数必须有返回值且是布尔值
|
|
|
+ // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
|
|
|
+ // 如果没有返回值则默认返回false(全部无法选中)
|
|
|
}
|
|
|
}
|
|
|
}
|