fix : 项目实施台账刷新
This commit is contained in:
@@ -306,8 +306,7 @@ const search = (val) => {
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
onActivated(()=>{
|
||||
search()
|
||||
// tableIns.value.refresh()
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ const rules = reactive({
|
||||
digest: [{required: true, message: '请输入摘要', trigger: 'blur'}],
|
||||
afterTax: [{required: true, message: '请输入税后余额', trigger: 'blur'}]
|
||||
})
|
||||
const tableForm = reactive({
|
||||
const tableForm = ref({
|
||||
tableData: [
|
||||
{
|
||||
projectId: route.query.id,
|
||||
@@ -164,10 +164,10 @@ const handleAdd = () => {
|
||||
digest: '',
|
||||
afterTax: null
|
||||
}
|
||||
tableForm.tableData.push(row)
|
||||
tableForm.value.tableData.push(row)
|
||||
}
|
||||
const handleDelete = (index) => {
|
||||
tableForm.tableData.splice(index, 1)
|
||||
tableForm.value.tableData.splice(index, 1)
|
||||
}
|
||||
const handleSubmit = (instance) => {
|
||||
if (!instance) return
|
||||
@@ -181,10 +181,10 @@ const handleSubmit = (instance) => {
|
||||
return;
|
||||
}
|
||||
instance.clearValidate()
|
||||
tableForm.tableData.forEach(item => {
|
||||
tableForm.value.tableData.forEach(item => {
|
||||
item.projectName = projectName.value
|
||||
})
|
||||
const res = await addLedger(tableForm.tableData)
|
||||
const res = await addLedger(tableForm.value.tableData)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
@@ -204,6 +204,20 @@ const handleSubmit = (instance) => {
|
||||
const handleBack = () => {
|
||||
history.back()
|
||||
}
|
||||
onActivated(()=>{
|
||||
tableForm.value = {
|
||||
tableData: [
|
||||
{
|
||||
projectId: route.query.id,
|
||||
time: '',
|
||||
projectCost: '',
|
||||
researchStage: '',
|
||||
digest: '',
|
||||
afterTax: null
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
:deep(.el-table--enable-row-transition) {
|
||||
|
||||
Reference in New Issue
Block a user