zhouwx
2024-11-21 a6a8e49af8c8172f4209dd94e65f53f17825cc44
src/views/safetyReview/projectManage/components/basicInfo.vue
@@ -98,7 +98,7 @@
  formData: {
    id:null,
    deptId: null,
    deptName:'危险化学品监督管理处',
    deptName:'',
    projectName: '',
    projectDateStart: '',
    projectDateEnd: '',
@@ -115,7 +115,7 @@
    remark: [{ required: true, message: "概况描述不能为空", trigger: "blur" }],
  }
})
const formRef = ref();
const userInfo = ref()
onMounted(() => {
  userInfo.value = JSON.parse(Cookies.get('userInfo'))
@@ -126,7 +126,12 @@
const riskOpen = async (type,val) => {
  console.log("type",type,val)
  let valid = null
  if(type === 'add' || type === 'clickEdit'){
    valid = await formRef.value.validate();
  }
  if(type === 'add'){
    if(valid){
    //保存按钮
    const {id,...data} = state.formData
    const res = await addProject(data);
@@ -137,7 +142,9 @@
    }else{
      ElMessage.warning(res.message)
    }
    }
  }else if(type === 'clickEdit'){
    if(valid){
    //变更按钮
    const {...data} = state.formData
    const res = await addProject(data);
@@ -146,7 +153,7 @@
    }else{
      ElMessage.warning(res.message)
    }
    }
  }else if(type === 'detail'){
    const res = await getProjectInfo(val)
    if(res.code == 200){
@@ -170,8 +177,9 @@
}
const reset = () => {
  state.formData =  {
    id:null,
    deptId: null,
    deptName:'危险化学品监督管理处',
    deptName:'',
    projectName: '',
    projectDateStart: '',
    projectDateEnd: '',