zhaojiale
2022-09-08 1be21989c76f0eb9a43b9ebcab322d7171dbccd6
src/views/goalManagement/performanceAppraisal/component/DailogKh.vue
@@ -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="安全生产xxx" value="1" />
                     <el-option label="安全生产xxx" value="2" />
                     <el-option label="安全生产责任制考核1" value="1" />
                     <el-option label="安全生产责任制考核2" value="2" />
                  </el-select>
               </el-form-item>
            </el-col>
@@ -62,8 +62,8 @@
         </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-tab-pane label="考核项目" name="1">
            <el-button type="primary" size="default" @click="daiAdd('新增','')">新增</el-button>
         </el-tab-pane>
      </el-tabs>
      <el-table :data="form.examineItemList" style="width: 100%">
@@ -75,6 +75,8 @@
         <el-table-column align="center" label="操作">
            <template #default="scope">
               <el-button link type="primary" @click="daiAdd('查看', scope.row)">查看</el-button>
               <el-button link type="primary" @click="daiAdd('修改', scope.row)">修改</el-button>
               <el-button link type="primary" @click="deleteA(scope.row)">删除</el-button>
            </template>
         </el-table-column>
      </el-table>
@@ -109,12 +111,14 @@
         applyRange: '', ////适用范围
      });
      const titles = ref();
      const titleT = ref();
      const disabled = ref(false);
      const clickType = ref(false);
      // 打开弹窗
      const openDailog = (title: string, value: any, id: number) => {
         dialogVisible.value = true;
         titles.value = `${title}安全考核管理`;
         titleT.value=title
         disabled.value = title == '查看' ? true : false;
         if (title == '查看' || title == '修改') {
            goalManagementApi()
@@ -132,10 +136,21 @@
      };
      // 接受传值
      const AddObj = (val: any) => {
         form.value.examineItemList.push(val);
         if (index.value == -1) {
            form.value.examineItemList.push(val);
         } else {
            form.value.examineItemList[index.value] = val;
         }
      };
      // 删除
      const deleteA = (tag: any) => {
         form.value.examineItemList.splice(form.value.examineItemList.indexOf(tag), 1);
      };
      // 提交
      const submitForm = () => {
         if(titleT.value=='新建'){
            delete form.value.id
         }
         dialogVisible.value = false;
         goalManagementApi()
            .getexamineTemplateAddOrUpdate(form.value)
@@ -179,8 +194,10 @@
      };
      const activeName = ref('1');
      // 新增弹窗
      const index = ref<any>();
      const Show = ref();
      const daiAdd = (title: string, data: any) => {
         index.value = form.value.examineItemList.indexOf(data);
         Show.value.openDailog(title, data);
      };
      // 安全目标指标弹窗
@@ -198,8 +215,11 @@
         }
      };
      return {
         titleT,
         index,
         form,
         dialogVisible,
         deleteA,
         AddObj,
         openDailog,
         activeName,