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/zzmx/gxdy.vue | 365 ++++++++++++++++++++++++---------------------------
1 files changed, 173 insertions(+), 192 deletions(-)
diff --git a/src/views/zzmx/gxdy.vue b/src/views/zzmx/gxdy.vue
index be4ed1b..8f6b991 100644
--- a/src/views/zzmx/gxdy.vue
+++ b/src/views/zzmx/gxdy.vue
@@ -1,7 +1,13 @@
<template>
<div>
<div class="body" :style="{height:mainHeight+'px'}">
- <div style="padding: 10px 5px 0 0">
+
+ <div class="bodyTopButtonGroup">
+ <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+ <!-- <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
+ </div>
+
+ <div class="bodyTopFormGroup">
<el-form
ref="form"
:model="form"
@@ -17,7 +23,13 @@
<el-input v-model="form.stepname" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="鍚敤鐘舵��" style=" display: flex;">
- <el-select v-model="form.enable" :popper-append-to-body="false" style="width: 200px" placeholder="璇烽�夋嫨">
+ <el-select
+ v-model="form.enable"
+ filterable
+ :popper-append-to-body="false"
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ >
<el-option
v-for="item in enableArr"
:key="item.code"
@@ -29,6 +41,7 @@
<el-form-item label="宸ュ簭绫诲瀷" style=" display: flex;">
<el-select
v-model="form.steptypecode"
+ filterable
:popper-append-to-body="false"
style="width: 200px"
placeholder="璇烽�夋嫨"
@@ -51,19 +64,14 @@
</div>
</el-form>
</div>
- <el-divider />
- <div style="margin-left: 10px;display: flex">
- <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
- <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>
- </div>
- <el-divider />
+
<div class="elTableDiv">
<el-table
:data="tableData"
:height="tableHeight"
border
- stripe
- :style="{width: 100+'%',height:tableHeight+'px',}"
+ :row-class-name="tableRowClassName"
+ :style="{width: 100+'%',height:tableHeight+'px'}"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
@@ -77,19 +85,23 @@
prop="RowNum"
width="50"
label="搴忓彿"
+ fixed
/>
<el-table-column
prop="stepcode"
label="宸ュ簭缂栫爜"
+ min-width="150"
sortable="custom"
/>
<el-table-column
prop="stepname"
+ min-width="150"
label="宸ュ簭鍚嶇О"
sortable="custom"
/>
<el-table-column
prop="flwtype"
+ min-width="150"
label="宸ュ簭绫诲瀷"
sortable="custom"
>
@@ -102,53 +114,84 @@
<el-table-column
prop="descr"
label="宸ュ簭鎻忚堪"
+ min-width="180"
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.descr">{{ row.descr }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
<el-table-column
prop="enable"
label="鍚敤鐘舵��"
sortable="custom"
+ width="110"
>
<template slot-scope="{row}">
- <div v-if="row.enable==='Y'">鏄�</div>
- <div v-if="row.enable==='N'">鍚�</div>
+ <div v-if="row.enable==='Y'"><svg-icon icon-class="circleYes" style="margin-right: 2px" />鏄�</div>
+ <div v-if="row.enable==='N'"> <svg-icon icon-class="circleNo" style="margin-right: 2px" />鍚�</div>
</template>
</el-table-column>
<el-table-column
prop="lm_user"
label="鍒涘缓浜哄憳"
+ width="110"
sortable="custom"
/>
<el-table-column
prop="lm_date"
label="鍒涘缓鏃堕棿"
+ width="160"
sortable="custom"
/>
<el-table-column
label="鍏宠仈宸ヤ綔绔�"
+ prop="is_eqp"
+ width="110"
>
<template slot-scope="{row}">
<div class="operationClass">
- <i class="el-icon-share" @click="workClick(row)" />
+ <i v-if="row.is_eqp==='Y'" class="el-icon-share" @click="workClick(row)" />
+ <i
+ v-if="row.is_eqp==='N'"
+ class="el-icon-share"
+ style="color: rgb(180 ,181, 185)"
+ @click="workClick(row)"
+ />
</div>
</template>
</el-table-column>
<el-table-column
label="鍏宠仈缂洪櫡"
+ prop="is_defect"
+ width="110"
>
<template slot-scope="{row}">
<div class="operationClass">
- <i class="el-icon-share" @click="defectClick(row)" />
+ <i v-if="row.is_defect==='Y'" class="el-icon-share" @click="defectClick(row)" />
+ <i
+ v-if="row.is_defect==='N'"
+ class="el-icon-share"
+ style="color:rgb(180 ,181, 185);"
+ @click="defectClick(row)"
+ />
</div>
</template>
</el-table-column>
<el-table-column
label="鎿嶄綔"
+ fixed="right"
+ width="120"
>
<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>
@@ -156,12 +199,11 @@
</div>
<!--鍒嗛〉-->
<pagination
- v-show="total>0"
:total="total"
: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="getStepSearch"
/>
@@ -184,24 +226,38 @@
<el-form-item label="宸ュ簭鍚嶇О" prop="stepname">
<el-input v-model="dialogForm.stepname" style="width: 200px" />
</el-form-item>
+
<el-form-item prop="steptypecode" label="宸ュ簭绫诲瀷">
- <el-select
+ <el-radio-group
v-model="dialogForm.steptypecode"
style="width: 200px"
- placeholder="璇烽�夋嫨"
- :popper-append-to-body="false"
>
- <el-option
+ <el-radio
v-for="item in steptypeArr"
:key="item.code"
- :label="item.name"
:value="item.code"
+ :label="item.name"
/>
- </el-select>
+ </el-radio-group>
+ <!-- <el-select-->
+ <!-- v-model="dialogForm.steptypecode"-->
+ <!-- filterable-->
+ <!-- style="width: 200px"-->
+ <!-- placeholder="璇烽�夋嫨"-->
+ <!-- :popper-append-to-body="false"-->
+ <!-- >-->
+ <!-- <el-option-->
+ <!-- v-for="item in steptypeArr"-->
+ <!-- :key="item.code"-->
+ <!-- :label="item.name"-->
+ <!-- :value="item.code"-->
+ <!-- />-->
+ <!-- </el-select>-->
</el-form-item>
<el-form-item prop="enable" label="鍚敤鐘舵��">
<el-select
v-model="dialogForm.enable"
+ filterable
style="width: 200px"
placeholder="璇烽�夋嫨"
:popper-append-to-body="false"
@@ -231,8 +287,7 @@
title="鍏宠仈宸ヤ綔绔�"
:visible.sync="workDialogVisible"
width="50%"
- top="15vh"
- :fullscreen="isFullscreen"
+ :top="isIpad?'5vh': '15vh'"
:close-on-click-modal="false"
class="workDialogVisible"
@closed="workHandleClose"
@@ -279,7 +334,7 @@
:data="workDialogForm.workTreeArr"
show-checkbox
node-key="code"
- style="height: 300px;"
+ style="height: 280px;"
default-expand-all
:props="workTreeDefaultProps"
@check="checkBoxClick"
@@ -300,8 +355,7 @@
title="宸ュ簭鍏宠仈缂洪櫡"
:visible.sync="defectDialogVisible"
width="50%"
- top="15vh"
- :fullscreen="isFullscreen"
+ :top="isIpad?'5vh':'15vh'"
:close-on-click-modal="false"
class="defectDialogVisible"
@closed="defectHandleClose"
@@ -322,7 +376,7 @@
:data="defectTree"
show-checkbox
node-key="code"
- style="height: 500px;"
+ style="height: 400px;"
default-expand-all
:props="workTreeDefaultProps"
/>
@@ -343,8 +397,6 @@
<script>
import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
import {
AddUpdateStep,
DeleteStep, SaveStepAssociationDefect,
@@ -354,27 +406,16 @@
StepSearch
} from '@/api/zzmx'
import $ from 'jquery'
+import { validateCode } from '@/utils/global'
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
- name: 'Zzjg',
+ name: 'GXDY',
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 {
- isFullscreen: false,
+ isIpad: false,
mainHeight: 0,
tableHeight: 0,
form: {
@@ -404,15 +445,15 @@
'id': '',
'stepcode': '',
'stepname': '',
- 'steptypecode': '',
- 'enable': '',
+ 'steptypecode': '鑷埗',
+ 'enable': 'Y',
'description': '',
'OperType': ''
},
operation: '',
dialogFormRules: {
stepcode: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
stepname: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
@@ -454,6 +495,9 @@
this.getHeight()
},
methods: {
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
+ },
async getStepSearch() {
const res = await StepSearch(this.form)
this.tableData = res.data
@@ -503,7 +547,7 @@
this.dialogForm.id = row.id
this.dialogForm.stepcode = row.stepcode
this.dialogForm.stepname = row.stepname
- this.dialogForm.steptypecode = row.flwtype
+ this.dialogForm.steptypecode = this.steptypeArr.find(item => item.code === row.flwtype).name
this.dialogForm.description = row.descr
this.dialogForm.enable = row.enable
})
@@ -518,6 +562,9 @@
DeleteStep({ stepcode: row.stepcode }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
this.getStepSearch()
}
})
@@ -529,8 +576,8 @@
handleClose() {
this.dialogForm.stepcode = ''
this.dialogForm.stepname = ''
- this.dialogForm.steptypecode = ''
- this.dialogForm.enable = ''
+ this.dialogForm.steptypecode = '鑷埗'
+ this.dialogForm.enable = 'Y'
this.dialogForm.description = ''
this.$refs.dialogForm.clearValidate()
},
@@ -546,7 +593,7 @@
id: this.dialogForm.id,
stepcode: this.dialogForm.stepcode,
stepname: this.dialogForm.stepname,
- steptypecode: this.dialogForm.steptypecode,
+ steptypecode: this.steptypeArr.find(item => item.name === this.dialogForm.steptypecode).code,
enable: this.dialogForm.enable,
description: this.dialogForm.description,
OperType: this.operation === 'add' ? 'Add' : 'Update'
@@ -566,12 +613,13 @@
// 鑾峰彇椤甸潰楂樺害
getHeight() {
this.$nextTick(() => {
- this.mainHeight = window.innerHeight - 250
- this.tableHeight = this.mainHeight - 100
- this.isFullscreen = window.innerHeight < 800
- if (window.innerHeight < 800) {
- this.tableHeight = this.tableHeight - 50
+ // this.mainHeight = window.innerHeight - 250
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 200
+ if (window.innerHeight < 769) {
+ this.tableHeight = this.tableHeight - 40
}
+ this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
})
},
/* 鍏宠仈宸ヤ綔绔欐ā鍧�*/
@@ -581,7 +629,8 @@
this.workDialogForm.stepcode = row.stepcode
this.workDialogForm.stepname = row.stepname
const { data: res } = await StepAssociationEqp({ stepcode: this.workDialogForm.stepcode })
- this.workDialogForm.workArr = res
+ this.workDialogForm.workArr = res.filter(item => item.children.length !== 0)
+
let workGatherArr = []
if (row.flwtype === 'W') { // 澶栧崗鎯呭喌涓�
workGatherArr = this.workDialogForm.workArr.filter(item => item.type === 'W')
@@ -802,7 +851,7 @@
console.log('3.绗笁绉嶆儏鍐� 鍗婂彾涓洪浂 鍏ㄥ彾涓嶄负闆�')
console.log(obj.code, 12)
this.workDialogForm.workGatherArr.forEach((item, index) => {
- if (item.code === obj.code) {
+ if (item.code === checkedFatherCode) {
this.workDialogForm.workGatherArr[index].isSelected2 = true
this.workDialogForm.workCodeSelectedGatherArr.push(obj.code)
this.$nextTick(() => {
@@ -859,6 +908,7 @@
const res = await SaveStepAssociationEqp(this.workDialogForm.stepcode, data)
if (res.code === '200') {
this.$message.success('淇濆瓨鎴愬姛锛�')
+ await this.getStepSearch()
this.workDialogVisible = false
}
},
@@ -893,7 +943,7 @@
this.defectDialogVisible = false
},
// 纭
- async defectDialogVisibleConfirm() {
+ async defectDialogVisibleConfirm() {
const nodeKey = this.$refs.defectTree.getCheckedKeys()
const data = []
this.defectTree[0].children.forEach(item => {
@@ -905,77 +955,17 @@
const res = await SaveStepAssociationDefect(this.defectTreeCode, data)
if (res.code === '200') {
this.$message.success('淇濆瓨鎴愬姛锛�')
+ await this.getStepSearch()
this.defectDialogVisible = false
}
}
}
}
</script>
-
<style lang="scss" scoped>
$main_color: #42b983;
-::v-deep .el-button--primary {
- background-color: $main_color !important;
- height: 30px;
- display: flex;
- align-items: center;
- //border: 1px solid $main_color;
- border: none;
- padding: 0 20px;
-}
-
-::v-deep .el-button--primary:hover {
- border: none;
-}
-
-::v-deep .el-button--info {
- height: 30px;
- display: flex;
- align-items: center;
- padding: 0 20px;
-}
-
-::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
- background-color: $main_color !important;
-}
-
-::v-deep .el-dialog__footer {
- display: flex;
- justify-content: flex-end;
-}
-
-.footerButton {
- display: flex;
- justify-content: end;
-}
-
-::v-deep .el-button--default {
- background-color: #ffffff !important;
- height: 30px;
- display: flex;
- align-items: center;
- padding: 0 20px;
-}
-
-::v-deep .el-button--default:hover {
- color: #606266;
-}
-
-::v-deep .el-dialog__body {
- padding: 20px 100px !important;
-}
-
-.defectDialogVisible {
- ::v-deep .el-dialog__body {
- padding: 20px 20px !important;
- }
-}
.workDialogVisible {
- ::v-deep .el-dialog__body {
- padding: 20px 20px !important;
- }
-
.myCheckboxGroup {
display: flex;
flex-wrap: wrap;
@@ -1029,27 +1019,60 @@
}
}
-::v-deep .el-radio__input.is-checked .el-radio__inner {
- background-color: $main_color;
- border-color: $main_color;
+</style>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+ color: $main_color;
+ cursor: pointer;
}
-::v-deep .el-radio__input.is-checked + .el-radio__label {
- color: $main_color !important;
+.el-icon-edit-outline {
+ margin-right: 15px;
}
-::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
- border-color: $main_color;
- background-color: $main_color;
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+ height: 34px;
+ display: flex;
+ align-items: center;
+ padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+ //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+ background-color: #f8f8fa;
+ border: none;
}
::v-deep .el-input__inner {
- height: 30px;
- line-height: 30px;
+ height: 34px;
+ line-height: 34px;
+ //color: #a7a7a7;
}
-::v-deep .el-input__inner:focus {
- border-color: $main_color;
+::v-deep .el-dialog__body {
+ padding: 20px 100px !important;
+}
+
+::v-deep .workDialogVisible .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .defectDialogVisible .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+ display: flex;
+ justify-content: flex-end;
}
::v-deep .el-table .caret-wrapper {
@@ -1057,57 +1080,25 @@
}
::v-deep .cell {
- display: flex !important;
- align-items: center !important;
- justify-content: space-between !important;
-}
-
-::v-deep .el-button--text {
- color: $main_color;
- font-size: 14px;
- cursor: pointer;
-}
-
-.operationClass {
- height: 23px;
display: flex;
- justify-content: space-between;
align-items: center;
+ justify-content: space-between;
}
-.el-icon-share {
- color: $main_color;
- cursor: pointer;
+::v-deep .el-table::before {
+ height: 0;
}
-.el-checkbox.is-bordered.is-checked {
- border-color: $main_color;
+::v-deep .el-table__body-wrapper {
+ background-color: #f8f8fa;
}
-::v-deep .el-radio__input.is-checked .el-radio__inner {
- border-color: $main_color;
- background: $main_color;
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
}
-::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner {
- border-color: $main_color;
- background: $main_color;
-}
-
-::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
- color: $main_color !important;
-}
-
-::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered {
- margin: 10px 30px 0px 0;
-}
-
-::v-deep .el-radio__input.is-checked + .el-radio__label {
- color: $main_color;
-}
-
-::v-deep .el-radio.is-bordered + .el-radio.is-bordered {
- margin: 10px 30px 0px 0;
+::v-deep .el-form--inline .el-form-item__label {
+ color: #a7a7a7;
}
.body ::v-deep .el-divider {
@@ -1120,24 +1111,14 @@
margin-bottom: 0;
}
-::v-deep .el-input__inner:focus {
- border-color: $main_color;
+.userDialogVisible ::v-deep .el-form-item {
+ margin-bottom: 0;
}
-::v-deep .el-select .el-input__inner:focus {
- border-color: $main_color;
-}
+</style>
+<style>
-::v-deep .el-select-dropdown__item.selected {
- color: $main_color;
+.el-table .custom-row {
+ background: #f8f8fa;
}
-
-::v-deep .el-checkbox__inner:hover {
- border-color: $main_color;
-}
-
-::v-deep .el-textarea__inner:focus {
- border-color: $main_color;
-}
-
</style>
--
Gitblit v1.9.3