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