From e713b378b01d189f972cfb5b9eae749ee95a8b51 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期六, 29 十月 2022 13:48:00 +0800
Subject: [PATCH] 1.解决两个账号登录,是否被挤掉的问题
---
src/views/sbgl/bybw.vue | 236 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 119 insertions(+), 117 deletions(-)
diff --git a/src/views/sbgl/bybw.vue b/src/views/sbgl/bybw.vue
index 367e671..63e8240 100644
--- a/src/views/sbgl/bybw.vue
+++ b/src/views/sbgl/bybw.vue
@@ -1,25 +1,25 @@
<template>
<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-download" @click="upload">瀵煎叆</el-button>
+ <!-- <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
</div>
<div class="bodyTopFormGroup">
<el-form
ref="form"
:model="form"
- label-width="80px"
+ label-width="100px"
inline
style="display: flex;justify-content: space-between"
>
<div class="elForm">
- <el-form-item label="閮ㄤ綅缂栫爜" style=" display: flex;">
- <el-input v-model="form.checkitemcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ <el-form-item label-width="70px" label="閮ㄤ綅缂栫爜" style=" display: flex;">
+ <el-input v-model="form.maiitemcode" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="閮ㄤ綅鍚嶇О" style=" display: flex;">
- <el-input v-model="form.checkitemname" placeholder="璇疯緭鍏�" style="width: 200px" />
+ <el-input v-model="form.maiitemname" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="淇濆吇瑕佹眰" style=" display: flex;">
<el-input v-model="form.maidescr" placeholder="璇疯緭鍏�" style="width: 200px" />
@@ -34,29 +34,25 @@
/>
</el-select>
</el-form-item>
- <el-form-item label="鐐规鍛ㄦ湡" style=" display: flex;">
- <el-select v-model="form.cycle" style="width: 200px" placeholder="璇烽�夋嫨">
- <el-option
- v-for="item in cycleArr"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- </el-form-item>
+
</div>
- <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+ <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
<el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
<el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
</div>
</el-form>
+ <div
+ class="bodyTopFormExpand"
+ />
</div>
<div class="elTableDiv">
<el-table
+ ref="tableDataRef"
:data="tableData"
:height="tableHeight+'px'"
border
+ class="tableFixed"
:row-class-name="tableRowClassName"
:style="{width: 100+'%',height:tableHeight+'px',}"
highlight-current-row
@@ -71,15 +67,16 @@
<el-table-column
prop="RowNum"
width="50"
+ fixed
label="搴忓彿"
/>
<el-table-column
- prop="org_code"
+ prop="code"
label="閮ㄤ綅缂栫爜"
sortable="custom"
/>
<el-table-column
- prop="org_name"
+ prop="name"
label="閮ㄤ綅鍚嶇О"
sortable="custom"
/>
@@ -87,17 +84,29 @@
prop="description"
label="淇濆吇瑕佹眰"
sortable="custom"
- />
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.description">{{ row.description }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
<el-table-column
- prop="parentorg_name"
+ prop="isscan"
label="閫夋嫨鎵爜"
sortable="custom"
- />
- <el-table-column
- prop="parentorg_name"
- label="鐐规鍛ㄦ湡"
- sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isscan==='Y'">
+ <svg-icon icon-class="circleYes" style="margin-right: 2px" />
+ 鏄�
+ </div>
+ <div v-if="row.isscan==='N'">
+ <svg-icon icon-class="circleNo" style="margin-right: 2px" />
+ 鍚�
+ </div>
+ </template>
+ </el-table-column>
<el-table-column
prop="lm_user"
label="鍒涘缓浜哄憳"
@@ -111,11 +120,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>
@@ -127,7 +142,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="getDeviceMaiItemSearch"
/>
@@ -143,50 +158,41 @@
@close="handleClose"
>
<el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
- <el-form-item label="閮ㄤ綅缂栫爜" prop="OrgCode">
- <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 200px" />
+ <el-form-item label="閮ㄤ綅缂栫爜" prop="maiitemcode">
+ <el-input v-model="dialogForm.maiitemcode" :disabled="operation!=='add'" style="width: 200px" />
</el-form-item>
- <el-form-item label="閮ㄤ綅鍚嶇О" prop="OrgName">
- <el-input v-model="dialogForm.OrgName" style="width: 200px" />
+ <el-form-item label="閮ㄤ綅鍚嶇О" prop="maiitemname">
+ <el-input v-model="dialogForm.maiitemname" style="width: 200px" />
</el-form-item>
- <el-form-item prop="SupUnit" label="淇濆吇鍛ㄦ湡">
+
+ <el-form-item required label="閫夋嫨鎵爜">
<el-select
- v-model="dialogForm.SupUnit"
+ v-model="dialogForm.isqrcode"
style="width: 200px"
placeholder="璇烽�夋嫨"
:popper-append-to-body="false"
>
<el-option
- v-for="item in SupUnitArr"
+ v-for="item in isqrcodeArr"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
- <el-form-item prop="SupUnit" label="閫夋嫨鎵爜">
- <el-select
- v-model="dialogForm.SupUnit"
- style="width: 200px"
- placeholder="璇烽�夋嫨"
- :popper-append-to-body="false"
- >
- <el-option
- v-for="item in SupUnitArr"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="淇濆吇瑕佹眰" prop="OrgName">
- <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
+ <el-form-item label="淇濆吇瑕佹眰" prop="maiitemdescr">
+ <el-input v-model="dialogForm.maiitemdescr" type="textarea" style="width: 200px" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<div class="footerButton">
<el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
- <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+ <el-button
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="dialogVisibleConfirm"
+ >纭� 瀹�</el-button>
</div>
</span>
</el-dialog>
@@ -199,79 +205,55 @@
<script>
import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
-import { DeviceCheckItemSearch, DeviceMaiItemSearch } from '@/api/sbgl'
-import ImportPicker from '@/components/ImportPicker'
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
+import { AddUpdateDeviceMaiItem, DeleteDeviceMaiItem, DeviceMaiItemSearch } from '@/api/sbgl'
+import ImportPicker from '@/components/ImportPicker'
+import { validateCode } from '@/utils/global'
+
export default {
name: 'Zzjg',
components: {
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 {
+ mouseHoverType: 'mouseout',
+ isExpandForm: false,
mainHeight: 0,
tableHeight: 0,
form: {
- checkitemcode: '', // 閮ㄤ綅缂栫爜
- checkitemname: '', // 閮ㄤ綅鍚嶇О
+ maiitemcode: '', // 閮ㄤ綅缂栫爜
+ maiitemname: '', // 閮ㄤ綅鍚嶇О
maidescr: '', // 淇濆吇瑕佹眰
isqrcode: '', // 閫変腑鎵爜
- cycle: '', // 鐐规鍛ㄦ湡
prop: 'lm_date', // 鎺掑簭瀛楁
order: 'desc', // 鎺掑簭瀛楁
page: 1, // 绗嚑椤�
rows: 20 // 姣忛〉澶氬皯鏉�
},
isqrcodeArr: [
-
- ],
- cycleArr: [
-
+ { code: 'Y', name: '鏄�' },
+ { code: 'N', name: '鍚�' }
],
total: 10,
tableData: [],
dialogVisible: false,
dialogForm: {
- OrgType: '',
- OrgCode: '',
- OrgName: '',
- SupUnit: ''// 涓婄骇鍗曚綅
+ id: '',
+ maiitemcode: '',
+ maiitemname: '',
+ maiitemdescr: '',
+ isqrcode: 'N',
+ OperType: ''
},
operation: '',
dialogFormRules: {
- OrgType: [
- { required: true, message: '璇疯緭鍏ラ�夋嫨绫诲瀷', trigger: ['blur', 'change'] }
+ maiitemcode: [
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
- OrgCode: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
- ],
- OrgName: [
+ maiitemname: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
- ],
- SupUnit: [
- { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
]
},
@@ -327,10 +309,10 @@
},
// 閲嶇疆
reset() {
- this.form.OrgCode = ''
- this.form.OrgName = ''
- this.form.OrgType = ''
- this.form.UserName = ''
+ this.form.maiitemcode = ''
+ this.form.maiitemname = ''
+ this.form.maidescr = ''
+ this.form.isqrcode = ''
this.getDeviceMaiItemSearch()
},
@@ -345,9 +327,11 @@
this.dialogVisible = true
this.$nextTick(() => {
- this.dialogForm.OrgCode = row.org_code
- this.dialogForm.OrgName = row.org_name
- this.dialogForm.SupUnit = row.parent_id
+ this.dialogForm.id = row.id
+ this.dialogForm.maiitemcode = row.code
+ this.dialogForm.maiitemname = row.name
+ this.dialogForm.maiitemdescr = row.description
+ this.dialogForm.isqrcode = row.isscan
})
},
// 鍒犻櫎鎸夐挳
@@ -357,9 +341,12 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- DeleteOrganization({ orgid: row.code }).then(res => {
+ DeleteDeviceMaiItem({ maiitemcode: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
this.getDeviceMaiItemSearch()
}
})
@@ -369,10 +356,11 @@
},
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
- this.dialogForm.OrgType = ''
- this.dialogForm.OrgCode = ''
- this.dialogForm.OrgName = ''
- this.dialogForm.SupUnit = ''
+ this.dialogForm.id = ''
+ this.dialogForm.maiitemcode = ''
+ this.dialogForm.maiitemname = ''
+ this.dialogForm.maiitemdescr = ''
+ this.dialogForm.isqrcode = 'N'
this.$refs.dialogForm.clearValidate()
},
// 瀵硅瘽妗嗗彇娑�
@@ -383,17 +371,21 @@
dialogVisibleConfirm() {
this.$refs.dialogForm.validate(valid => {
if (valid) {
+ this.$store.state.app.buttonIsDisabled = true
const data = {
- OrganCode: this.dialogForm.OrgCode,
- OrganName: this.dialogForm.OrgName,
- OperType: this.operation === 'add' ? 'Add' : 'Update',
- Operator: getCookie('admin')
+ id: this.dialogForm.id,
+ maiitemcode: this.dialogForm.maiitemcode,
+ maiitemname: this.dialogForm.maiitemname,
+ maiitemdescr: this.dialogForm.maiitemdescr,
+ isqrcode: this.dialogForm.isqrcode,
+ OperType: this.operation === 'add' ? 'Add' : 'Update'
}
- AddUpdateOrganization(data).then(res => {
+ AddUpdateDeviceMaiItem(data).then(res => {
if (res.code === '200') {
- this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
this.dialogVisible = false
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
this.getDeviceMaiItemSearch()
+ this.$store.state.app.buttonIsDisabled = false
} else {
this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
@@ -405,7 +397,8 @@
getHeight() {
this.$nextTick(() => {
this.mainHeight = window.innerHeight - 85
- this.tableHeight = this.mainHeight - 200
+ this.tableHeight = this.mainHeight - 195
+ this.$refs.tableDataRef.doLayout()
})
},
tableRowClassName({ row, rowIndex }) {
@@ -511,6 +504,15 @@
margin-bottom: 0;
}
+.tableFixed{
+ ::v-deep .el-table__fixed-right{
+ height: 100% !important;
+ }
+ ::v-deep .el-table__fixed{
+ height: 100% !important;
+ }
+}
+
</style>
<style>
--
Gitblit v1.9.3