From 5eeb8864bebb1dc4f97f2feef32b742d8a9a10d5 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 14 九月 2022 15:43:04 +0800
Subject: [PATCH] 1.新增报表管理菜单
---
src/views/template.vue | 99 ++++++++++++++++++++++++++-----------------------
1 files changed, 52 insertions(+), 47 deletions(-)
diff --git a/src/views/template.vue b/src/views/template.vue
index b15a11b..1e0fa00 100644
--- a/src/views/template.vue
+++ b/src/views/template.vue
@@ -3,7 +3,7 @@
<div class="body" :style="{height:mainHeight+'px'}">
<div class="bodyTopButtonGroup">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
- <el-button icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>
+ <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
</div>
<div class="bodyTopFormGroup">
@@ -22,7 +22,7 @@
<el-input v-model="form.OrgName" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="缁勭粐绫诲瀷" style=" display: flex;">
- <el-select v-model="form.OrgType" :popper-append-to-body="false" style="width: 200px" placeholder="璇烽�夋嫨">
+ <el-select v-model="form.OrgType" style="width: 200px" placeholder="璇烽�夋嫨">
<el-option
v-for="item in OrgTypeArr"
:key="item.code"
@@ -54,13 +54,10 @@
:cell-style="this.$cellStyle"
@sort-change="sortChange"
>
- <!-- <el-table-column-->
- <!-- type="selection"-->
- <!-- width="50"-->
- <!-- />-->
<el-table-column
prop="RowNum"
width="50"
+ fixed
label="搴忓彿"
/>
<el-table-column
@@ -77,15 +74,7 @@
prop="description"
label="缁勭粐绫诲瀷"
sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.description==='F'">宸ュ巶</div>
- <div v-if="row.description==='D'">閮ㄩ棬</div>
- <div v-if="row.description==='W'">杞﹂棿</div>
- <div v-if="row.description==='K'">绉戝</div>
- <div v-if="row.description==='L'">鐢熶骇绾�</div>
- </template>
- </el-table-column>
+ />
<el-table-column
prop="parentorg_name"
label="涓婄骇鍗曚綅"
@@ -104,11 +93,17 @@
/>
<el-table-column
label="鎿嶄綔"
+ width="120"
+ fixed="right"
>
<template slot-scope="{row}">
<div class="operationClass">
- <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>
- <el-button type="text" @click="del(row)">鍒犻櫎</el-button>
+ <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+ <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+ </el-tooltip>
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+ <i class="el-icon-delete" @click="del(row)" />
+ </el-tooltip>
</div>
</template>
</el-table-column>
@@ -120,7 +115,7 @@
:page.sync="form.page"
:limit.sync="form.rows"
align="right"
- layout="prev, pager, next,sizes"
+ layout="total,prev, pager, next,sizes"
popper-class="select_bottom"
@pagination="getOrganizationSearch"
/>
@@ -129,7 +124,8 @@
<el-dialog
:title="operation==='add'?'鏂板':'缂栬緫'"
:visible.sync="dialogVisible"
- width="800"
+ width="800px"
+ :close-on-click-modal="false"
top="15vh"
@closed="handleClose"
@close="handleClose"
@@ -164,6 +160,10 @@
</div>
</span>
</el-dialog>
+
+ <!--瀵煎叆缁勪欢-->
+ <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+
</div>
</template>
@@ -171,32 +171,15 @@
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
+import ImportPicker from '@/components/ImportPicker'
+import { validateCode } from '@/utils/global'
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
name: 'Zzjg',
components: {
- Pagination
+ Pagination, ImportPicker
},
data() {
- const validateName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇疯緭鍏ョ紪鐮�'))
- } else {
- if (SER_HZ.test(value)) {
- return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
- } else {
- callback()
- }
- }
- }
- const validateTypeCode = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇烽�夋嫨涓婄骇'))
- } else {
- callback()
- }
- }
return {
mainHeight: 0,
tableHeight: 0,
@@ -233,16 +216,25 @@
{ required: true, message: '璇疯緭鍏ラ�夋嫨绫诲瀷', trigger: ['blur', 'change'] }
],
OrgCode: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
OrgName: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
- ],
- SupUnit: [
- { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
]
- }
+ },
+
+ title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
+ code: '4',
+ shows: false
+
+ }
+ },
+ watch: {
+ shows() {
+ if (!this.shows) {
+ this.getOrganizationSearch()
+ }
}
},
created() {
@@ -275,8 +267,13 @@
search() {
this.getOrganizationSearch()
},
+ // 瀵煎叆鎸夐挳
upload() {
-
+ this.shows = true
+ this.$refs.importPickerFunc.newDataFunc()
+ },
+ colos() {
+ this.shows = false
},
// 閲嶇疆
reset() {
@@ -313,6 +310,9 @@
DeleteOrganization({ orgid: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
this.getOrganizationSearch()
}
})
@@ -357,8 +357,8 @@
// 鑾峰彇椤甸潰楂樺害
getHeight() {
this.$nextTick(() => {
- this.mainHeight = window.innerHeight - 250
- this.tableHeight = this.mainHeight - 100
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 200
})
},
tableRowClassName({ row, rowIndex }) {
@@ -462,6 +462,11 @@
margin-bottom: 0;
}
+::v-deep .el-select__caret{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
</style>
<style>
--
Gitblit v1.9.3