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