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/sbgl/sbqd.vue | 79 +++++++++++++++++++++++----------------
1 files changed, 47 insertions(+), 32 deletions(-)
diff --git a/src/views/sbgl/sbqd.vue b/src/views/sbgl/sbqd.vue
index 89cd85d..9d96565 100644
--- a/src/views/sbgl/sbqd.vue
+++ b/src/views/sbgl/sbqd.vue
@@ -2,10 +2,13 @@
<div>
<div class="body" :style="{height:mainHeight+'px'}">
- <div class="bodyTopButtonGroup">
+ <div class="bodyTopButtonGroup" style="justify-content: space-between">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
- <el-button icon="el-icon-c-scale-to-original" @click="deviceTypeButton">璁惧绫诲瀷</el-button>
- <el-button icon="el-icon-document-copy" @click="deviceGroupButton">璁惧缁�</el-button>
+ <div style="display: flex">
+ <el-button icon="el-icon-c-scale-to-original" @click="deviceTypeButton">璁惧绫诲瀷</el-button>
+ <el-button icon="el-icon-document-copy" @click="deviceGroupButton">璁惧缁�</el-button>
+ </div>
+
<!-- <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
</div>
@@ -64,7 +67,6 @@
style="width: 200px"
filterable
placeholder="璇烽�夋嫨"
-
@change="deviceTypeChange"
>
<!-- @focus="getDeviceTypeSelect"-->
@@ -76,7 +78,7 @@
/>
</el-select>
</el-form-item>
- <el-form-item label="璁惧缁�" style=" display: flex;">
+ <el-form-item v-show="isExpandForm" label="璁惧缁�" style=" display: flex;">
<el-select
v-model="form.DeviceGroup"
filterable
@@ -100,15 +102,22 @@
</div>
</el-form>
</div>
-
- <div class="elTableDiv">
+ <div
+ class="bodyTopFormExpand"
+ @click="isExpandForm=!isExpandForm"
+ >
+ <i
+ :class="!isExpandForm?'el-icon-arrow-down':'el-icon-arrow-up'"
+ :style="{color:'#42B983'}"
+ /></div>
+ <div class="elTableDiv" style="margin-top: 0;">
<el-table
:data="tableData"
border
- :height="tableHeight+'px'"
+ :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
highlight-current-row
:row-class-name="tableRowClassName"
- :style="{width: 100+'%',height:(tableHeight-50)+'px'}"
+ :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
@sort-change="sortChange"
@@ -186,7 +195,8 @@
width="100"
>
<template slot-scope="{row}">
- <div>{{ row.operation_ration }}%</div>
+ <div v-if=" parseFloat(row.operation_ration)===0">/</div>
+ <div v-else>{{ row.operation_ration }}%</div>
</template>
</el-table-column>
<el-table-column
@@ -221,7 +231,6 @@
</div>
<!--鍒嗛〉-->
<pagination
- v-show="total>0"
:total="total"
:page.sync="form.page"
:limit.sync="form.rows"
@@ -386,6 +395,7 @@
width="50"
label="搴忓彿"
prop="RowNum"
+ fixed
/>
<el-table-column
prop="code"
@@ -393,7 +403,7 @@
sortable="custom"
>
<template slot-scope="{row}">
- <el-input v-if="row.isVisible===1" v-model="row.code" placeholder="璇疯緭鍏�" />
+ <el-input v-if="row.isVisible===1" v-model="row.code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="璇疯緭鍏�" />
<div v-else> {{ row.code }}</div>
</template>
</el-table-column>
@@ -429,7 +439,6 @@
</el-table>
<!--鍒嗛〉-->
<pagination
- v-show="DeviceTypeTotal>0"
:total="DeviceTypeTotal"
:page.sync="formDeviceType.page"
:limit.sync="formDeviceType.rows"
@@ -475,6 +484,7 @@
<el-table-column
width="50"
label="搴忓彿"
+ fixed
prop="RowNum"
/>
<el-table-column
@@ -483,7 +493,7 @@
sortable="custom"
>
<template slot-scope="{row}">
- <el-input v-if="row.isVisible===1" v-model="row.code" placeholder="璇疯緭鍏�" />
+ <el-input v-if="row.isVisible===1"v-model="row.code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="璇疯緭鍏�" />
<div v-else> {{ row.code }}</div>
</template>
</el-table-column>
@@ -542,7 +552,6 @@
</el-table>
<!--鍒嗛〉-->
<pagination
- v-show="DeviceGroupTotal>0"
:total="DeviceGroupTotal"
:page.sync="formDeviceGroup.page"
:limit.sync="formDeviceGroup.rows"
@@ -569,7 +578,7 @@
import Pagination from '@/components/Pagination'
import {
AddUpdateDeviceGroup, AddUpdateDeviceManger,
- AddUpdateDeviceType, DeleteDeviceManger, DeleteDeviceType,
+ AddUpdateDeviceType, DeleteDeviceGroup, DeleteDeviceManger, DeleteDeviceType,
DeviceGroupSearch,
DeviceMangerSearch,
DeviceTypeSearch,
@@ -577,27 +586,16 @@
DeviceTypeSelectGroup,
WorkShopSelect, WorkShopSelectLine
} from '@/api/sbgl'
-import { handleDatetime } from '@/utils/global'
+import { handleDatetime, validateCode } from '@/utils/global'
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
name: 'SBQD',
components: {
Pagination
},
data() {
- const validateName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇疯緭鍏ョ紪鐮�'))
- } else {
- if (SER_HZ.test(value)) {
- return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
- } else {
- callback()
- }
- }
- }
return {
+ isExpandForm: false,
mainHeight: 0,
tableHeight: 0,
form: {
@@ -639,7 +637,7 @@
operation: '',
dialogFormRules: {
devicecode: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
devicename: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
@@ -793,6 +791,9 @@
DeleteDeviceManger({ devicecode: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
this.getDeviceMangerSearch()
}
})
@@ -864,7 +865,7 @@
getHeight() {
this.$nextTick(() => {
this.mainHeight = window.innerHeight - 85
- this.tableHeight = this.mainHeight - 240
+ this.tableHeight = this.mainHeight - 250
// if (window.innerHeight < 769) {
// this.tableHeight = this.tableHeight - 50
// }
@@ -926,6 +927,9 @@
DeleteDeviceType({ devicetypecode: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.formDeviceType.page > 1 && this.DeviceTypeArray.length === 1) {
+ this.formDeviceType.page--
+ }
this.getDeviceTypeSearchDialog()
}
})
@@ -1040,6 +1044,9 @@
DeleteDeviceGroup({ devicegroupcode: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.formDeviceGroup.page > 1 && this.DeviceGroupArray.length === 1) {
+ this.formDeviceGroup.page--
+ }
this.getDeviceGroupSearchDialog()
}
})
@@ -1096,6 +1103,10 @@
<!--鍏叡椤甸潰鏍峰紡-->
<style lang="scss" scoped>
$main_color: #42b983;
+::v-deep .el-button--text{
+ font-size: 14px ;
+ cursor: pointer ;
+}
.el-icon-share ,.el-icon-delete,.el-icon-edit-outline{
color: $main_color;
cursor: pointer;
@@ -1181,7 +1192,11 @@
.userDialogVisible ::v-deep .el-form-item {
margin-bottom: 0;
}
-
+::v-deep .el-select__caret{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
</style>
<style>
--
Gitblit v1.9.3