fix
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
v-if="hasPermission('formal_settlement_payment')"
|
||||
type="primary"
|
||||
plain
|
||||
disabled
|
||||
:disabled="!selection.length"
|
||||
@click="$emit('payment')"
|
||||
>付款申请</el-button
|
||||
>
|
||||
@@ -20,7 +20,7 @@
|
||||
v-if="hasPermission('formal_settlement_sync')"
|
||||
type="primary"
|
||||
plain
|
||||
disabled
|
||||
:disabled="selection.length !== 1"
|
||||
@click="$emit('sync')"
|
||||
>同步金蝶</el-button
|
||||
>
|
||||
@@ -46,13 +46,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
v-loading="loading"
|
||||
:data="rows"
|
||||
border
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
||||
<el-table-column type="selection" width="52" fixed="left" align="center" />
|
||||
<el-table-column
|
||||
v-for="column in columns"
|
||||
:key="column.prop"
|
||||
@@ -131,17 +134,40 @@ export default {
|
||||
page: { type: Object, required: true },
|
||||
hasPermission: { type: Function, required: true },
|
||||
},
|
||||
emits: ['create', 'payment', 'sync', 'print', 'export', 'refresh', 'page-change', 'action'],
|
||||
emits: [
|
||||
'create',
|
||||
'payment',
|
||||
'sync',
|
||||
'print',
|
||||
'export',
|
||||
'refresh',
|
||||
'page-change',
|
||||
'action',
|
||||
'update:selection',
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
Refresh,
|
||||
selection: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
rows() {
|
||||
this.selection = [];
|
||||
this.$refs.tableRef?.clearSelection();
|
||||
this.$emit('update:selection', this.selection);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(row) {
|
||||
this.selection = row ? [row] : [];
|
||||
this.$emit('update:selection', this.selection);
|
||||
if (!row && this.selection.length === 1) {
|
||||
this.selection = [];
|
||||
this.$emit('update:selection', this.selection);
|
||||
}
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.selection = selection;
|
||||
this.$emit('update:selection', selection);
|
||||
},
|
||||
emitAction(type, row) {
|
||||
this.$emit('action', { type, row });
|
||||
|
||||
Reference in New Issue
Block a user