<template>
|
<div class="system-menu-dialog-container">
|
<el-dialog :title="applyStartDialogState.title" v-model="applyStartDialogState.applyStartDialogVisible" width="600px">
|
<el-form ref="applyStartFormRef" :rules="applyStartDialogState.applyStartFormRules" :model="applyStartDialogState.applyStartForm" size="default" label-width="160px">
|
<el-row :gutter="35">
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
<el-form-item label="实验开始时间" prop="startTime">
|
<el-date-picker type="datetime" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" v-model="applyStartDialogState.applyStartForm.startTime" class="input-length"/>
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
<el-form-item label="是否是安全信息化系统 " prop="sisStatus">
|
<el-radio-group v-model="applyStartDialogState.applyStartForm.sisStatus">
|
<el-radio :label="1">是</el-radio>
|
<el-radio :label="2">否</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="applyStartDialogState.applyStartForm.sisStatus==1">
|
<el-form-item label="安全信息化系统名称" prop="safeInformationSystem">
|
<el-input v-model="applyStartDialogState.applyStartForm.safeInformationSystem" placeholder="材料类型" class="input-length">
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<template #footer>
|
<span class="dialog-footer">
|
<el-button @click="applyStartDialogState.applyStartDialogVisible = !applyStartDialogState.applyStartDialogVisible" size="default">取 消</el-button>
|
<el-button type="primary" @click="onSubmitApplyStart" size="default">确定</el-button>
|
</span>
|
</template>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script setup lang="ts">
|
import { reactive, ref } from "vue";
|
import {ElMessage} from "element-plus";
|
import {projectApi} from "/@/api/experiment/project";
|
|
const applyStartFormRef = ref()
|
|
const applyStartDialogState = reactive<ApplyStartDialogType>({
|
title: '转为已开展',
|
applyStartDialogVisible: false,
|
applyStartForm: {
|
id: null,
|
sisStatus: null,
|
safeInformationSystem: '',
|
startTime: '',
|
},
|
applyStartFormRules: {
|
|
},
|
})
|
|
const showApplyStartDialog = (value: ProjectType) => {
|
applyStartDialogState.applyStartDialogVisible = true;
|
applyStartDialogState.applyStartForm = {
|
id: null,
|
sisStatus: null,
|
safeInformationSystem: '',
|
startTime: ''
|
},
|
applyStartDialogState.applyStartForm.id = <number>value.id
|
};
|
|
const onSubmitApplyStart = () => {
|
applyStartFormRef.value.validate(async(valid: boolean) => {
|
if(valid){
|
if(applyStartDialogState.applyStartForm.sisStatus == 2){
|
applyStartDialogState.applyStartForm.safeInformationSystem = ''
|
}
|
let res = await projectApi().applyProject([applyStartDialogState.applyStartForm]);
|
if(res.data.code === 100){
|
emit('refresh')
|
applyStartDialogState.applyStartDialogVisible = false;
|
ElMessage({
|
type: 'success',
|
message: '申请开展成功'
|
})
|
}else{
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg,
|
});
|
}
|
}else{
|
ElMessage({
|
type: 'warning',
|
message: '请完善基本信息',
|
});
|
}
|
})
|
};
|
|
const emit = defineEmits(['refresh'])
|
|
defineExpose({
|
showApplyStartDialog
|
})
|
</script>
|
|
<style scoped>
|
|
</style>
|