|
|
@@ -1,53 +1,79 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="80px">
|
|
|
- <el-form-item label="考核报表名称" prop="asseRepoName">
|
|
|
- <el-input v-model="queryParams.asseRepoName" placeholder="请输入考核报表名称" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['woas:stan:add']">新增</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['woas:stan:edit']">修改</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['woas:stan:remove']">删除</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['woas:stan:export']">导出</el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns" storageKey="woas-woas-stan-index"></right-toolbar>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="考核报表名称" align="center" prop="asseRepoName" v-if="columns.asseRepoName.visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="填报单位类型" align="center" prop="fillOrgType" v-if="columns.fillOrgType.visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="权重系数" align="center" prop="weigCoef" v-if="columns.weigCoef.visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="分数上限" align="center" prop="socrLimi" v-if="columns.socrLimi.visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="额外加分上限" align="center" prop="bonuLimi" v-if="columns.bonuLimi.visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="操作" align="center" class-name="BisWoasStan" width="200">
|
|
|
- <template #default="scope">
|
|
|
- <el-tooltip content="修改" placement="top">
|
|
|
- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['woas:stan:edit']"></el-button>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip content="删除" placement="top">
|
|
|
- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['woas:stan:remove']"></el-button>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
-
|
|
|
- <el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
|
|
+ <div class="system-page config-page">
|
|
|
+ <el-card class="page-card">
|
|
|
+ <template #header>
|
|
|
+ <div class="card-header">
|
|
|
+ <div class="header-left">
|
|
|
+ <el-icon :size="20" color="#409EFF"><List /></el-icon>
|
|
|
+ <span class="page-title">考核标准</span>
|
|
|
+ </div>
|
|
|
+ <div class="search-right">
|
|
|
+ <el-button type="primary" v-hasPermi="['woas:stan:add']" @click="handleAdd">
|
|
|
+ <el-icon><Plus /></el-icon> 新增
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" v-hasPermi="['woas:stan:edit']" :disabled="single" @click="handleUpdate()">
|
|
|
+ <el-icon><Edit /></el-icon> 修改
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" v-hasPermi="['woas:stan:remove']" :disabled="multiple" @click="handleDelete()">
|
|
|
+ <el-icon><Delete /></el-icon> 删除
|
|
|
+ </el-button>
|
|
|
+ <el-button type="warning" v-hasPermi="['woas:stan:export']" @click="handleExport">
|
|
|
+ <el-icon><Download /></el-icon> 导出
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 搜索栏 -->
|
|
|
+ <div class="search-bar" v-show="showSearch">
|
|
|
+ <el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
|
+ <el-form-item label="考核报表名称" prop="asseRepoName">
|
|
|
+ <el-input v-model="queryParams.asseRepoName" placeholder="请输入考核报表名称" clearable @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="handleQuery">
|
|
|
+ <el-icon><Search /></el-icon> 搜索
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="resetQuery">
|
|
|
+ <el-icon><RefreshRight /></el-icon> 重置
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 数据列表 -->
|
|
|
+ <el-table v-loading="loading" :data="dataList" style="width: 100%" border @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="45" />
|
|
|
+ <el-table-column label="考核报表名称" align="center" prop="asseRepoName" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="填报单位类型" align="center" prop="fillOrgType" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="权重系数" align="center" prop="weigCoef" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="分数上限" align="center" prop="socrLimi" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="额外加分上限" align="center" prop="bonuLimi" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="操作" align="center" width="150" fixed="right">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-button link type="primary" v-hasPermi="['woas:stan:edit']" @click="handleUpdate(row)"> 编辑 </el-button>
|
|
|
+ <el-button link type="danger" v-hasPermi="['woas:stan:remove']" @click="handleDelete(row)"> 删除 </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 分页 -->
|
|
|
+ <div class="pagination">
|
|
|
+ <el-pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ v-model:current-page="queryParams.pageNum"
|
|
|
+ v-model:page-size="queryParams.pageSize"
|
|
|
+ :total="total"
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ @size-change="getList"
|
|
|
+ @current-change="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <!-- 新增/编辑对话框 -->
|
|
|
+ <el-dialog v-model="dialog.visible" :title="dialog.title" width="600px" top="5vh" append-to-body @close="cancel">
|
|
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
|
|
<el-form-item label="工作考核GUID" prop="woasGuid">
|
|
|
<el-input v-model="form.woasGuid" placeholder="请输入工作考核GUID" />
|
|
|
@@ -78,131 +104,252 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
- <div class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- </div>
|
|
|
+ <el-button @click="dialog.visible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm">确定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script setup name="WoasStan">
|
|
|
-import { listWoasStan, getWoasStan, addWoasStan, updateWoasStan, delWoasStan } from "@/api/slaj/woas";
|
|
|
-import { getCurrentInstance, reactive, ref, toRefs } from "vue";
|
|
|
-
|
|
|
-const { proxy } = getCurrentInstance();
|
|
|
-
|
|
|
-const dataList = ref([]);
|
|
|
-const open = ref(false);
|
|
|
-const loading = ref(true);
|
|
|
-const showSearch = ref(true);
|
|
|
-const ids = ref([]);
|
|
|
-const single = ref(true);
|
|
|
-const multiple = ref(true);
|
|
|
-const total = ref(0);
|
|
|
-const title = ref("");
|
|
|
-
|
|
|
-const columns = ref({
|
|
|
- asseRepoName: { visible: true },
|
|
|
- fillOrgType: { visible: true },
|
|
|
- weigCoef: { visible: true },
|
|
|
- socrLimi: { visible: true },
|
|
|
- bonuLimi: { visible: true }
|
|
|
-});
|
|
|
-
|
|
|
-const data = reactive({
|
|
|
- form: {},
|
|
|
- queryParams: { pageNum: 1, pageSize: 10, asseRepoName: null },
|
|
|
+<script setup name="BisWoasStan" lang="ts">
|
|
|
+import { listWoasStan, getWoasStan, addWoasStan, updateWoasStan, delWoasStan } from '@/api/slaj/woas'
|
|
|
+import { Plus, Edit, Delete, Download, Search, RefreshRight, List } from '@element-plus/icons-vue'
|
|
|
+
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance
|
|
|
+
|
|
|
+const dataList = ref<any[]>([])
|
|
|
+const loading = ref(true)
|
|
|
+const showSearch = ref(true)
|
|
|
+const ids = ref<Array<string | number>>([])
|
|
|
+const single = ref(true)
|
|
|
+const multiple = ref(true)
|
|
|
+const total = ref(0)
|
|
|
+
|
|
|
+const queryFormRef = ref<ElFormInstance>()
|
|
|
+const formRef = ref<ElFormInstance>()
|
|
|
+const dialog = reactive<DialogOption>({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+})
|
|
|
+
|
|
|
+const initFormData: any = {
|
|
|
+ guid: null,
|
|
|
+ woasGuid: null,
|
|
|
+ asseRepoName: null,
|
|
|
+ fillOrgType: null,
|
|
|
+ weigCoef: null,
|
|
|
+ socrLimi: null,
|
|
|
+ bonuLimi: null,
|
|
|
+ repoTempId: null,
|
|
|
+ repoThisPath: null,
|
|
|
+ note: null
|
|
|
+}
|
|
|
+
|
|
|
+const data = reactive<PageData<any, any>>({
|
|
|
+ form: { ...initFormData },
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ asseRepoName: null
|
|
|
+ },
|
|
|
rules: {}
|
|
|
-});
|
|
|
+})
|
|
|
|
|
|
-const { form, queryParams, rules } = toRefs(data);
|
|
|
+const { queryParams, form, rules } = toRefs(data)
|
|
|
|
|
|
-function getList() {
|
|
|
- loading.value = true;
|
|
|
- listWoasStan(queryParams.value).then(response => {
|
|
|
- dataList.value = response.rows;
|
|
|
- total.value = response.total;
|
|
|
- loading.value = false;
|
|
|
- });
|
|
|
+/** 查询列表 */
|
|
|
+const getList = async () => {
|
|
|
+ loading.value = true
|
|
|
+ const res = await listWoasStan(queryParams.value)
|
|
|
+ dataList.value = res.rows
|
|
|
+ total.value = res.total
|
|
|
+ loading.value = false
|
|
|
}
|
|
|
|
|
|
-function handleQuery() {
|
|
|
- queryParams.value.pageNum = 1;
|
|
|
- getList();
|
|
|
+/** 取消按钮 */
|
|
|
+const cancel = () => {
|
|
|
+ reset()
|
|
|
+ dialog.visible = false
|
|
|
}
|
|
|
|
|
|
-function resetQuery() {
|
|
|
- proxy.resetForm("queryRef");
|
|
|
- handleQuery();
|
|
|
+/** 表单重置 */
|
|
|
+const reset = () => {
|
|
|
+ form.value = { ...initFormData }
|
|
|
+ formRef.value?.resetFields()
|
|
|
}
|
|
|
|
|
|
-function handleSelectionChange(selection) {
|
|
|
- ids.value = selection.map(item => item.guid);
|
|
|
- single.value = selection.length !== 1;
|
|
|
- multiple.value = !selection.length;
|
|
|
+/** 搜索按钮操作 */
|
|
|
+const handleQuery = () => {
|
|
|
+ queryParams.value.pageNum = 1
|
|
|
+ getList()
|
|
|
}
|
|
|
|
|
|
-function handleAdd() {
|
|
|
- reset();
|
|
|
- open.value = true;
|
|
|
- title.value = "添加考核标准";
|
|
|
+/** 重置按钮操作 */
|
|
|
+const resetQuery = () => {
|
|
|
+ queryFormRef.value?.resetFields()
|
|
|
+ handleQuery()
|
|
|
}
|
|
|
|
|
|
-function handleUpdate(row) {
|
|
|
- reset();
|
|
|
- const guid = row.guid || ids.value[0];
|
|
|
- getWoasStan(guid).then(response => {
|
|
|
- form.value = response.data;
|
|
|
- open.value = true;
|
|
|
- title.value = "修改考核标准";
|
|
|
- });
|
|
|
+/** 多选框选中数据 */
|
|
|
+const handleSelectionChange = (selection: any[]) => {
|
|
|
+ ids.value = selection.map((item) => item.guid)
|
|
|
+ single.value = selection.length !== 1
|
|
|
+ multiple.value = !selection.length
|
|
|
}
|
|
|
|
|
|
-function submitForm() {
|
|
|
- proxy.$refs["formRef"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (form.value.guid != null) {
|
|
|
- updateWoasStan(form.value).then(() => {
|
|
|
- proxy.$modal.msgSuccess("修改成功");
|
|
|
- open.value = false;
|
|
|
- getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addWoasStan(form.value).then(() => {
|
|
|
- proxy.$modal.msgSuccess("新增成功");
|
|
|
- open.value = false;
|
|
|
- getList();
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+/** 新增按钮操作 */
|
|
|
+const handleAdd = () => {
|
|
|
+ reset()
|
|
|
+ dialog.visible = true
|
|
|
+ dialog.title = '添加考核标准'
|
|
|
}
|
|
|
|
|
|
-function handleDelete(row) {
|
|
|
- const guids = row.guid || ids.value.join(",");
|
|
|
- proxy.$modal.confirm('是否确认删除所选数据?').then(function() {
|
|
|
- return delWoasStan(guids);
|
|
|
- }).then(() => {
|
|
|
- getList();
|
|
|
- proxy.$modal.msgSuccess("删除成功");
|
|
|
- });
|
|
|
+/** 修改按钮操作 */
|
|
|
+const handleUpdate = async (row?: any) => {
|
|
|
+ reset()
|
|
|
+ const guid = row?.guid || ids.value[0]
|
|
|
+ const res = await getWoasStan(guid)
|
|
|
+ Object.assign(form.value, res.data)
|
|
|
+ dialog.visible = true
|
|
|
+ dialog.title = '修改考核标准'
|
|
|
}
|
|
|
|
|
|
-function handleExport() {
|
|
|
- proxy.download('/woas/stan/export', { ...queryParams.value }, `考核标准_${new Date().getTime()}.xlsx`);
|
|
|
+/** 提交按钮 */
|
|
|
+const submitForm = () => {
|
|
|
+ formRef.value?.validate(async (valid: boolean) => {
|
|
|
+ if (valid) {
|
|
|
+ form.value.guid ? await updateWoasStan(form.value) : await addWoasStan(form.value)
|
|
|
+ proxy?.$modal.msgSuccess('操作成功')
|
|
|
+ dialog.visible = false
|
|
|
+ await getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-function cancel() {
|
|
|
- open.value = false;
|
|
|
- reset();
|
|
|
+/** 删除按钮操作 */
|
|
|
+const handleDelete = async (row?: any) => {
|
|
|
+ const guids = row?.guid || ids.value
|
|
|
+ await proxy?.$modal.confirm('是否确认删除所选数据?')
|
|
|
+ await delWoasStan(guids)
|
|
|
+ await getList()
|
|
|
+ proxy?.$modal.msgSuccess('删除成功')
|
|
|
}
|
|
|
|
|
|
-function reset() {
|
|
|
- form.value = { guid: null, woasGuid: null, asseRepoName: null, fillOrgType: null, weigCoef: null, socrLimi: null, bonuLimi: null, repoTempId: null, repoThisPath: null, note: null };
|
|
|
- proxy.resetForm("formRef");
|
|
|
+/** 导出按钮操作 */
|
|
|
+const handleExport = () => {
|
|
|
+ proxy?.download('/woas/stan/export', { ...queryParams.value }, `考核标准_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
|
|
|
-getList();
|
|
|
+onMounted(() => {
|
|
|
+ getList()
|
|
|
+})
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+.system-page {
|
|
|
+ padding: 0px;
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ min-height: calc(100vh - 10px);
|
|
|
+
|
|
|
+ :deep(.el-input__wrapper) {
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-textarea__inner) {
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .page-card {
|
|
|
+ border-radius: 1px;
|
|
|
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
|
|
|
+
|
|
|
+ :deep(.el-card__header) {
|
|
|
+ padding: 15px 20px;
|
|
|
+ border-bottom: 1px solid #ebeef5;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 8px 8px 0 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-card__body) {
|
|
|
+ padding: 20px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .card-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .header-left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 10px;
|
|
|
+
|
|
|
+ .page-title {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #303133;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-right {
|
|
|
+ display: flex;
|
|
|
+ gap: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-bar {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ background-color: #f8faff;
|
|
|
+ padding: 6px 10px;
|
|
|
+ border-radius: 6px;
|
|
|
+ border: 0px solid #e6ebf5;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ :deep(.el-form) {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 10px;
|
|
|
+
|
|
|
+ .el-form-item {
|
|
|
+ margin-bottom: 0;
|
|
|
+ margin-right: 15px;
|
|
|
+
|
|
|
+ .el-form-item__label {
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .pagination {
|
|
|
+ margin-top: 8px;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-table) {
|
|
|
+ border-radius: 4px;
|
|
|
+ overflow: auto;
|
|
|
+ height: calc(100vh - 195px);
|
|
|
+
|
|
|
+ th.el-table__cell {
|
|
|
+ background-color: #f5f7fa !important;
|
|
|
+ color: #606266;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-button--primary.is-link {
|
|
|
+ color: #409eff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-button--danger.is-link {
|
|
|
+ color: #f56c6c;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|