对比新文件 |
| | |
| | | export function timeDate(row: any, column: any, cellValue: any, index: any) { |
| | | const daterc = row[column.property] |
| | | if (daterc != null) { |
| | | var date = new Date(daterc); |
| | | var year = date.getFullYear(); |
| | | /* 在日期格式中,月份是从0开始,11结束,因此要加0 |
| | | * 使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05 |
| | | * */ |
| | | var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1; |
| | | var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(); |
| | | var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(); |
| | | var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); |
| | | var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); |
| | | // 拼接 |
| | | return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds; |
| | | } |
| | | } |
| | |
| | | openDailog, |
| | | ruleForm, |
| | | tableData, |
| | | currentPage4, |
| | | total, |
| | | pageSize4, |
| | | resetForm, |
| | | listApi, |
| | |
| | | </div> |
| | | <el-table ref="multipleTableRef" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" align="center" width="55" /> |
| | | <el-table-column property="createTime" align="center" label="奖惩日期" sortable /> |
| | | <el-table-column property="createTime" align="center" label="奖惩日期" :formatter="timeDate" sortable /> |
| | | <el-table-column label="奖惩类型" align="center" sortable> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.standardType == 1">奖励</span> |
| | |
| | | </template> |
| | | <script lang="ts"> |
| | | import DailogAdd from './component/DailogAdd.vue'; |
| | | import {timeDate} from '/@/assets/index.ts' |
| | | import DailogSearchUser from '/@/components/DailogSearchUser/index.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | |
| | | ruleForm.searchParams.personId = val.uid; |
| | | }; |
| | | return { |
| | | timeDate, |
| | | ruleForm, |
| | | userId, |
| | | resetForm, |
| | |
| | | <el-table-column type="selection" align="center" width="55" /> |
| | | <el-table-column type="index" label="序号" align="center" width="70" /> |
| | | <el-table-column property="jobId" align="center" label="岗位" sortable /> |
| | | <el-table-column property="signDate" align="center" label="责任书签订日期" sortable /> |
| | | <el-table-column property="signDate" align="center" label="责任书签订日期" :formatter="timeDate" sortable /> |
| | | <el-table-column property="extraFile" align="center" label="附件" sortable /> |
| | | <el-table-column property="memo" label="备注信息" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column label="操作" align="center" style="width: 300px"> |
| | |
| | | </template> |
| | | <script lang="ts"> |
| | | import DailogAdd from './component/DailogAdd.vue'; |
| | | import {timeDate} from '/@/assets/index.ts' |
| | | import DailogSearch from './component/DailogSearch.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | |
| | | onDeleteAll, |
| | | openUser, |
| | | openSearch, |
| | | timeDate, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" @close="handleClose(ruleFormRef)" :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" label-width="120px" ref="ruleFormRef" :rules="rules"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="考核标题" size="default"> |
| | | <el-input v-model="form.title"></el-input> |
| | | <el-form-item label="考核标题" size="default" prop="title"> |
| | | <el-input v-model="form.title" placeholder="请填写考核标题"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="考核日期" size="default"> |
| | | <el-form-item label="考核日期" size="default" prop="examineDate"> |
| | | <el-date-picker v-model="form.examineDate" format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="合格分数" size="default"> |
| | | <el-input v-model="form.name" disabled /> |
| | | <el-form-item label="合格分数" size="default" prop="acceptanceNumber"> |
| | | <el-input v-model="form.acceptanceNumber" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="总分" size="default"> |
| | | <el-input v-model="form.examineTotalNumber" /> |
| | | <el-form-item label="总分" size="default" prop="examineTotalNumber"> |
| | | <el-input v-model="form.examineTotalNumber" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="考核部门" size="default"> |
| | | <el-tree-select v-model="form.examineDepartmentId" :data="data" class="w100" :props="propse" placeholder="请选择" /> |
| | | <el-form-item label="考核部门" size="default" prop="examineDepartmentId"> |
| | | <el-tree-select |
| | | v-model="form.examineDepartmentId" |
| | | :data="data" |
| | | class="w100" |
| | | @node-click="nameData1" |
| | | :props="propse" |
| | | check-strictly |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="考核人" size="default"> |
| | | <el-input v-model="form.examinePersonId"> |
| | | <el-form-item label="考核人" size="default" prop="examinePersonName"> |
| | | <el-input v-model="form.examinePersonName"> |
| | | <template #append> <el-button :icon="Search" @click="daiInpt(1)" /></template> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="被考核部门" size="default"> |
| | | <el-tree-select v-model="form.beExaminedDepartmentId" :data="data" class="w100" :props="propse" placeholder="请选择" /> |
| | | <el-form-item label="被考核部门" size="default" prop="beExaminedDepartmentId"> |
| | | <el-tree-select |
| | | v-model="form.beExaminedDepartmentId" |
| | | :data="data" |
| | | @node-click="nameData2" |
| | | class="w100" |
| | | :props="propse" |
| | | check-strictly |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="被考核人" size="default"> |
| | | <el-input v-model="form.beExaminedPersonId"> |
| | | <el-form-item label="被考核人" size="default" prop="beExaminedPersonName"> |
| | | <el-input v-model="form.beExaminedPersonName"> |
| | | <template #append> <el-button :icon="Search" @click="daiInpt(2)" /></template> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="考核模板" size="default"> |
| | | <el-input disabled v-model="form.examineTemplateId"> |
| | | <el-form-item label="考核模板" size="default" prop="examineTemplateName"> |
| | | <el-input disabled v-model="form.examineTemplateName"> |
| | | <template #append> <el-button :icon="Search" @click="daiAdd" /></template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="备注信息"> |
| | | <el-form-item label="备注信息" prop="memo"> |
| | | <el-input v-model="form.memo" type="textarea"> </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="resetForm" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm" size="default">确定</el-button> |
| | | <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import type { UploadProps, UploadUserFile } from 'element-plus'; |
| | | import type { FormInstance, FormRules } from 'element-plus'; |
| | | export default defineComponent({ |
| | | components: { DailogSearchUser, DailogSearch }, |
| | | setup(props, { emit }) { |
| | | const dialogVisible = ref<boolean>(false); |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const form = ref({ |
| | | beExaminedDepartmentId: '', ////被考核部门ID/外键 |
| | | beExaminedDepartmentName: '', |
| | | beExaminedPersonId: '', ////被考核人ID/外键(可能有多个,用逗号隔开) |
| | | beExaminedPersonName: '', |
| | | examineDate: '', ////考核日期 |
| | | examineDepartmentId: '', ////考核部门ID/外键 |
| | | examineDepartmentName: '', |
| | | examinePersonId: '', ////考核人ID/外键 |
| | | examinePersonName: '', |
| | | examineTemplateId: 1, ////绩效考核模板ID/外键 |
| | | examineTemplateName: '', |
| | | examineTotalNumber: '', ////总分 |
| | | extraFile: '9', //责任书附件 |
| | | itemDetail: '', ////考核项目 |
| | |
| | | const disabled = ref(false); |
| | | // 打开弹窗 |
| | | const openDailog = (title: string, value: any, id: number) => { |
| | | department() |
| | | department(); |
| | | dialogVisible.value = true; |
| | | titles.value = `${title}安全考核管理`; |
| | | disabled.value = title == '查看' ? true : false; |
| | |
| | | } |
| | | }); |
| | | }; |
| | | // 验证 |
| | | const rules = reactive<FormRules>({ |
| | | title: [{ required: true, message: '考核标题不能为空', trigger: 'blur' }], |
| | | examineDate: [{ required: true, message: '考核日期不能为空', trigger: 'blur' }], |
| | | examineDepartmentId: [{ required: true, message: '考核部门不能为空', trigger: 'blur' }], |
| | | examinePersonName: [], |
| | | examinePersonId: [], |
| | | beExaminedDepartmentId: [{ required: true, message: '被考核部门不能为空', trigger: 'blur' }], |
| | | beExaminedPersonName: [], |
| | | beExaminedPersonId: [], |
| | | examineTemplateId: [], |
| | | examineTemplateName: [{ required: true, message: '考核模板不能为空', trigger: 'blur' }], |
| | | memo: [], |
| | | }); |
| | | // 提交 |
| | | const submitForm = () => { |
| | | dialogVisible.value = false; |
| | | goalManagementApi() |
| | | .getexamineMngAddOrUpdate(form.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | dialogVisible.value = false; |
| | | goalManagementApi() |
| | | .getexamineMngAddOrUpdate(form.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | emit('navAddorUpdata'); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | emit('navAddorUpdata'); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | form.value = { |
| | | beExaminedDepartmentId: '', ////被考核部门ID/外键 |
| | | beExaminedPersonId: '', ////被考核人ID/外键(可能有多个,用逗号隔开) |
| | | examineDate: '', ////考核日期 |
| | | examineDepartmentId: '', ////考核部门ID/外键 |
| | | examinePersonId: '', ////考核人ID/外键 |
| | | examineTemplateId: '', ////绩效考核模板ID/外键 |
| | | examineTotalNumber: '', ////总分 |
| | | extraFile: '9', //责任书附件 |
| | | itemDetail: '', ////考核项目 |
| | | memo: '', ////备注信息 |
| | | numberDetailJson: '[{"id":"123","number":"123"}]', ////各个考核项目的具体得分,json格式。形式为:[{“id”:"123","number":"123"}] |
| | | title: '', ////考核标题 |
| | | }; |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | }; |
| | | // 取消 |
| | | const resetForm = () => { |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | dialogVisible.value = false; |
| | | form.value = { |
| | | beExaminedDepartmentId: '', ////被考核部门ID/外键 |
| | | beExaminedPersonId: '', ////被考核人ID/外键(可能有多个,用逗号隔开) |
| | | examineDate: '', ////考核日期 |
| | | examineDepartmentId: '', ////考核部门ID/外键 |
| | | examinePersonId: '', ////考核人ID/外键 |
| | | examineTemplateId: '', ////绩效考核模板ID/外键 |
| | | examineTotalNumber: '', ////总分 |
| | | extraFile: '9', //责任书附件 |
| | | itemDetail: '', ////考核项目 |
| | | memo: '', ////备注信息 |
| | | numberDetailJson: '[{"id":"123","number":"123"}]', ////各个考核项目的具体得分,json格式。形式为:[{“id”:"123","number":"123"}] |
| | | title: '', ////考核标题 |
| | | }; |
| | | formEl.resetFields(); |
| | | }; |
| | | const handleClose=(formEl: FormInstance | undefined)=>{ |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | } |
| | | const activeName = ref('1'); |
| | | // 新增弹窗 |
| | | const Show = ref(); |
| | |
| | | }; |
| | | // 安全目标指标弹窗 |
| | | const Shows = ref(); |
| | | const daiInpt = (type:any) => { |
| | | const daiInpt = (type: any) => { |
| | | Shows.value.openDailog(type); |
| | | }; |
| | | // 点击上传 |
| | |
| | | () => false |
| | | ); |
| | | }; |
| | | const userId=(val:any,type:any)=>{ |
| | | if(type==1){ |
| | | form.value.examinePersonId=val.uid |
| | | }else if(type==2){ |
| | | form.value.beExaminedPersonId=val.uid |
| | | } |
| | | } |
| | | const userId = (val: any, type: any) => { |
| | | if (type == 1) { |
| | | form.value.examinePersonId = val.uid; |
| | | form.value.examinePersonName = val.realName; |
| | | } else if (type == 2) { |
| | | form.value.beExaminedPersonId = val.uid; |
| | | form.value.beExaminedPersonName = val.realName; |
| | | } |
| | | }; |
| | | //全屏 |
| | | const full = ref(false); |
| | | const toggleFullscreen = () => { |
| | |
| | | full.value = false; |
| | | } |
| | | }; |
| | | //部门 |
| | | //部门 |
| | | const department = () => { |
| | | goalManagementApi() |
| | | .getTreedepartment() |
| | |
| | | const propse = { |
| | | label: 'depName', |
| | | children: 'children', |
| | | value:"depId" |
| | | value: 'depId', |
| | | }; |
| | | const data=ref() |
| | | const data = ref(); |
| | | const nameData1 = (val: any) => { |
| | | form.value.examineDepartmentName = val.depName; |
| | | }; |
| | | const nameData2 = (val: any) => { |
| | | form.value.beExaminedDepartmentName = val.depName; |
| | | console.log(form.value); |
| | | }; |
| | | return { |
| | | rules, |
| | | handleClose, |
| | | nameData1, |
| | | nameData2, |
| | | ruleFormRef, |
| | | department, |
| | | propse, |
| | | data, |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item size="default"> |
| | | <el-input v-model="ruleForm.pass" placeholder="标准标题" /> |
| | | <el-input v-model="ruleForm.searchParams.title" placeholder="标准标题" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="6" :offset="1"> |
| | |
| | | </el-col> --> |
| | | <el-col :span="6" :offset="1"> |
| | | <el-form-item> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">查询</el-button> |
| | | <el-button size="default" type="primary" @click="listApi()">查询</el-button> |
| | | <el-button size="default" @click="resetForm(ruleFormRef)">重置</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | style="padding: 20px 0; border-bottom: 1px solid #dedede" |
| | | v-model:currentPage="currentPage4" |
| | | v-model:page-size="pageSize4" |
| | | :page-sizes="[100, 200, 300, 400]" |
| | | :small="small" |
| | | :disabled="disabled" |
| | | :background="background" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="400" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | |
| | | <script lang="ts"> |
| | | import { defineComponent, reactive, ref } from 'vue'; |
| | | import { Delete, FullScreen } from '@element-plus/icons-vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const dialogVisible = ref<boolean>(false); |
| | | const openDailog = () => { |
| | | dialogVisible.value = true; |
| | | listApi() |
| | | }; |
| | | // 搜索条件 |
| | | const ruleForm = reactive({ |
| | | pass: '', |
| | | checkPass: '', |
| | | pageSize: 10, |
| | | pageIndex: 1, |
| | | searchParams: { |
| | | title: '', //标准标题 |
| | | }, |
| | | }); |
| | | // 表格 |
| | | const tableData = [ |
| | | { |
| | | date: '2016-05-03', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-02', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-04', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-01', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | ]; |
| | | const pageSize4 = ref(100); |
| | | const listApi = () => { |
| | | goalManagementApi() |
| | | .getexamineTemplateList(ruleForm) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | tableData.value = res.data.data; |
| | | currentPage4.value = res.data.pageIndex; |
| | | pageSize4.value = res.data.pageSize; |
| | | total.value = res.data.total; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const tableData = ref(); |
| | | const currentPage4 = ref(); |
| | | const pageSize4 = ref(); |
| | | const total = ref(); |
| | | const handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | // console.log(`${val} items per page`); |
| | | ruleForm.pageSize = val; |
| | | listApi(); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | // console.log(`current page: ${val}`); |
| | | ruleForm.pageIndex = val; |
| | | listApi(); |
| | | }; |
| | | // 右方点击添加后显示标签 |
| | | const dynamicTags = ref(['Tag 1', 'Tag 2', 'Tag 3']); |
| | |
| | | }; |
| | | return { |
| | | dialogVisible, |
| | | listApi, |
| | | openDailog, |
| | | ruleForm, |
| | | tableData, |
| | | currentPage4, |
| | | pageSize4, |
| | | total, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | dynamicTags, |
| | |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="examineDate" align="center" label="考核日期" sortable /> |
| | | <el-table-column property="beExaminedDepartmentId" align="center" label="考核部门" sortable /> |
| | | <el-table-column property="examineDate" align="center" :formatter="timeDate" label="考核日期" sortable /> |
| | | <el-table-column property="examineDepartmentName" align="center" label="考核部门" sortable /> |
| | | <el-table-column property="examinePersonId" label="考核人" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="beExaminedDepartmentId" label="被考核部门" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="beExaminedDepartmentName" label="被考核部门" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="examineTotalNumber" label="总分" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="numberDetailJson.number" label="考核结果" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="extraFile" label="附件" align="center" sortable show-overflow-tooltip /> |
| | |
| | | <el-table-column property="applyRange" align="center" label="适用范围" sortable /> |
| | | <el-table-column property="setPersonId" label="设定人" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="setPersonDepartmentId" label="设定人部门" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="createTime" label="设定日期" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="setTimem" label="设定日期" align="center" :formatter="timeDate" sortable show-overflow-tooltip /> |
| | | <el-table-column property="templateCode" label="模板分类编码" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="acceptanceNumber" label="合格分数" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column label="操作" align="center" width="250px"> |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import {timeDate} from '/@/assets/index.ts' |
| | | import DailogAq from './component/DailogAq.vue'; |
| | | import DailogKh from './component/DailogKh.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | |
| | | }; |
| | | const data = ref(); |
| | | return { |
| | | timeDate, |
| | | department, |
| | | propse, |
| | | data, |
| | |
| | | </el-form> |
| | | <el-tabs v-model="activeName" class="demo-tabs"> |
| | | <el-tab-pane label="目标指标分解" name="1"> |
| | | <el-button type="primary" size="default" @click="daiAdd" :disabled="disabled">新增</el-button> |
| | | <el-button type="primary" size="default" @click="daiAdd('新增')" :disabled="disabled">新增</el-button> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <el-table :data="formUp.targetDivideDetailList" style="width: 100%"> |
| | | <el-table-column align="center" property="dutyDepartmentId" label="责任部门" width="180" /> |
| | | <el-table-column align="center" property="value" label="考核指标" width="180" /> |
| | | <el-table-column align="center" property="makerDepartmentId" label="制定人部门" /> |
| | | <el-table-column align="center" property="makeDate" :formatter="timeDate(makeDate)" label="制定日期" /> |
| | | <el-table-column align="center" property="commitPersonId" label="上报人" /> |
| | | <el-table-column align="center" property="makeDate" label="制定日期" :formatter="timeDate"/> |
| | | <el-table-column align="center" property="commitPersonName" label="上报人" /> |
| | | <el-table-column align="center" property="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="daiAdd('查看', scope.row)">查看</el-button> |
| | |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | import {timeDate} from '/@/assets/index.ts' |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | import DailogAdd from './DailogAdd.vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext } from 'element-plus'; |
| | |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import { emit } from 'process'; |
| | | export default defineComponent({ |
| | | components: { DailogAdd, DailogSearch }, |
| | | components: { DailogAdd, DailogSearch}, |
| | | setup(props,{emit}) { |
| | | const dialogVisible = ref<boolean>(false); |
| | | const form = ref({ |
| | |
| | | // 表格 |
| | | const tableData = ref([]); |
| | | // 新增弹窗 |
| | | const index=ref<any>() |
| | | const Show = ref(); |
| | | const daiAdd = (title: string, data: any) => { |
| | | console.log(data); |
| | | index.value = formUp.targetDivideDetailList.indexOf(data); |
| | | Show.value.openDailog(title, data); |
| | | }; |
| | | const formUp = reactive({ |
| | |
| | | targetDivideDetailList: [], //目标指标分解列表 |
| | | }); |
| | | const add = (val: any) => { |
| | | formUp.targetDivideDetailList.push(val); |
| | | if(index.value==-1){ |
| | | formUp.targetDivideDetailList.push(val); |
| | | }else{ |
| | | formUp.targetDivideDetailList[index.value] = val; |
| | | } |
| | | |
| | | // let obj=JSON.parse(JSON.stringify(form.value)) |
| | | }; |
| | | // 新增 |
| | |
| | | } |
| | | }; |
| | | // 时间格式处理 |
| | | const timeDate = (data: any) => { |
| | | console.log('xxxxxxxxxxx',data) |
| | | let result = new Date(data).getTime(); |
| | | return result; |
| | | }; |
| | | // const timeDate = (data: any) => { |
| | | // let result = new Date(data).getTime(); |
| | | // return result; |
| | | // }; |
| | | return { |
| | | arr, |
| | | index, |
| | | timeDate, |
| | | arr, |
| | | form, |
| | | dialogVisible, |
| | | openDailog, |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" title="新建目标指标分解" width="50%" draggable> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" :disabled="disabled" label-width="120px" ref="ruleFormRef" :rules="rules"> |
| | | <el-row> |
| | |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="考核指标" prop="value" size="default"> |
| | | <el-input v-model="form.value" /> |
| | | <el-input v-model.number="form.value" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="上报人" prop="commitPersonId" size="default"> |
| | | <el-input v-model="nameC"> |
| | | <el-form-item label="上报人" prop="commitPersonName" size="default"> |
| | | <el-input v-model="form.commitPersonName"> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <!-- <el-button type="primary" @click="dialogVisible = false" size="default">继续添加</el-button> --> |
| | | |
| | | <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)" size="default">确定</el-button> |
| | | </span> |
| | |
| | | export default defineComponent({ |
| | | components: { DailogSearchUser }, |
| | | setup(props, { emit }) { |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const form = ref({ |
| | | dutyDepartmentId: '', ////责任部门/外键 |
| | | makerDepartmentId: '', ////制定人部门/外键 |
| | | commitPersonId: '', ////上报人/外键 |
| | | commitPersonName: '', |
| | | value: '', ////考核指标值 |
| | | makeDate: '', ////制定日期 |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | dialogVisible.value = false; |
| | | emit('onAdd', form.value); |
| | | // formEl.resetFields(); |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | dialogVisible.value = false; |
| | | if (!formEl) return |
| | | formEl.resetFields(); |
| | | }; |
| | | //部门 |
| | | const department = () => { |
| | | goalManagementApi() |
| | |
| | | }); |
| | | const disabled = ref(false); |
| | | // 开启弹窗 |
| | | const titles = ref(); |
| | | const dialogVisible = ref(false); |
| | | const openDailog = (title: string, data: any) => { |
| | | titles.value = `${title}目标指标分解`; |
| | | if (title == '查看') { |
| | | disabled.value = true; |
| | | form.value = data; |
| | |
| | | const openUser = () => { |
| | | Show.value.openDailog(); |
| | | }; |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const rules = reactive<FormRules>({ |
| | | dutyDepartmentId: [ |
| | | { |
| | |
| | | { |
| | | required: true, |
| | | message: '上报人不能为空', |
| | | trigger: 'change', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | value: [ |
| | | { |
| | | required: true, |
| | | message: '考核指标值不能为空', |
| | | trigger: 'change', |
| | | trigger: 'blur', |
| | | }, |
| | | { |
| | | type: 'number', |
| | | message: '考核指标值只能为数字类型', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | makeDate: [ |
| | | { |
| | | required: true, |
| | | message: '制定日期不能为空', |
| | | trigger: 'change', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | commitPersonName: [], |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | emit('onAdd', form.value); |
| | | dialogVisible.value = false; |
| | | // handleClose(formEl) |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | // console.log(formEl); |
| | | if (!formEl) return |
| | | formEl.resetFields(); |
| | | // dialogVisible.value = false; |
| | | }; |
| | | // const handleClose = (formEl: any) => { |
| | | // formEl.resetFields(); |
| | | // }; |
| | | //全屏 |
| | | const full = ref(false); |
| | | const toggleFullscreen = () => { |
| | |
| | | } |
| | | }; |
| | | const data = ref(); |
| | | const nameC = ref(); |
| | | const onUser = (e: any) => { |
| | | form.value.commitPersonId = e.uid; |
| | | nameC.value = e.realName; |
| | | form.value.commitPersonName = e.realName; |
| | | }; |
| | | return { |
| | | disabled, |
| | | nameC, |
| | | titles, |
| | | // handleClose, |
| | | form, |
| | | propse, |
| | | department, |
| | |
| | | <template> |
| | | <el-dialog v-model="Shows" :before-close="resetForm" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-dialog v-model="Shows" @close="handleClose(ruleFormRef)" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" :disabled="disabled" ref="ruleFormRef" :rules="rules" label-width="120px"> |
| | | <el-row> |
| | |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="年度" prop="year" size="default"> |
| | | <el-input v-model.number="form.year" placeholder="请填写年度" /> |
| | | <el-input v-model.number="form.year" maxlength="8" placeholder="请填写年度" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="指标级别" size="default"> |
| | | <el-form-item label="指标级别" size="default" prop="level"> |
| | | <el-select v-model="form.level" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="公司级" value="1">公司级</el-option> |
| | | <el-option label="部门分厂级" value="2">部门分厂级</el-option> |
| | | <el-option label="工段班组级" value="3">工段班组级</el-option> |
| | | <el-option label="公司级" :value="1">公司级</el-option> |
| | | <el-option label="部门分厂级" :value="2">部门分厂级</el-option> |
| | | <el-option label="工段班组级" :value="3">工段班组级</el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="完成期限" size="default"> |
| | | <el-date-picker v-model="form.completeDate" format="YYYY-MM-DD HH:mm:ss" type="datetime" |
| | | placeholder="请选择" style="width: 100%" /> |
| | | <el-form-item label="完成期限" size="default" prop="completeDate"> |
| | | <el-date-picker v-model="form.completeDate" format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="备注信息"> |
| | | <el-form-item label="备注信息" prop="memo"> |
| | | <el-input v-model="form.memo" size="default" type="textarea" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button> |
| | | <el-button type="primary" v-if="titles == '查看目标设定' ? false : true" @click="submitForm(ruleFormRef)" |
| | | size="default">确定</el-button> |
| | | <el-button type="primary" v-if="titles == '查看目标设定' ? false : true" @click="submitForm(ruleFormRef)" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | level:[], |
| | | completeDate:[], |
| | | memo:[] |
| | | |
| | | }); |
| | | // 提交 |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | |
| | | formEl.resetFields(); |
| | | } |
| | | }); |
| | | formEl.resetFields(); |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | form.value = { |
| | | indexNum: '', //目标指标编号 |
| | | qName: '', //安全目标指标 |
| | | year: '', //年度 |
| | | level: '', ////指标级别 1:公司级 2:部门分厂级 3:工段班组级 |
| | | memo: '', ////备注信息 |
| | | targetType: '', ////指标类型 1:年指标 2:月指标 |
| | | completeDate: '', ////完成期限 |
| | | divideStatus: '1', ////分解状态 1:已分解 2:未分解 |
| | | value: '', ////指标值 |
| | | }; |
| | | }; |
| | | // 取消 |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | Shows.value = false; |
| | | form.value = { |
| | | indexNum: '', //目标指标编号 |
| | | qName: '', //安全目标指标 |
| | | year: '', //年度 |
| | | level: '', ////指标级别 1:公司级 2:部门分厂级 3:工段班组级 |
| | | memo: '', ////备注信息 |
| | | targetType: '', ////指标类型 1:年指标 2:月指标 |
| | | completeDate: '', ////完成期限 |
| | | divideStatus: '1', ////分解状态 1:已分解 2:未分解 |
| | | value: '', ////指标值 |
| | | }; |
| | | }; |
| | | const handleClose = (formEl: FormInstance | undefined) => { |
| | | formEl.resetFields(); |
| | | }; |
| | | return { |
| | | openDialog, |
| | | handleClose, |
| | | titles, |
| | | Shows, |
| | | form, |
| | |
| | | <el-table-column property="year" label="年度" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="value" label="指标值" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="level" label="指标级别" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="completeDate" label="完成期限" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="completeDate" label="完成期限" align="center" :formatter="timeDate" sortable show-overflow-tooltip /> |
| | | <el-table-column label="状态" align="center" sortable show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.divideStatus == 1">已分解</span> |
| | |
| | | </template> |
| | | <script lang="ts"> |
| | | import dailogAdd from './component/dailogAdd.vue'; |
| | | import {timeDate} from '/@/assets/index.ts' |
| | | import upData from '../../../components/updata/updata.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | |
| | | // upShow.value.openDialog(); |
| | | // }; |
| | | return { |
| | | timeDate, |
| | | tableData, |
| | | currentPage4, |
| | | pageSize4, |