fix : 修复项目归档开启/关闭上传文件二次确认
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||||
import {toThousands} from '@/utils/changePrice.js'
|
import {toThousands} from '@/utils/changePrice.js'
|
||||||
import {switchAttachmentState} from "@/api/project-manage/attachment";
|
import {switchAttachmentState} from "@/api/project-manage/attachment";
|
||||||
|
import {ElMessageBox} from "element-plus";
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const shortcuts = [
|
const shortcuts = [
|
||||||
@@ -246,10 +247,10 @@ const tableConfig = reactive({
|
|||||||
btn.push({label: '编辑', prem: ['project:management:filing:conclusion'], func: () => handleEdit(row), type: 'primary'})
|
btn.push({label: '编辑', prem: ['project:management:filing:conclusion'], func: () => handleEdit(row), type: 'primary'})
|
||||||
}
|
}
|
||||||
if (buttons.has("openFileSwitch")) {
|
if (buttons.has("openFileSwitch")) {
|
||||||
btn.push({label: '开启上传', prem: ['project:management:filing:conclusion'], func: () => handleOpenUpload(row), type: 'primary'})
|
btn.push({label: '开启上传', prem: ['project:management:filing:conclusion'], func: () => handleOpenUpload(row,true), type: 'primary'})
|
||||||
}
|
}
|
||||||
if (buttons.has("closeFileSwitch")) {
|
if (buttons.has("closeFileSwitch")) {
|
||||||
btn.push({label: '关闭上传', prem: ['project:management:filing:conclusion'], func: () => handleCloseUpload(row), type: 'primary'})
|
btn.push({label: '关闭上传', prem: ['project:management:filing:conclusion'], func: () => handleOpenUpload(row,false), type: 'primary'})
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div style={{width: '100%'}}>
|
<div style={{width: '100%'}}>
|
||||||
@@ -323,24 +324,19 @@ const handleEdit = (row) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleOpenUpload=(row)=>{
|
const handleOpenUpload=(row,flag)=>{
|
||||||
let params={
|
ElMessageBox.confirm(`是否确认${flag?'开启':'关闭'}上传文件?`, '提示', {
|
||||||
open: true,
|
confirmButtonText: '确定',
|
||||||
projectId: row.projectId
|
cancelButtonText: '取消',
|
||||||
}
|
type: 'warning'
|
||||||
switchAttachmentState(params).then(res=>{
|
}).then(() => {
|
||||||
console.log('res',res)
|
let params={
|
||||||
tableIns.value.refresh()
|
open: flag,
|
||||||
})
|
projectId: row.projectId
|
||||||
}
|
}
|
||||||
const handleCloseUpload=(row)=>{
|
switchAttachmentState(params).then(res=>{
|
||||||
let params={
|
tableIns.value.refresh()
|
||||||
open: false,
|
})
|
||||||
projectId: row.projectId
|
|
||||||
}
|
|
||||||
switchAttachmentState(params).then(res=>{
|
|
||||||
console.log('res',res)
|
|
||||||
tableIns.value.refresh()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user