xiaobai 3 years ago
parent
commit
ffdba7b94b
  1. 2
      .env.production
  2. 2
      .env.test
  3. 9
      src/api/data_scope_department.js
  4. 18
      src/components/Crud/Edit/index.vue
  5. 2
      src/components/Crud/crud.js
  6. 48
      src/components/drawerDialog/index.vue
  7. 1
      src/directive/permission/permission.js
  8. 8
      src/main.js
  9. 40
      src/styles/index.scss
  10. 14
      src/utils/apibjd.js
  11. 13
      src/views/borrow/borrow.vue
  12. 248
      src/views/user/components/data-permission.vue
  13. 61
      src/views/user/department.vue
  14. 158
      src/views/user/role.vue
  15. 414
      src/views/ysjl/2000/2100/fenxiang/aqfj.vue

2
.env.production

@ -22,4 +22,4 @@ VUE_APP_SJ_API = 'http://${VUE_APP_SJ_BASE_IP_ADDRESS}:9092/SJSE/'
VUE_APP_PREVIEW_API = '${VUE_APP_SERVER_API}/sdma-preview/'
# websocket连接地址
VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}/sdma-websocket/websocket/'
VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}:9100/sdma-websocket/websocket/'

2
.env.test

@ -22,4 +22,4 @@ VUE_APP_SJ_API = 'http://${VUE_APP_SJ_BASE_IP_ADDRESS}:9092/SJSE/'
VUE_APP_PREVIEW_API = '${VUE_APP_SERVER_API}/sdma-preview/'
# websocket连接地址
VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}/sdma-websocket/websocket/'
VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}:9100/sdma-websocket/websocket/'

9
src/api/data_scope_department.js

@ -0,0 +1,9 @@
import api from '@/utils/api'
export function getAll(params) {
return api({
url: '/dataScopeDepartment/all',
method: 'get',
params
})
}

18
src/components/Crud/Edit/index.vue

@ -1,8 +1,5 @@
<template>
<el-button v-if="!flag" type="text" :disabled="disabledEdit" icon="edit" @click="crud.toEdit(data)">
修改
</el-button>
<el-button v-else type="text" :disabled="disabledEdit" icon="edit" @click="editFn(data)">
<el-button v-permission="permission.edit" type="text" :disabled="disabledEdit" icon="edit" @click="crud.toEdit(data)">
修改
</el-button>
</template>
@ -15,18 +12,13 @@ export default {
type: Object,
required: true
},
permission: {
type: Object,
required: true
},
disabledEdit: {
type: Boolean,
default: false
},
flag: {
type: Boolean,
defalut: false
}
},
methods: {
editFn() {
this.$emit('editFn', this.data)
}
}
}

2
src/components/Crud/crud.js

