兰宝车间质量管理系统-前端
疯狂的狮子Li
2023-07-11 c13c622eac5551c6f099f148feb5256711ca34de
src/views/system/post/index.vue
@@ -1,7 +1,8 @@
<template>
  <div class="p-2">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div class="search" v-show="showSearch">
      <div class="mb-[10px]" v-show="showSearch">
        <el-card shadow="hover">
        <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="70">
          <el-form-item label="岗位编码" prop="postCode">
            <el-input v-model="queryParams.postCode" placeholder="请输入岗位编码" clearable style="width: 200px" @keyup.enter="handleQuery" />
@@ -19,9 +20,10 @@
            <el-button icon="Refresh" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>
        </el-card>
      </div>
    </transition>
    <el-card shadow="never">
    <el-card shadow="hover">
      <template #header>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
@@ -107,7 +109,6 @@
<script setup name="Post" lang="ts">
import { listPost, addPost, delPost, getPost, updatePost } from "@/api/system/post";
import { PostForm, PostQuery, PostVO } from "@/api/system/post/types";
import { ComponentInternalInstance } from "vue";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable } = toRefs<any>(proxy?.useDict("sys_normal_disable"));
@@ -120,8 +121,8 @@
const multiple = ref(true);
const total = ref(0);
const postFormRef = ref(ElForm);
const queryFormRef = ref(ElForm);
const postFormRef = ref<ElFormInstance>();
const queryFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
    visible: false,
@@ -171,7 +172,7 @@
/** 表单重置 */
const reset = () => {
    form.value = {...initFormData};
    postFormRef.value.resetFields();
  postFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
@@ -180,7 +181,7 @@
}
/** 重置按钮操作 */
const resetQuery = () => {
    queryFormRef.value.resetFields();
  queryFormRef.value?.resetFields();
    handleQuery();
}
/** 多选框选中数据 */
@@ -210,12 +211,12 @@
}
/** 提交按钮 */
const submitForm = () => {
    postFormRef.value.validate(async (valid: boolean) => {
  postFormRef.value?.validate(async (valid: boolean) => {
        if (valid) {
            form.value.postId ? await updatePost(form.value) : await addPost(form.value);
            proxy?.$modal.msgSuccess("操作成功");
            dialog.visible = false;
            getList();
      await getList();
        }
    });
}
@@ -224,7 +225,7 @@
    const postIds = row?.postId || ids.value;
    await proxy?.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?');
    await delPost(postIds);
    getList();
  await getList();
    proxy?.$modal.msgSuccess("删除成功");
}
/** 导出按钮操作 */