shj
2022-07-30 89f61cea248a73be5ce596b2629c7a4d1b5d2de4
src/views/goalManagement/performanceAppraisal/component/DailogKh.vue
@@ -1,5 +1,5 @@
<template>
   <el-dialog v-model="dialogVisible" :fullscreen="full" title="新建考核标准设定" width="60%" draggable>
   <el-dialog v-model="dialogVisible" :before-close="resetForm" :fullscreen="full" title="新建考核标准设定" width="60%" draggable>
      <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
      <el-form :model="form" label-width="120px">
         <el-row>
@@ -11,8 +11,8 @@
            <el-col :span="11" :offset="2">
               <el-form-item label="适用范围" size="default">
                  <el-select v-model="form.applyRange" style="width: 100%" placeholder="请选择">
                     <el-option label="Zone one" value="shanghai" />
                     <el-option label="Zone two" value="beijing" />
                     <el-option label="安全生产xxx" value="1" />
                     <el-option label="安全生产xxx" value="2" />
                  </el-select>
               </el-form-item>
            </el-col>
@@ -56,14 +56,14 @@
            </el-col>
            <el-col :span="11" :offset="2" v-if="clickType">
               <el-form-item label="设定日期" size="default">
                  <el-date-picker v-model="form.setTimem" type="date" placeholder="Pick a date" style="width: 100%" />
                  <el-date-picker disabled v-model="form.setTimem" format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" />
               </el-form-item>
            </el-col>
         </el-row>
      </el-form>
      <el-tabs v-model="activeName" class="demo-tabs">
         <el-tab-pane label="目标指标分解" name="1">
            <el-button type="primary" size="default" @click="daiAdd">新增</el-button>
            <el-button type="primary" size="default" @click="daiAdd('新增', '')">新增</el-button>
         </el-tab-pane>
      </el-tabs>
      <el-table :data="form.examineItemList" style="width: 100%">
@@ -73,19 +73,19 @@
         <el-table-column align="center" prop="judgeStandard" label="评定标准" />
         <el-table-column align="center" prop="memo" label="考核说明" />
         <el-table-column align="center" label="操作">
            <template #default>
               <el-button link type="primary">查看</el-button>
            <template #default="scope">
               <el-button link type="primary" @click="daiAdd('查看', scope.row)">查看</el-button>
            </template>
         </el-table-column>
      </el-table>
      <template #footer>
         <span class="dialog-footer">
            <el-button @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>
   <DailogKhS ref="Show"></DailogKhS>
   <DailogKhS ref="Show" @onAdd="AddObj"></DailogKhS>
</template>
<script lang="ts">
import { defineComponent, ref, reactive } from 'vue';
@@ -96,37 +96,27 @@
export default defineComponent({
   components: { DailogKhS },
   setup(props, { emit }) {
      const dialogVisible = ref<boolean>(true);
      const dialogVisible = ref<boolean>(false);
      const form = ref({
         examineItemList: [
            {
               itemType: '111', ////类型
               memo: '5556', //备注
               itemDetail: '2', ////考核项目
               content: '3', ////考核内容
               judgeStandard: '4', ////评定标准
               id: 4,
            },
         ], //考核项目列表
         examineItemList: [], //考核项目列表
         setTimem: 1658386392466,
         memo: '5623', ////备注信息
         templateCode: '666', ////模板分类编码
         title: '12', ////标准标题
         memo: '', ////备注信息
         templateCode: '', ////模板分类编码
         title: '', ////标准标题
         setPersonId: 1, //设定人
         acceptanceNumber: '4124', ////合格分数
         acceptanceNumber: '', ////合格分数
         setPersonDepartmentId: 2, //设定人部门
         applyRange: '321', ////适用范围
         id: 2, //当更新时必填
         applyRange: '', ////适用范围
      });
      const titles = ref();
      const disabled = ref(false);
      const clickType=ref(false)
      const clickType = ref(false);
      // 打开弹窗
      const openDailog = (title: string, value: any, id: number) => {
         dialogVisible.value = true;
         titles.value = `${title}安全考核管理`;
         disabled.value = title == '查看' ? true : false;
         if (title == '查看' || title == '修改'){
         if (title == '查看' || title == '修改') {
            goalManagementApi()
               .getexamineTemplateDetail(id)
               .then((res) => {
@@ -136,10 +126,13 @@
                     ElMessage.error(res.data.msg);
                  }
               });
         }else{
            clickType.value=true
         } else {
            clickType.value = false;
         }
      };
      // 接受传值
      const AddObj = (val: any) => {
         form.value.examineItemList.push(val);
      };
      // 提交
      const submitForm = () => {
@@ -158,59 +151,37 @@
               }
            });
         form.value = {
            examineItemList: [
               {
                  itemType: '111', ////类型
                  memo: '5556', //备注
                  itemDetail: '2', ////考核项目
                  content: '3', ////考核内容
                  judgeStandard: '4', ////评定标准
                  id: 4,
               },
            ], //考核项目列表
            examineItemList: [], //考核项目列表
            setTimem: 1658386392466,
            memo: '5623', ////备注信息
            templateCode: '666', ////模板分类编码
            title: '12', ////标准标题
            memo: '', ////备注信息
            templateCode: '', ////模板分类编码
            title: '', ////标准标题
            setPersonId: 1, //设定人
            acceptanceNumber: '4124', ////合格分数
            acceptanceNumber: '', ////合格分数
            setPersonDepartmentId: 2, //设定人部门
            applyRange: '321', ////适用范围
            id: 2, //当更新时必填
            applyRange: '', ////适用范围
         };
      };
      //   取消
      const resetForm = () => {
         dialogVisible.value = false;
         form.value = {
            examineItemList: [
               {
                  itemType: '111', ////类型
                  memo: '5556', //备注
                  itemDetail: '2', ////考核项目
                  content: '3', ////考核内容
                  judgeStandard: '4', ////评定标准
                  id: 4,
               },
            ], //考核项目列表
            examineItemList: [], //考核项目列表
            setTimem: 1658386392466,
            memo: '5623', ////备注信息
            templateCode: '666', ////模板分类编码
            title: '12', ////标准标题
            memo: '', ////备注信息
            templateCode: '', ////模板分类编码
            title: '', ////标准标题
            setPersonId: 1, //设定人
            acceptanceNumber: '4124', ////合格分数
            acceptanceNumber: '', ////合格分数
            setPersonDepartmentId: 2, //设定人部门
            applyRange: '321', ////适用范围
            id: 2, //当更新时必填
            applyRange: '', ////适用范围
         };
      };
      const activeName = ref('1');
      // 新增弹窗
      const Show = ref();
      const daiAdd = () => {
         Show.value.openDailog();
      const daiAdd = (title: string, data: any) => {
         Show.value.openDailog(title, data);
      };
      // 安全目标指标弹窗
      const Shows = ref();
@@ -229,6 +200,7 @@
      return {
         form,
         dialogVisible,
         AddObj,
         openDailog,
         activeName,
         titles,