|
|
@@ -106,14 +106,7 @@
|
|
|
@click="handleSubmitFormal(row)"
|
|
|
>提交立项</el-button
|
|
|
>
|
|
|
- <el-button
|
|
|
- v-if="canApprove(row)"
|
|
|
- link
|
|
|
- type="success"
|
|
|
- v-hasPermi="['rd:project:approve']"
|
|
|
- @click="openApprove(row)"
|
|
|
- >审批</el-button
|
|
|
- >
|
|
|
+
|
|
|
<el-button
|
|
|
v-if="canEdit(row)"
|
|
|
link
|
|
|
@@ -423,6 +416,7 @@ import { computed, reactive, ref, onMounted } from 'vue'
|
|
|
import { ElMessage, ElMessageBox, type FormRules } from 'element-plus'
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
|
import { getSimpleDeptList } from '@/api/system/dept'
|
|
|
+import { getUserProfile } from '@/api/system/user/profile'
|
|
|
import {
|
|
|
getProjectPage,
|
|
|
getProject,
|
|
|
@@ -462,6 +456,7 @@ const defaultProps = {
|
|
|
value: 'id'
|
|
|
}
|
|
|
const deptList = ref<any[]>([])
|
|
|
+let deptId = ref('')
|
|
|
|
|
|
// ========== 类型 ==========
|
|
|
type ScheduleItem = { workPlan: string; deadline: string; sort?: number }
|
|
|
@@ -602,7 +597,7 @@ const createBudgetDetail = (): BudgetDetail => ({
|
|
|
|
|
|
// formData 中【不包含】任何附件字段
|
|
|
const createForm = () => ({
|
|
|
- deptId: null as number | null,
|
|
|
+ deptId: deptId.value,
|
|
|
projectLevel: '',
|
|
|
executingUnit: null as number | null,
|
|
|
projectName: '',
|
|
|
@@ -656,6 +651,7 @@ const openForm = async (project?: any) => {
|
|
|
formData.value = {
|
|
|
...createForm(),
|
|
|
...data,
|
|
|
+ deptId: deptId.value,
|
|
|
scheduleList: data.scheduleList?.length ? data.scheduleList : [createSchedule()],
|
|
|
budgetList: data.budgetList?.length ? data.budgetList : [createBudgetDetail()]
|
|
|
}
|
|
|
@@ -814,6 +810,11 @@ const removeProject = async (id: number) => {
|
|
|
await getList()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ const data = await getUserProfile()
|
|
|
+ deptId.value = data.dept.id
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|