| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" title="新建目标责任书" width="50%" draggable> |
| | | <el-dialog v-model="dialogVisible" :before-close="resetForm" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" label-width="120px"> |
| | | <el-form :model="form" :disabled="disabled" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="岗位"> |
| | | <el-input v-model="form.name" placeholder="请选择"> |
| | | <el-form-item label="岗位" size="default"> |
| | | <el-input v-model="form.jobId" placeholder="请选择"> |
| | | <template #append> <el-button :icon="Search" @click="daiInpt" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="责任书签订日期"> |
| | | <el-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%" /> |
| | | <el-form-item label="责任书签订日期" size="default"> |
| | | <el-date-picker v-model="form.signDate" style="width:100%" format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择日期时间" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注信息"> |
| | | <el-input v-model="form.name" type="textarea" /> |
| | | <el-input v-model="form.memo" type="textarea" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> |
| | | <el-button @click="resetForm" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <DailogSearch ref="Shows"></DailogSearch> |
| | | <DailogSearch ref="Shows" @backNum="IdNumber"></DailogSearch> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | |
| | | import DailogSearch from './DailogSearch.vue'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import type { UploadProps, UploadUserFile } from 'element-plus'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | export default defineComponent({ |
| | | components: { DailogSearch }, |
| | | setup() { |
| | | setup(props, { emit }) { |
| | | const dialogVisible = ref<boolean>(false); |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | const form = ref({ |
| | | indexNum: '', //目标指标编号 |
| | | memo: '', ////备注信息 |
| | | signDate: '', //责任书签订日期 |
| | | extraFile: '666', //责任书附件 |
| | | jobId: '', //岗位 |
| | | }); |
| | | const openDailog = (type: string, value: any, projectList: any, projectId: string) => { |
| | | const titles = ref(); |
| | | const disabled = ref(false); |
| | | // 打开弹窗 |
| | | const openDailog = (title: string, value: any, id: number) => { |
| | | dialogVisible.value = true; |
| | | titles.value =`${title}目标责任书`; |
| | | disabled.value = title == '查看' ? true : false; |
| | | if (title == '查看' || title == '修改') |
| | | goalManagementApi() |
| | | .gettargetDutyfileInfoDetail(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | form.value = res.data.data; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | // 导航 |
| | | const activeName = ref('1'); |
| | | // 表格 |
| | | |
| | | // 提交 |
| | | const submitForm = () => { |
| | | dialogVisible.value = false; |
| | | goalManagementApi() |
| | | .gettargetDutyfileInfoAddorUpdata(form.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | emit('navAddorUpdata'); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | form.value = { |
| | | indexNum: '', //目标指标编号 |
| | | memo: '', ////备注信息 |
| | | signDate: '', //责任书签订日期 |
| | | extraFile: '666', //责任书附件 |
| | | jobId: '', //岗位 |
| | | }; |
| | | }; |
| | | // 取消 |
| | | const resetForm = () => { |
| | | dialogVisible.value = false; |
| | | form.value = { |
| | | indexNum: '', //目标指标编号 |
| | | memo: '', ////备注信息 |
| | | signDate: '', //责任书签订日期 |
| | | extraFile: '666', //责任书附件 |
| | | jobId: '', //岗位 |
| | | }; |
| | | }; |
| | | // 安全目标指标弹窗 |
| | | const Shows = ref(); |
| | | const daiInpt = () => { |
| | | Shows.value.openDailog(); |
| | | }; |
| | | const IdNumber=(val:any)=>{ |
| | | form.value.jobId=val.id |
| | | } |
| | | // 点击上传 |
| | | const fileList = ref<UploadUserFile[]>([ |
| | | { |
| | |
| | | } |
| | | }; |
| | | return { |
| | | form, |
| | | IdNumber, |
| | | dialogVisible, |
| | | form, |
| | | disabled, |
| | | titles, |
| | | openDailog, |
| | | activeName, |
| | | Shows, |
| | | daiInpt, |
| | | submitForm, |
| | | resetForm, |
| | | Shows, |
| | | Search, |
| | | fileList, |
| | | handleRemove, |