|
|
|
@ -25,11 +25,13 @@ |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-table |
|
|
|
ref="poTable" |
|
|
|
:height="height" |
|
|
|
:data="dataList" |
|
|
|
border |
|
|
|
highlight-current-row |
|
|
|
style="width: 100%;"> |
|
|
|
style="width: 100%;" |
|
|
|
@current-change="onTableCurrentChange"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item, index) in visibleColumns" |
|
|
|
:key="item.serialNumber || index" |
|
|
|
@ -42,9 +44,12 @@ |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- 编辑态:customEditColumnProps 中的列走「自定义」分支,其余走默认 select/num/text - rqrq --> |
|
|
|
<template v-if="editMode && item.editAble && (1!=1)"> |
|
|
|
<!-- rqrq 自定义编辑:在下面增加 <template v-if="item.columnProp === 'xxx'">...</template>,变更后 onCellChange(scope.row) --> |
|
|
|
<template v-if="item.columnProp==='XXX'"> |
|
|
|
|
|
|
|
<span style="color: #c0c4cc">—</span> |
|
|
|
</template> |
|
|
|
<template v-else-if="item.columnProp==='XXXX'"> |
|
|
|
|
|
|
|
<span style="color: #c0c4cc">—</span> |
|
|
|
</template> |
|
|
|
<template v-else-if="editMode && item.editAble"> |
|
|
|
@ -165,6 +170,8 @@ export default { |
|
|
|
* 示例:['mPlanner', 'comments'] |
|
|
|
*/ |
|
|
|
customEditColumnProps: [], |
|
|
|
|
|
|
|
currentRow: null, |
|
|
|
// 各列下拉:select 列通过 selectOptionsKey 指向此处;也可在列定义里写 selectOptions 数组 - rqrq |
|
|
|
columnSelectOptions: { |
|
|
|
poStatusOptions: [ |
|
|
|
@ -1122,6 +1129,16 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/** |
|
|
|
* 表格当前行变化:将选中行深拷贝到 currentRow;取消选中时为 null - rqrq |
|
|
|
*/ |
|
|
|
onTableCurrentChange (row) { |
|
|
|
if (!row) { |
|
|
|
this.currentRow = null |
|
|
|
return |
|
|
|
} |
|
|
|
this.currentRow = row |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 解析列对应的下拉选项:优先列上 selectOptions,其次 columnSelectOptions[selectOptionsKey] |
|
|
|
|