|
|
@ -15,6 +15,7 @@ |
|
|
|
:loading="loading" |
|
|
|
:loading="loading" |
|
|
|
:columns="columns" |
|
|
|
:columns="columns" |
|
|
|
:dataSource="dataSource" |
|
|
|
:dataSource="dataSource" |
|
|
|
|
|
|
|
@valueChange="handleValueChange" |
|
|
|
@save="handleTableSave" |
|
|
|
@save="handleTableSave" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</a-card> |
|
|
|
</a-card> |
|
|
@ -68,11 +69,11 @@ const columns = ref<JVxeColumn[]>([ |
|
|
|
// 列的宽度 |
|
|
|
// 列的宽度 |
|
|
|
width: 260, |
|
|
|
width: 260, |
|
|
|
// 如果加上了该属性,就代表当前单元格是可编辑的,type就是表单的类型,input就是简单的输入框 |
|
|
|
// 如果加上了该属性,就代表当前单元格是可编辑的,type就是表单的类型,input就是简单的输入框 |
|
|
|
type: JVxeTypes.inputNumber, |
|
|
|
type: JVxeTypes.normal, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ key: 'specialFee', title: '专项经费', width: 260, type: JVxeTypes.inputNumber }, |
|
|
|
{ key: 'specialFee', title: '专项经费', width: 260, type: JVxeTypes.inputNumber }, |
|
|
|
{ key: 'selfFee', title: '自筹经费', width: 260, type: JVxeTypes.inputNumber }, |
|
|
|
{ key: 'selfFee', title: '自筹经费', width: 130, type: JVxeTypes.inputNumber }, |
|
|
|
{ key: 'specialFeeMark', title: '专项经费说明', width: 260, type: JVxeTypes.textarea }, |
|
|
|
{ key: 'specialFeeMark', title: '专项经费说明', width: 380, type: JVxeTypes.textarea }, |
|
|
|
]); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
// 查询url地址 |
|
|
|
// 查询url地址 |
|
|
@ -88,6 +89,31 @@ enum Api { |
|
|
|
|
|
|
|
|
|
|
|
loadData(); |
|
|
|
loadData(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 当选择的行变化时触发的事件 |
|
|
|
|
|
|
|
function handleSelectRowChange(event) { |
|
|
|
|
|
|
|
/*console.log("handleSelectRowChange") |
|
|
|
|
|
|
|
selectedRows.value = event.selectedRows; |
|
|
|
|
|
|
|
console.log("handleSelectRowChange-event:", event) |
|
|
|
|
|
|
|
const {type, row, column, value, target, $table} = event |
|
|
|
|
|
|
|
// row.totalFee = event.value; |
|
|
|
|
|
|
|
console.log('--------------------') |
|
|
|
|
|
|
|
console.log('selfFee',row.selfFee) |
|
|
|
|
|
|
|
console.log('totalFee',row.totalFee)*/ |
|
|
|
|
|
|
|
// target.$refs.vxe.columns[4].options = this.stationIdList; |
|
|
|
|
|
|
|
// target.$refs.vxe.columns[17].options = this.userIdList; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleValueChange(event) { |
|
|
|
|
|
|
|
console.log('handleValueChange.event: ', event); |
|
|
|
|
|
|
|
const {type, row, column, value, target, $table} = event |
|
|
|
|
|
|
|
/*console.log('selfFee',row.specialFee) |
|
|
|
|
|
|
|
console.log('selfFee',row.selfFee) |
|
|
|
|
|
|
|
console.log('--------------------')*/ |
|
|
|
|
|
|
|
row.totalFee = row.selfFee + row.specialFee; |
|
|
|
|
|
|
|
console.log('the new totalFee',row.totalFee) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 加载数据 |
|
|
|
// 加载数据 |
|
|
|
async function loadData() { |
|
|
|
async function loadData() { |
|
|
|
loading.value = true; |
|
|
|
loading.value = true; |
|
|
@ -140,6 +166,7 @@ function handleTableSave({ $table, target }) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
createMessage.success(`保存成功!`); |
|
|
|
createMessage.success(`保存成功!`); |
|
|
|
|
|
|
|
loadData(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
.finally(() => { |
|
|
|
loading.value = false; |
|
|
|
loading.value = false; |
|
|
@ -170,6 +197,7 @@ function handleTableSave({ $table, target }) { |
|
|
|
function handleEditClosed(event) { |
|
|
|
function handleEditClosed(event) { |
|
|
|
let { $table, row, column } = event; |
|
|
|
let { $table, row, column } = event; |
|
|
|
let field = column.property; |
|
|
|
let field = column.property; |
|
|
|
|
|
|
|
// console.log('field',field); |
|
|
|
// 判断单元格值是否被修改 |
|
|
|
// 判断单元格值是否被修改 |
|
|
|
if ($table.isUpdateByRow(row, field)) { |
|
|
|
if ($table.isUpdateByRow(row, field)) { |
|
|
|
// 校验当前行 |
|
|
|
// 校验当前行 |
|
|
@ -177,9 +205,9 @@ function handleEditClosed(event) { |
|
|
|
// 校验通过 |
|
|
|
// 校验通过 |
|
|
|
if (!errMap) { |
|
|
|
if (!errMap) { |
|
|
|
// 【模拟保存】 |
|
|
|
// 【模拟保存】 |
|
|
|
let hideLoading = createMessage.loading(`正在保存"${column.title}"`, 0); |
|
|
|
// let hideLoading = createMessage.loading(`正在保存"${column.title}"`, 0); |
|
|
|
console.log('即时保存数据:', row); |
|
|
|
console.log('-----handleEditClosed()--即时保存行row数据:', JSON.stringify(row)); |
|
|
|
defHttp |
|
|
|
/*defHttp |
|
|
|
.put({ |
|
|
|
.put({ |
|
|
|
url: Api.saveRow, |
|
|
|
url: Api.saveRow, |
|
|
|
params: row, |
|
|
|
params: row, |
|
|
@ -191,7 +219,7 @@ function handleEditClosed(event) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
.finally(() => { |
|
|
|
hideLoading(); |
|
|
|
hideLoading(); |
|
|
|
}); |
|
|
|
});*/ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -207,9 +235,9 @@ function handlePageChange(event) { |
|
|
|
}*/ |
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
// 当选择的行变化时触发的事件 |
|
|
|
// 当选择的行变化时触发的事件 |
|
|
|
function handleSelectRowChange(event) { |
|
|
|
// function handleSelectRowChange(event) { |
|
|
|
selectedRows.value = event.selectedRows; |
|
|
|
// selectedRows.value = event.selectedRows; |
|
|
|
} |
|
|
|
// } |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped></style> |
|
|
|
<style scoped></style> |
|
|
|