@ -291,7 +291,7 @@ function CRUD(options) {
if (!delAll) {
dataStatus.delete = CRUD.STATUS.PROCESSING
}
return crud.crudMethod.del(delAll ? { idArray: ids } : singleId).then(() => {
return crud.crudMethod.del(delAll ? { ids: ids } : singleId).then(() => {
if (!delAll) {
dataStatus.delete = CRUD.STATUS.PREPARED
}

48
src/components/drawerDialog/index.vue

@ -57,8 +57,8 @@
placeholder="报告类型"
style="width: 215px"
clearable
@change="getDicCodeList"
>
<!-- @change="getDicCodeList" -->
<el-option
v-for="item in bglxList"
:key="item.value"
@ -161,6 +161,7 @@
v-model="formTemplate.withDicCode"
placeholder="对应字典"
style="width: 420px"
filterable
clearable
>
<el-option
@ -176,6 +177,7 @@
v-model="formTemplate.parentId"
placeholder="父类模板"
style="width: 420px"
filterable
clearable
>
<el-option
@ -870,12 +872,12 @@ export default {
if (this.id) {
this.loadFormData(this.index)
this.getList()
} else {
this.$refs['formTemplate'].resetFields()
} else if (this.$refs.formTemplate) {
this.$refs.formTemplate.resetFields()
this.clearForm()
this.getBglxList()
}
this.getSbList(undefined, undefined, 1)
this.getBglxList()
this.getJylbList()
this.getTemplateIdentification()
},
@ -1023,10 +1025,6 @@ export default {
}
}
},
handleSettingChange(row) {
this.moduleArr = row
// this.getDemoList(row.id)
},
getTemplateIdentification() {
this.api({
url: '/dicData/getDicDataByTypeCode',
@ -1061,7 +1059,7 @@ export default {
)
},
getBglxList() {
this.api({
return this.api({
url: '/dicData/getDicDataByTypeCode',
method: 'get',
params: {
@ -1122,20 +1120,24 @@ export default {
}
})
},
getDicCodeList(val) {
for (let i = 0; i < this.bglxList.length; i++) {
if (val === 1) {
this.dicCodeList = []
break
} else if (val === this.bglxList[i].value) {
this.getDicDataByTypeCode(
this.bglxList[i].code,
'dicCode',
this.bglxList[i].id
)
break
}
getDicCodeList(val, resetWithDicCode) {
// 0.
if (resetWithDicCode) {
this.formTemplate.withDicCode = undefined
}
// 1.
if (val === 1) {
this.dicCodeList = []
return
}
// 2.
const bglxs = this.bglxList.filter(row => row.value === val)
if (!bglxs.length) {
return
}
// 3.
const bglx = bglxs[0]
this.getDicDataByTypeCode(bglx.code, 'dicCode', bglx.id)
},
getNeibuList(type, parentCode, species) {
this.api({
@ -1169,7 +1171,7 @@ export default {
this.formTemplate.shebeipinzhongdaima
)
this.neibuleibie = JSON.parse(this.formTemplate.neibuleibie)
this.getDicCodeList(this.formTemplate.bglx)
this.getBglxList().then(() => this.getDicCodeList(this.formTemplate.bglx, false))
this.getNeibuList(
'nblb',
this.formTemplate.jianyanleibie,

1
src/directive/permission/permission.js

@ -4,7 +4,6 @@ export default {
inserted(el, binding, vnode) {
const { value } = binding
const roles = store.getters && store.getters.permissions
console.log(roles)
if (value && value instanceof Array && value.length > 0) {
const permissionRoles = value
const hasPermission = roles.some(role => {

8
src/main.js

@ -31,6 +31,9 @@ import adaptive from './directive/el-table'
import vueqr from 'vue-qr'
import JSONView from 'vue-json-viewer'
import { checkPermission } from './utils/permission'
import Cookies from 'js-cookie'
Vue.use(JSONView)
Vue.use(permission)
@ -49,7 +52,10 @@ Vue.use(CellGroup)
Vue.use(Cell)
Vue.use(Col)
Vue.use(ElementUI, { locale })
Vue.use(ElementUI, {
locale,
size: Cookies.get('size') || 'small' // set element-ui default size
})
// 全局的常量
Vue.prototype.checkPermission = checkPermission

40
src/styles/index.scss

@ -87,7 +87,45 @@ a:hover {
}
.app-container {
padding: 5px 20px;
padding: 20px 20px 5px 20px;
}
.components-container {
margin: 30px 50px;
position: relative;
}
.filter-container {
padding-bottom: 10px;
.filter-item {
display: inline-block;
vertical-align: middle;
margin-bottom: 10px;
}
}
.head-container {
padding-bottom: 10px;
.filter-item {
display: inline-block;
vertical-align: middle;
margin: 0 3px 10px 0;
}
.el-button+.el-button {
margin-left: 0 !important;
}
.el-select__caret.el-input__icon.el-icon-arrow-up{
line-height: 30.5px;
}
.date-item {
display: inline-block;
vertical-align: middle;
margin-bottom: 10px;
height: 30.5px;
width: 223px !important;
}
}
fieldset {

14
src/utils/apibjd.js

@ -1,5 +1,5 @@
import axios from 'axios'
import { Message } from 'element-ui'
import { Notification } from 'element-ui'
import store from '../store'
import { showLoading, hideLoading } from './apiHelper'
// 创建axios实例
@ -36,7 +36,7 @@ service.interceptors.response.use(
if (res.data.returnCode === 1) {
return res.data.returnData
} else if (res.data.returnCode === '20011') {
Message({
Notification({
showClose: true,
message: res.returnMsg,
type: 'error',
@ -49,7 +49,7 @@ service.interceptors.response.use(
})
return Promise.reject('未登录')
} else {
Message({
Notification({
message: res.data.returnMsg || '请求处理异常,请稍后再试',
type: 'error',
duration: 3 * 1000
@ -64,7 +64,7 @@ service.interceptors.response.use(
} if (res.returnCode === 1) {
return res.returnData
} else if (res.returnCode === '20011') {
Message({
Notification({
showClose: true,
message: res.returnMsg,
type: 'error',
@ -88,7 +88,7 @@ service.interceptors.response.use(
if (res.data && res.data.constructor === String) {
msg = msg ? msg + ':' + res.data : res.data
}
Message({
Notification({
message: msg,
type: 'error',
duration: 3 * 1000
@ -99,8 +99,8 @@ service.interceptors.response.use(
error => {
hideLoading()
console.error('err' + error) // for debug
Message({
message: error.response.data.msg,
Notification({
message: error.response.data && error.response.data.message ? error.response.data.message : error.message,
type: 'error',
duration: 3 * 1000
})

13
src/views/borrow/borrow.vue

@ -52,13 +52,9 @@
>
<el-table-column slot="operation" align="center" width="100" label="操作">
<template slot-scope="scope">
<Edit
:permission="permission"
:data="scope.row"
:disabled-edit="false"
:flag="true"
@editFn="editFn"
/>
<el-button v-permission="permission.edit" type="text" icon="edit" @click="editFn(scope.row)">
修改
</el-button>
</template>
</el-table-column>
</CustomTable>
@ -97,7 +93,6 @@
<script>
import CRUD, { form, header, presenter } from '@/components/Crud/crud'
// import Crud from '@/components/Crud'
import Edit from '@/components/Crud/Edit'
import CustomTable from '@/components/Crud/Table'
import Pagination from '@/components/Crud/Pagination'
import { addBorrowFn } from '@/api/common'
@ -122,7 +117,7 @@ const defaultForm = form({
export default {
name: 'InstrumentList',
components: { Pagination, CustomTable, Edit },
components: { Pagination, CustomTable },
mixins: [defaultCrud, defaultForm, header()],
data() {
return {

248
src/views/user/components/data-permission.vue

@ -0,0 +1,248 @@
<template>
<el-drawer title="数据权限" :visible="show" size="90%" :destroy-on-close="true" @close="close">
<el-form ref="permission" :model="permission" label-width="100px">
<el-form-item label="角色名称">
{{ permission.roleName }}
</el-form-item>
<el-form-item label="角色代码">
{{ permission.roleCode }}
</el-form-item>
<el-form-item label="权限范围">
<el-select v-model="permission.dataScope">
<el-option v-for="(item, index) in dataScopes" :key="index" :label="item" :value="index" />
</el-select>
</el-form-item>
<el-form-item v-if="permission.dataScope === 1" label="数据权限">
<el-table
ref="departments"
:data="departments"
border
fit
height="650"
highlight-current-row
row-key="id"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
style="width: 99%;"
>
<el-table-column label="部门名称">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.checked" :indeterminate="scope.row.indeterminate" @change="handleCheckAllChange(scope.row, $event)">
{{ scope.row.name }}
</el-checkbox>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<el-row :gutter="20">
<el-col :span="4" :offset="2">
<el-select v-if="permission.dataScope === 1" v-model="showMode" @change="changeShowMode">
<el-option
v-for="(item, index) in showModes"
:key="index"
:label="item"
:value="index"
/>
</el-select>
</el-col>
<el-col :span="4" :offset="14">
<el-button type="primary" @click="update">
</el-button>
<el-button @click="close">
</el-button>
</el-col>
</el-row>
</el-drawer>
</template>
<script>
import CrudRole from '@/api/role'
import { getAll } from '@/api/data_scope_department'
export default {
name: 'DataPermission',
data() {
return {
show: false,
permission: {},
dataScopes: ['全部数据权限', '自定义数据权限', '本部门数据权限', '本部门及下级数据权限', '仅本人数据权限'],
departments: [],
showMode: 0,
showModes: ['合并所有', '展开所有', '全部勾选', '取消勾选'],
checkedIds: new Set()
}
},
mounted() {
const that = this
this.common.$on('openDataPermission', function(data) {
that.open(data)
})
},
created() {
const that = this
this.common.$on('openDataPermission', function(data) {
that.open(data)
})
this.getDepartmentList()
},
methods: {
open(data) {
this.permission = data
this.getAllDataScopeDepartment()
this.show = true
},
close() {
this.show = false
},
getAllDataScopeDepartment() {
getAll({
roleId: this.permission.id
}).then(data => {
data = data.map(row => row.departmentId)
this.departments.forEach(permission => {
if (permission.children.length > 0) {
this.echoChildren(permission.children, data)
} else {
this.settingChecked(permission, data)
}
})
})
},
getDepartmentList() {
//
this.api({
url: '/department/tree',
method: 'get'
}).then(data => {
this.departments = data
})
},
/**
* 改变展示方式
*/
changeShowMode(val) {
switch (val) {
case 0:
this.departments.forEach(row => this.$refs.departments.toggleRowExpansion(row, false))
break
case 1:
this.departments.forEach(row => this.$refs.departments.toggleRowExpansion(row, true))
break
case 2:
this.departments.forEach(row => {
row.checked = true
row.indeterminate = false
this.handleCheckAllChange(row, true)
})
break
case 3:
this.departments.forEach(row => {
row.checked = false
row.indeterminate = false
this.handleCheckAllChange(row, false)
})
break
default:
break
}
},
update() {
console.log(this.checkedIds)
console.log(Array.from(this.checkedIds))
this.permission.dataScopeDepartmentIds = Array.from(this.checkedIds)
console.log(this.permission)
CrudRole.edit(this.permission).then(() => this.$notify.success('操作成功'))
},
handleCheckAllChange(val, checked) {
if (checked) {
this.checkedIds.add(val.id)
} else {
this.checkedIds.delete(val.id)
}
//
if (val.children.length > 0) {
this.findChildren(val.children, checked)
}
//
if (val.parentId !== 0) {
this.findParent(this.departments, val.parentId)
}
val.indeterminate = false
},
findChildren(list, checked) {
list.forEach(children => {
children.checked = checked
children.indeterminate = false
if (children.children.length > 0) {
this.findChildren(children.children, checked)
}
})
},
findParent(list, parentId) {
list.forEach(result => {
let parentCheckedLength = 0
let parentIndeterminateLength = 0
//
if (result.id === parentId) {
//
result.children.forEach(children => {
if (children.indeterminate) {
parentIndeterminateLength++
} else if (children.checked) {
parentCheckedLength++
}
})
result.checked = parentCheckedLength === result.children.length
result.indeterminate = (parentIndeterminateLength > 0 || parentCheckedLength > 0) && parentCheckedLength < result.children.length
if (result.checked) {
this.checkedIds.add(result.id)
} else {
this.checkedIds.delete(result.id)
}
//
if (result.parentId !== 0) {
this.findParent(this.departments, result.parentId)
}
} else if (result.children.length > 0) {
this.findParent(result.children, parentId)
}
})
},
echoChildren(list, optionsIds) {
list.forEach(result => {
if (result.children.length === 0) {
this.settingChecked(result, optionsIds)
} else {
this.echoChildren(result.children, optionsIds)
}
})
},
settingChecked(result, optionsIds) {
let matching = false
optionsIds.forEach(optionsId => {
this.checkedIds.add(optionsId)
if (result.id === optionsId) {
result.checked = true
matching = true
}
})
if (matching) {
this.handleCheckChange(result)
}
},
handleCheckChange(val) {
//
if (val.parentId !== 0) {
this.findParent(this.departments, val.parentId)
}
}
}
}
</script>
<style scoped>
</style>

61
src/views/user/department.vue

@ -26,6 +26,8 @@
highlight-current-row
@row-click="onRowClick"
@selection-change="handleSelectionChange"
@select="rowSelect"
@select-all="selectAll"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" align="center" label="序号" width="80" />
@ -117,8 +119,10 @@ export default {
method: 'get',
params: this.listQuery
}).then(data => {
data.forEach(row => {
row.isChecked = false
})
this.list = data
this.totalCount = data.total
})
},
showCreate() {
@ -227,6 +231,61 @@ export default {
closeDialog() {
this.unAllotUserList = []
this.departmentUserList = []
},
/**
* 注意在获取初始数据时所有节点包括子节点都增加一个isChecked 标志参数
*
* @param selection
* @param row
*/
rowSelect(selection, row) {
if (row.children) { //
if (!row.isChecked) { // isChecked
row.children.map((item) => { //
this.$refs.list.toggleRowSelection(item, true) //
/*
方法名 说明 参数
用于多选表格切换某一行的选中状态 row, selected
toggleRowSelection 如果使用了第二个参数则是设置这一行
选中与否selected true 则选中
*/
item.isChecked = true
})
row.isChecked = true // isCheckedfalse
} else {
row.children.map((item) => {
this.$refs.list.toggleRowSelection(item, false)
item.isChecked = false
})
row.isChecked = false
}
// console.log(this.multipleSelection, row);
}
},
selectAll(selection) {
// selection
this.$refs.list.data.map((items) => { // 使$refdatamap
if (items.children) {
if (!items.isChecked) { //
this.$refs.list.toggleRowSelection(items, true) //
items.isChecked = true //
items.children.map((item) => { //
this.$refs.list.toggleRowSelection(item, true)
item.isChecked = true
})
} else { //
this.$refs.list.toggleRowSelection(items, false)
items.isChecked = false
items.children.map((item) => {
this.$refs.list.toggleRowSelection(item, false)
item.isChecked = false
})
}
} else {
items.isChecked = !items.isChecked
}
})
// console.log(this.orgs)
}
}
}

158
src/views/user/role.vue

@ -10,16 +10,21 @@
</div>
<!--表格内容-->
<CustomTable ref="customTable" :col-configs="colConfigs" :columns="columns" :crud="crud">
<el-table-column v-if="checkPermission(permission.edit)" slot="operation" align="center" width="100" label="操作">
<el-table-column v-if="checkPermission(permission.edit)" slot="operation" align="center" width="200" label="操作">
<template slot-scope="scope">
<Edit :permission="permission" :data="scope.row" :disabled-edit="false" />
<el-button type="text" icon="edit" @click="editDataPermission(scope.row)">
数据权限
</el-button>
</template>
</el-table-column>
</CustomTable>
<pagination />
<!--弹出框内容-->
<el-dialog
width="80%"
<el-drawer
ref="roleDrawer"
direction="rtl"
size="90%"
:before-close="crud.cancelCU"
:visible="crud.status.editor > 0"
:title="crud.status.title"
@ -33,14 +38,15 @@
</el-form-item>
<el-form-item label="功能权限:">
<el-table
ref="menuList"
:data="menuList"
ref="permissions"
:data="permissions"
border
fit
height="680"
highlight-current-row
row-key="permission.id"
:default-expand-all="true"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
style="width: 99%;"
>
<el-table-column label="菜单名称" width="400">
<template slot-scope="scope">
@ -52,7 +58,7 @@
<el-table-column label="功能选项">
<template v-if="scope.row.children.length === 0" slot-scope="scope">
<el-checkbox
v-for="options in scope.row.resourcePermissionList"
v-for="options in scope.row.resourcePermissions"
:key="options.id"
v-model="options.checked"
:label="options.permissionType"
@ -63,15 +69,28 @@
</el-table>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="crud.cancelCU">
</el-button>
<el-button type="primary" @click="crud.submitCU">
</el-button>
</div>
</el-dialog>
<el-row :gutter="20">
<el-col :span="4" :offset="2">
<el-select v-model="showMode" @change="changeShowMode">
<el-option
v-for="(item, index) in showModes"
:key="index"
:label="item"
:value="index"
/>
</el-select>
</el-col>
<el-col :span="4" :offset="14">
<el-button type="primary" @click="crud.submitCU">
</el-button>
<el-button @click="crud.cancelCU">
</el-button>
</el-col>
</el-row>
</el-drawer>
<data-permission />
</div>
</template>
@ -84,6 +103,8 @@ import CustomTable from '@/components/Crud/Table'
import Pagination from '@/components/Crud/Pagination'
import CrudRole from '@/api/role'
import { getPermissionsByRoleId, getTree } from '@/api/permission'
import DataPermission from './components/data-permission'
import Utils from '@/utils/contact'
// crudpresenter
const defaultCrud = presenter(CRUD({
@ -98,16 +119,16 @@ const defaultForm = form({
id: null,
roleName: '',
roleCode: '',
menuOptionIds: {}
resourcePermissionIds: {}
})
export default {
name: 'RoleList',
components: { Pagination, Query, Crud, CustomTable, Edit },
components: { Pagination, Query, Crud, CustomTable, Edit, DataPermission },
mixins: [defaultCrud, defaultForm, header()],
data() {
return {
menuList: [],
permissions: [],
colConfigs: [
{ prop: 'roleName', label: '角色名称', align: 'center' },
{ prop: 'roleCode', label: '角色代码', align: 'center' },
@ -126,7 +147,9 @@ export default {
{ required: true, message: '请输入角色代码', trigger: 'blur' }
]
},
checkedIds: new Set()
checkedIds: new Set(),
showMode: 0,
showModes: ['合并所有', '展开所有', '全部勾选', '取消勾选']
}
},
mounted() {
@ -135,7 +158,7 @@ export default {
methods: {
//
[CRUD.HOOK.afterToCU]() {
this.clearChecked(this.menuList)
this.clearChecked(this.permissions)
this.checkedIds.clear()
},
//
@ -144,17 +167,62 @@ export default {
},
//
[CRUD.HOOK.afterValidateCU]() {
this.form.menuOptionIds = Array.from(this.checkedIds)
this.form.resourcePermissionIds = Array.from(this.checkedIds)
},
/**
* 加载数据权限窗口
*/
editDataPermission(data) {
console.log('加载数据权限窗口')
Utils.$emit('openDataPermission', data)
},
/**
* 改变展示方式
*/
changeShowMode(val) {
switch (val) {
case 0:
this.permissions.forEach(row => {
setTimeout(() => {
this.$refs.permissions.toggleRowExpansion(row, false)
}, 1000)
})
break
case 1:
this.permissions.forEach(row => {
setTimeout(() => {
this.$refs.permissions.toggleRowExpansion(row, true)
}, 1000)
})
break
case 2:
this.permissions.forEach(row => {
row.checked = true
row.indeterminate = false
this.handleCheckAllChange(row, true)
})
break
case 3:
this.permissions.forEach(row => {
row.checked = false
row.indeterminate = false
this.handleCheckAllChange(row, false)
})
break
default:
break
}
},
//
getAllMenu() {
getTree().then(data => {
this.menuList = data
this.permissions = data
})
},
getRoleMenuList(roleId) {
getPermissionsByRoleId(roleId).then(data => {
this.menuList.forEach(permission => {
data = data.map(row => row.resourcePermissionId)
this.permissions.forEach(permission => {
if (permission.children.length > 0) {
this.echoChildren(permission.children, data)
} else {
@ -166,15 +234,17 @@ export default {
handleCheckAllChange(val, checked) {
//
if (val.children.length > 0) {
if (checked) {
this.checkedIds.add(val.resourcePermissionList[0].id)
} else {
this.checkedIds.delete(val.resourcePermissionList[0].id)
if (val.resourcePermissions.length) {
if (checked) {
this.checkedIds.add(val.resourcePermissions[0].id)
} else {
this.checkedIds.delete(val.resourcePermissions[0].id)
}
}
this.findChildren(val.children, checked)
} else {
//
val.resourcePermissionList.forEach(options => {
val.resourcePermissions.forEach(options => {
options.checked = checked
if (checked) {
this.checkedIds.add(options.id)
@ -185,14 +255,14 @@ export default {
}
//
if (val.permission.pid !== 0) {
this.findParent(this.menuList, val.permission.pid)
this.findParent(this.permissions, val.permission.pid)
}
val.indeterminate = false
},
handleCheckChange(val) {
const length = val.resourcePermissionList.length
const length = val.resourcePermissions.length
let checkedLength = 0
val.resourcePermissionList.forEach(options => {
val.resourcePermissions.forEach(options => {
if (options.checked) {
this.checkedIds.add(options.id)
checkedLength++
@ -204,14 +274,14 @@ export default {
val.indeterminate = checkedLength > 0 && checkedLength < length
//
if (val.permission.pid !== 0) {
this.findParent(this.menuList, val.permission.pid)
this.findParent(this.permissions, val.permission.pid)
}
},
findChildren(list, checked) {
list.forEach(children => {
children.checked = checked
children.indeterminate = false
children.resourcePermissionList.forEach(options => {
children.resourcePermissions.forEach(options => {
options.checked = checked
if (checked) {
this.checkedIds.add(options.id)
@ -240,14 +310,16 @@ export default {
})
result.checked = parentCheckedLength === result.children.length
result.indeterminate = (parentIndeterminateLength > 0 || parentCheckedLength > 0) && parentCheckedLength < result.children.length
if (result.checked || result.indeterminate) {
this.checkedIds.add(result.resourcePermissionList[0].id)
} else {
this.checkedIds.delete(result.resourcePermissionList[0].id)
if (result.permission.component !== 'Layout') {
if (result.checked || result.indeterminate) {
this.checkedIds.add(result.resourcePermissions[0].id)
} else {
this.checkedIds.delete(result.resourcePermissions[0].id)
}
}
//
if (result.permission.pid !== 0) {
this.findParent(this.menuList, result.permission.pid)
this.findParent(this.permissions, result.permission.pid)
}
} else if (result.children.length > 0) {
this.findParent(result.children, pid)
@ -265,7 +337,7 @@ export default {
},
settingChecked(result, optionsIds) {
let matching = false
result.resourcePermissionList.forEach(options => {
result.resourcePermissions.forEach(options => {
optionsIds.forEach(optionsId => {
if (options.id === optionsId) {
options.checked = true
@ -278,11 +350,11 @@ export default {
}
},
//
clearChecked(menuList) {
menuList.forEach(permission => {
clearChecked(permissions) {
permissions.forEach(permission => {
permission.checked = false
permission.indeterminate = false
permission.resourcePermissionList.forEach(options => {
permission.resourcePermissions.forEach(options => {
options.checked = false
})
if (permission.children.length > 0) {

414
src/views/ysjl/2000/2100/fenxiang/aqfj.vue

@ -1,6 +1,6 @@
<!-- 安全附件分项页面 -->
<template>
<div class="app-container">
<div class="app-container" style="margin-top: -15px;">
<sticky style="margin-bottom: 10px;">
<btn ref="btn" />
</sticky>
@ -15,30 +15,46 @@
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="型号" prop="aqfxinghao">
<el-input v-model="param.aqfxinghao" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="数量" prop="aqfshuliang">
<el-input v-model="param.aqfshuliang" :disabled="edit || editAqf" />
<el-input v-model="param.aqfshuliang" :disabled="edit">
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="校验日期" prop="aqfjianyanriqi">
<el-input v-model="param.aqfjianyanriqi" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="是否在校验有效期内" label-width="170px" prop="aqfyouxiaoqi">
<el-select v-model="param.aqfyouxiaoqi" filterable allow-create default-first-option placeholder="请选择" :disabled="edit || editAqf">
<el-option label="是" value="是" />
<el-option label="否" value="否" />
<el-option label="无此项" value="无此项" />
</el-select>
<el-form-item label="校验报告编号" prop="aqfjiaoyanbaogaobianhao">
<el-input v-model="param.aqfjiaoyanbaogaobianhao" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item prop="aqfexist">
<el-checkbox v-model="param.aqfexist" label="设备本体无安全阀" true-label="设备本体无安全阀" border @change="changeAqf" />
<el-form-item label="整定压力" prop="aqfzhengdingyali">
<el-input v-model="param.aqfzhengdingyali" :disabled="edit">
<template slot="append">
MPa
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="检验日期" label-width="135px" prop="aqfjianyanriqi">
<el-input v-model="param.aqfjianyanriqi" :disabled="edit || editAqf" />
<el-form-item label="安装位置" prop="aqfanzhuangweizhi">
<el-input v-model="param.aqfanzhuangweizhi" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
@ -46,75 +62,307 @@
<fieldset>
<legend>爆破片装置</legend>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="型号" prop="bppxinghao">
<el-input v-model="param.bppxinghao" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="数量" prop="bppshuliang">
<el-input v-model="param.bppshuliang" :disabled="edit || editBpp" />
<el-input v-model="param.bppshuliang" :disabled="edit">
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="是否按期更换" prop="bppgenghuanzhouqiyaoqiu">
<el-select v-model="param.bppgenghuanzhouqiyaoqiu" filterable allow-create default-first-option placeholder="请选择" :disabled="edit || editBpp">
<el-option label="是" value="是" />
<el-option label="否" value="否" />
<el-option label="无此项" value="无此项" />
</el-select>
<el-form-item label="规格" prop="bppguige">
<el-input v-model="param.bppguige" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="更换周期要求" prop="bppgenghuanzhouqiyaoqiu">
<el-input v-model="param.bppgenghuanzhouqiyaoqiu" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item prop="bppexist">
<el-checkbox v-model="param.bppexist" label="设备本体无爆破片装置" true-label="设备本体无爆破片装置" border @change="changeBpp" />
<el-form-item label="更换日期" prop="bppgenghuariqi">
<el-input v-model="param.bppgenghuariqi" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="检验日期" label-width="135px" prop="bppjianyanriqi">
<el-input v-model="param.bppjianyanriqi" :disabled="edit || editBpp" />
<el-form-item label="安装位置" prop="bppanzhuangweizhi">
<el-input v-model="param.bppanzhuangweizhi" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>安全联锁装置</legend>
<legend>压力表</legend>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="是否满足设计文件规定的使用技术要求" label-width="270px" prop="shifoumanzu">
<el-select v-model="param.shifoumanzu" filterable allow-create default-first-option placeholder="请选择" :disabled="edit || editAqls">
<el-option label="是" value="是" />
<el-option label="否" value="否" />
<el-option label="无此项" value="无此项" />
</el-select>
<el-form-item label="量程" prop="ylbliangcheng">
<el-input v-model="param.ylbliangcheng" :disabled="edit">
<template slot="append">
MPa
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="数量" prop="ylbshuliang">
<el-input v-model="param.ylbshuliang" :disabled="edit">
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="精度" prop="ylbjingdu">
<el-input v-model="param.ylbjingdu" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="检定日期" prop="ylbjiandingriqi">
<el-input v-model="param.ylbjiandingriqi" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="检定记录编号" prop="ylbjiandingbaogaobianhao">
<el-input v-model="param.ylbjiandingbaogaobianhao" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="安装位置" prop="ylbanzhuangweizhi">
<el-input v-model="param.ylbanzhuangweizhi" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>紧急切断装置</legend>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="型式及规格" prop="jjqdzzxingshiguige">
<el-input v-model="param.jjqdzzxingshiguige" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="数量" prop="jjqdzzshuliang">
<el-input v-model="param.jjqdzzshuliang" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="耐压试验压力" prop="jjqdzznaiyashiyanyali">
<el-input v-model="param.jjqdzznaiyashiyanyali" :disabled="edit">
<template slot="append">
MPa
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="密闭试验压力" prop="jjqdzzmibishiyanyali">
<el-input v-model="param.jjqdzzmibishiyanyali" :disabled="edit">
<template slot="append">
MPa
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="切断时间" prop="jjqdzzqieduanshijian">
<el-input v-model="param.jjqdzzqieduanshijian" :disabled="edit">
<template slot="append">
S
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item prop="aqlsexist">
<el-checkbox v-model="param.aqlsexist" label="设备本体无安全联锁装置" true-label="设备本体无安全联锁装置" border @change="changeAqls" />
<el-form-item label="检修记录" prop="jjqdzzjianxiujilu">
<el-input v-model="param.jjqdzzjianxiujilu" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="检验日期" label-width="135px" prop="aqlsjianyanriqi">
<el-input v-model="param.aqlsjianyanriqi" :disabled="edit || editAqls" />
<el-form-item label="安装位置" prop="jjqdzzanzhuangweizhi">
<el-input v-model="param.jjqdzzanzhuangweizhi" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="外观" prop="jjqdzzwaiguan">
<el-input v-model="param.jjqdzzwaiguan" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>液位</legend>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="型式" prop="ywjxingshi">
<el-input v-model="param.ywjxingshi" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="数量" prop="ywjshuliang">
<el-input v-model="param.ywjshuliang" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="容器充装量" prop="ywjrongqichongzhuangliang">
<el-input v-model="param.ywjrongqichongzhuangliang" :disabled="edit">
<template slot="append">
m³
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="安装位置" prop="ywjanzhuangweizhi">
<el-input v-model="param.ywjanzhuangweizhi" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="外观" prop="ywjwaiguan">
<el-input v-model="param.ywjwaiguan" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="误差" prop="ywjwucha">
<el-input v-model="param.ywjwucha" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>测温仪表</legend>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="型号" prop="cwybxinghao">
<el-input v-model="param.cwybxinghao" :disabled="edit" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="有效期" prop="cwybyouxiaoqi">
<el-input v-model="param.cwybyouxiaoqi" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="外观" prop="cwybwaiguan">
<el-input v-model="param.cwybwaiguan" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>气相软管</legend>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="试验压力" prop="qxrgshiyanyali">
<el-input v-model="param.qxrgshiyanyali" :disabled="edit">
<template slot="append">
MPa
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="试验介质" prop="qxrgshiyanjiezhi">
<el-input v-model="param.qxrgshiyanjiezhi" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="保压时间" prop="qxrgbaoyashijian">
<el-input v-model="param.qxrgbaoyashijian" :disabled="edit">
<template slot="append">
min
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>液相软管</legend>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="试验压力" prop="yxrgshiyanyali">
<el-input v-model="param.yxrgshiyanyali" :disabled="edit">
<template slot="append">
MPa
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="试验介质" prop="yxrgshiyanjiezhi">
<el-input v-model="param.yxrgshiyanjiezhi" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="保压时间" prop="yxrgshiyanyali">
<el-input v-model="param.yxrgbaoyashijian" :disabled="edit">
<template slot="append">
min
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>检验信息</legend>
<el-row :gutter="20">
<el-col :span="18">
<el-form-item label="其它阀门、附件检验" prop="qitajianyan" label-width="150px">
<el-input v-model="param.qitajianyan" :disabled="edit" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="18">
<el-form-item label="检验结果" prop="jianyanjielun">
<el-select v-model="ysjl.jianyanjielun" :disabled="edit" type="text" placeholder="请选择" value="合格">
<el-option label="合格" value="合格" />
<el-option label="不合格" value="不合格" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="检验日期" label-width="135px" prop="jianyanjieshuriqi">
<el-date-picker v-model="ysjl.jianyanjieshuriqi" :disabled="edit" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" />
<el-form-item label="检验日期" prop="jianyanjieshuriqi">
<el-date-picker v-model="ysjl.jianyanjieshuriqi" :disabled="edit" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="检验结果" prop="jiancejieguo">
<el-input v-model="param.jiancejieguo" :disabled="edit" type="textarea" rows="4" style="width: 800px;" />
</el-form-item>
<el-form-item label="" prop="jianyanrenyuan" style="display: none;">
<el-input v-model="ysjl.jianyanrenyuan" type="text" />
</el-form-item>
</fieldset>
</el-form>
</div>
@ -123,23 +371,14 @@
import Sticky from '@/components/Sticky'
import btn from '@/views/common/FxButton'
export default {
name: 'RqZbgAqfj2100',
name: 'RqAqfj',
components: { Sticky, btn },
data() {
return {
ysjl: {},
param: {
ywjwucha: '±',
ylbjiandingriqi: '年 月 日',
bppgenghuariqi: '年 月 日',
qitajianyan: '未见异常',
kuaikaimenjianyanjieguo: true
},
param: {},
state: '',
edit: false,
editAqf: false,
editBpp: false,
editAqls: false,
ysjlId: this.$route.query.id,
info: {
ysjlId: this.$route.query.id,
@ -169,26 +408,12 @@ export default {
//
this.state = 'update'
this.param = data.param
this.changeAqf(this.param.aqfexist)
this.changeBpp(this.param.bppexist)
this.changeAqls(this.param.aqlsexist)
} else {
this.param = {
aqfjianyanriqi: this.ysjl.jianyanjieshuriqi,
bppjianyanriqi: this.ysjl.jianyanjieshuriqi,
aqlsjianyanriqi: this.ysjl.jianyanjieshuriqi
}
}
if (this.ysjl.flowstatus === 4) {
this.state = 'finish'
this.edit = true
}
if (this.param.kuaikaimenjianyanjieguo === '☑满足设计文件规定的使用要求') {
this.param.kuaikaimenjianyanjieguo = true
} else {
this.param.kuaikaimenjianyanjieguo = false
}
this.$refs.btn.getParentInfo(this.ysjl, this.param, null, null, this.state, this.$route.query.jyxm, true, false)
this.$refs.btn.getParentInfo(this.ysjl, this.param, null, this.state, this.$route.query.jyxm)
})
},
//
@ -204,59 +429,6 @@ export default {
this.delRowIndex.push(val[i].index)
}
},
changeAqf(val) {
if (val) {
this.editAqf = true
this.param.aqfshuliang = '无此项'
this.param.aqfyouxiaoqi = '无此项'
this.param.aqfjianyanriqi = '无此项'
} else {
this.editAqf = false
if (this.param.aqfshuliang === '无此项') {
this.param.aqfshuliang = ''
}
if (this.param.aqfyouxiaoqi === '无此项') {
this.param.aqfyouxiaoqi = ''
}
if (this.param.aqfjianyanriqi === '无此项') {
this.param.aqfjianyanriqi = this.ysjl.jianyanjieshuriqi
}
}
},
changeBpp(val) {
if (val) {
this.editBpp = true
this.param.bppshuliang = '无此项'
this.param.bppgenghuanzhouqiyaoqiu = '无此项'
this.param.bppjianyanriqi = '无此项'
} else {
this.editBpp = false
if (this.param.bppshuliang === '无此项') {
this.param.bppshuliang = ''
}
if (this.param.bppgenghuanzhouqiyaoqiu === '无此项') {
this.param.bppgenghuanzhouqiyaoqiu = ''
}
if (this.param.bppjianyanriqi === '无此项') {
this.param.bppjianyanriqi = this.ysjl.jianyanjieshuriqi
}
}
},
changeAqls(val) {
if (val) {
this.editAqls = true
this.param.shifoumanzu = '无此项'
this.param.aqlsjianyanriqi = '无此项'
} else {
this.editAqls = false
if (this.param.shifoumanzu === '无此项') {
this.param.shifoumanzu = ''
}
if (this.param.aqlsjianyanriqi === '无此项') {
this.param.aqlsjianyanriqi = this.ysjl.jianyanjieshuriqi
}
}
},
beforeSaveBuildData() {
// TODO
}

Loading…
Cancel
Save