mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
新增附件查看
This commit is contained in:
parent
c37041c1c7
commit
5f189c86ad
@ -383,19 +383,19 @@ const asyncRoutes = [
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/error-log',
|
||||
component: 'layout/Layout',
|
||||
redirect: 'noRedirect',
|
||||
children: [
|
||||
{
|
||||
path: 'log',
|
||||
component: 'views/error-log/index',
|
||||
name: 'ErrorLog',
|
||||
meta: { title: 'Error Log', icon: 'bug' }
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '/error-log',
|
||||
// component: 'layout/Layout',
|
||||
// redirect: 'noRedirect',
|
||||
// children: [
|
||||
// {
|
||||
// path: 'log',
|
||||
// component: 'views/error-log/index',
|
||||
// name: 'ErrorLog',
|
||||
// meta: { title: 'Error Log', icon: 'bug' }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
|
||||
{
|
||||
path: '/excel',
|
||||
|
@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<link rel="icon" href="./portrait.jpg">
|
||||
<title><%= webpackConfig.name %></title>
|
||||
</head>
|
||||
<body>
|
||||
|
BIN
public/portrait.jpg
Normal file
BIN
public/portrait.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
36
src/components/check_attach/api/index.js
Normal file
36
src/components/check_attach/api/index.js
Normal file
@ -0,0 +1,36 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
getDate(pageSize, pageNo, data_id, table_name) {
|
||||
return request({
|
||||
url: `/commonAction.do?eventcode=query_data&funid=queryevent&pagetype=editgrid&query_funid=sys_attach&user_id=administrator`,
|
||||
method: 'post',
|
||||
data: `start=${pageNo}&limit=${pageSize}&where_sql=sys_attach.data_id = ? and sys_attach.table_name = ?&where_type=string;string&where_value=${data_id};${table_name}`
|
||||
}).then(response => response.data)
|
||||
},
|
||||
Delete(ids) {
|
||||
let keys = ''
|
||||
ids.forEach(d => {
|
||||
keys += 'keyid=' + d + '&'
|
||||
})
|
||||
return request({
|
||||
url: `/commonAction.do`,
|
||||
method: 'post',
|
||||
data: `funid=sys_attach&${keys}pagetype=editgrid&eventcode=delete&user_id=administrator&dataType=json`
|
||||
}).then(response => response.data)
|
||||
},
|
||||
getFormDate(id) {
|
||||
return request({
|
||||
url: `/commonAction.do?eventcode=query_data&funid=queryevent&pagetype=grid&query_funid=safe_insp&user_id=administrator`,
|
||||
method: 'post',
|
||||
data: `start=0&limit=10&where_sql=safe_insp.safe_insp_id = ?&where_value=${id}&where_type=string&is_query=1&query_type=0`
|
||||
}).then(response => response.data)
|
||||
},
|
||||
downLoad(keys) {
|
||||
return request({
|
||||
url: `fileAction.do?funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=administrator&dataType=byte&_dc=`,
|
||||
method: 'post',
|
||||
data: `funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=administrator&dataType=byte&_dc=`
|
||||
}).then(response => response.data)
|
||||
}
|
||||
}
|
324
src/components/check_attach/index.vue
Normal file
324
src/components/check_attach/index.vue
Normal file
@ -0,0 +1,324 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <buttons funid="insp_det" style="margin:10px 10px" @editDelete="editDelete" @upload="upload" /> -->
|
||||
<div class="buttons">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
style="margin-bottom: 10px;"
|
||||
class="upload-demo"
|
||||
:action="baseUrl"
|
||||
:data="formData"
|
||||
:on-preview="handlePreview"
|
||||
:on-remove="handleRemove"
|
||||
:on-change="onChange"
|
||||
:on-success="onSuccess"
|
||||
:before-remove="beforeRemove"
|
||||
multiple
|
||||
:limit="3"
|
||||
:on-exceed="handleExceed"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
<el-button size="small" type="primary" @click="editDelete">批量删除</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
:data="data"
|
||||
style="width: 100%"
|
||||
border
|
||||
stripe
|
||||
@selection-change="handleSelectionChange"
|
||||
@cell-dblclick="cellDblclick"
|
||||
>
|
||||
<template v-for="(d,i) in tableHeader">
|
||||
<el-table-column v-if="d.type && d.type === 'selection'" :key="i" :type="d.type" :fixed="d.fixed" />
|
||||
<el-table-column
|
||||
v-else-if="d.show !== false"
|
||||
:key="i"
|
||||
:prop="d.prop"
|
||||
:label="d.label"
|
||||
:width="d.width"
|
||||
:min-width="d.minWidth"
|
||||
:class-name="d.className"
|
||||
:fixed="d.fixed"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="d.label==='附件名称'">
|
||||
<a @click="downLoadAttach(scope.row)">
|
||||
{{
|
||||
scope.row.sys_attach__attach_name
|
||||
}}
|
||||
</a>
|
||||
</div>
|
||||
<div v-else-if="d.label === '操作'">
|
||||
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
||||
</div>
|
||||
<div v-else>{{ scope.row[d.prop] }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="pager.pageNo"
|
||||
:page-sizes="[10, 30, 50, 100, 500]"
|
||||
:page-size="pager.pageSize"
|
||||
:total="pager.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from './api'
|
||||
// import buttons from '@/components/Buttons'
|
||||
export default {
|
||||
name: 'SafeIdsp',
|
||||
components: {
|
||||
// buttons
|
||||
},
|
||||
props: {
|
||||
dataId: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
tableName: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
funId: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
data: [],
|
||||
deptTree: [],
|
||||
ids: [],
|
||||
levels: [],
|
||||
pager: {
|
||||
pageNo: 0,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
},
|
||||
tableHeader: [
|
||||
{
|
||||
prop: 'selection',
|
||||
type: 'selection',
|
||||
fixed: 'left',
|
||||
width: '100px',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'sys_attach__attach_name',
|
||||
label: '附件名称',
|
||||
width: '250px',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'sys_attach__upload_user',
|
||||
label: '上传人',
|
||||
width: '100px',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
prop: 'sys_attach__upload_date',
|
||||
label: '上传日期',
|
||||
width: '150px',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
prop: 'opration',
|
||||
label: '操作',
|
||||
width: '100px',
|
||||
minWidth: '120px',
|
||||
show: true
|
||||
}],
|
||||
value: '',
|
||||
dept_id: '',
|
||||
level: '',
|
||||
id: '',
|
||||
parent_id: '',
|
||||
form: {
|
||||
dept_name: '',
|
||||
dept_code: '',
|
||||
memo: ''
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
dialogEditVisible: false,
|
||||
formLabelWidth: '120px',
|
||||
auditForm: {},
|
||||
saveFrom: {},
|
||||
treeData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'sys_dept__dept_name'
|
||||
},
|
||||
treeList: [],
|
||||
whereSql: false,
|
||||
whereValue: '',
|
||||
formData: {},
|
||||
attach_path: null,
|
||||
baseUrl: window.location.origin + '/bwhse/fileAction.do'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.initFormData()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
let pageNo = this.pager.pageNo * this.pager.pageSize - this.pager.pageSize
|
||||
if (pageNo < 0) {
|
||||
pageNo = 0
|
||||
}
|
||||
api.getDate(
|
||||
this.pager.pageSize,
|
||||
pageNo,
|
||||
this.dataId,
|
||||
this.tableName
|
||||
).then(data => {
|
||||
if (data.success) {
|
||||
this.data = data.data.root
|
||||
this.pager.total = data.data.total
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 200)
|
||||
} else {
|
||||
this.$message.error(data.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
initFormData() {
|
||||
this.formData.attach_path = ''
|
||||
this.formData.funid = 'sys_attach'
|
||||
this.formData.eventcode = 'create'
|
||||
this.formData.nousercheck = '1'
|
||||
this.formData.table_name = this.tableName
|
||||
this.formData.datafunid = this.funId
|
||||
this.formData.user_id = 'administrator'
|
||||
this.formData.dataid = this.dataId[0]
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const data = `funid=sys_dept&parentId=${this.dept_id}&levelCol=sys_dept.dept_level&keyid=&pagetype=editgrid&eventcode=save_eg&sys_dept__dept_code=${this.form.dept_code}&sys_dept__dept_name=${this.form.dept_name}&sys_dept__memo=${this.form.memo}&sys_dept__is_novalid=0&sys_dept__dept_id=&sys_dept__dept_level=${Number(this.level) + 1}&user_id=administrator&dataType= json`
|
||||
api.Crerte(data).then(data => {
|
||||
if (data.success) {
|
||||
this.getList()
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form.dept_name = ''
|
||||
this.form.dept_code = ''
|
||||
this.$message.success('新增成功!')
|
||||
} else {
|
||||
this.$message.error(data.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
Delete(row) {
|
||||
this.ids = []
|
||||
this.ids.push(row.sys_attach__attach_id)
|
||||
this.editDelete()
|
||||
},
|
||||
editDelete() {
|
||||
if (this.ids && this.ids.length > 0) {
|
||||
this.$confirm('确认删除附件?').then(() => {
|
||||
api.Delete(this.ids).then(data => {
|
||||
if (data.success) {
|
||||
this.getList()
|
||||
this.$message.success('删除成功!')
|
||||
} else {
|
||||
this.$message.error(data.message)
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message.warning('请选择数据进行删除')
|
||||
}
|
||||
},
|
||||
editSave() {
|
||||
console.log('editSave')
|
||||
},
|
||||
upload() {
|
||||
console.log('upload')
|
||||
},
|
||||
edit(row) {
|
||||
this.id = row.attach_id
|
||||
this.parent_id = this.id.substring(0, this.id.length - 4)
|
||||
console.log(this.parent_id, this.id)
|
||||
this.auditForm = row
|
||||
this.dialogEditVisible = true
|
||||
},
|
||||
auditFormChange(form) {
|
||||
this.saveFrom = form
|
||||
},
|
||||
cellDblclick(row) {
|
||||
},
|
||||
sizeChange(size) {
|
||||
this.pager.pageSize = size
|
||||
this.getList()
|
||||
},
|
||||
pageChange(page) {
|
||||
this.pager.pageNo = page
|
||||
this.getList()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.ids = val.map(d => d.sys_attach__attach_id)
|
||||
},
|
||||
downLoadAttach(row) {
|
||||
api.downLoad(row.sys_attach__attach_id).then()
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file)
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 9 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${file.name}?`)
|
||||
},
|
||||
onChange(file) {
|
||||
this.formData.attach_path = file.raw
|
||||
},
|
||||
onSuccess() {
|
||||
this.$message.success('上传成功!')
|
||||
this.getList()
|
||||
this.$refs.upload.clearFiles()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-card {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.el-table__row {
|
||||
a {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
.buttons{
|
||||
display: flex;
|
||||
}
|
||||
.el-button--primary {
|
||||
height: 26.8px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
36
src/components/sys_attach/api/index.js
Normal file
36
src/components/sys_attach/api/index.js
Normal file
@ -0,0 +1,36 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
getDate(pageSize, pageNo, data_id, table_name) {
|
||||
return request({
|
||||
url: `/commonAction.do?eventcode=query_data&funid=queryevent&pagetype=editgrid&query_funid=sys_attach&user_id=administrator`,
|
||||
method: 'post',
|
||||
data: `start=${pageNo}&limit=${pageSize}&where_sql=sys_attach.data_id = ? and sys_attach.table_name = ?&where_type=string;string&where_value=${data_id};${table_name}`
|
||||
}).then(response => response.data)
|
||||
},
|
||||
Delete(ids) {
|
||||
let keys = ''
|
||||
ids.forEach(d => {
|
||||
keys += 'keyid=' + d + '&'
|
||||
})
|
||||
return request({
|
||||
url: `/commonAction.do`,
|
||||
method: 'post',
|
||||
data: `funid=sys_attach&${keys}pagetype=editgrid&eventcode=delete&user_id=administrator&dataType=json`
|
||||
}).then(response => response.data)
|
||||
},
|
||||
getFormDate(id) {
|
||||
return request({
|
||||
url: `/commonAction.do?eventcode=query_data&funid=queryevent&pagetype=grid&query_funid=safe_insp&user_id=administrator`,
|
||||
method: 'post',
|
||||
data: `start=0&limit=10&where_sql=safe_insp.safe_insp_id = ?&where_value=${id}&where_type=string&is_query=1&query_type=0`
|
||||
}).then(response => response.data)
|
||||
},
|
||||
downLoad(keys) {
|
||||
return request({
|
||||
url: `fileAction.do?funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=administrator&dataType=byte&_dc=`,
|
||||
method: 'post',
|
||||
data: `funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=administrator&dataType=byte&_dc=`
|
||||
}).then(response => response.data)
|
||||
}
|
||||
}
|
329
src/components/sys_attach/index.vue
Normal file
329
src/components/sys_attach/index.vue
Normal file
@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <buttons funid="insp_det" style="margin:10px 10px" @editDelete="editDelete" @upload="upload" /> -->
|
||||
<div class="buttons">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
style="margin-bottom: 10px;"
|
||||
class="upload-demo"
|
||||
:action="baseUrl"
|
||||
:data="formData"
|
||||
:on-preview="handlePreview"
|
||||
:on-remove="handleRemove"
|
||||
:on-change="onChange"
|
||||
:on-success="onSuccess"
|
||||
:before-remove="beforeRemove"
|
||||
multiple
|
||||
:limit="3"
|
||||
:on-exceed="handleExceed"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
<el-button size="small" type="primary" @click="editDelete">批量删除</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
:data="data"
|
||||
style="width: 100%"
|
||||
border
|
||||
stripe
|
||||
@selection-change="handleSelectionChange"
|
||||
@cell-dblclick="cellDblclick"
|
||||
>
|
||||
<template v-for="(d,i) in tableHeader">
|
||||
<el-table-column v-if="d.type && d.type === 'selection'" :key="i" :type="d.type" :fixed="d.fixed" />
|
||||
<el-table-column
|
||||
v-else-if="d.show !== false"
|
||||
:key="i"
|
||||
:prop="d.prop"
|
||||
:label="d.label"
|
||||
:width="d.width"
|
||||
:min-width="d.minWidth"
|
||||
:class-name="d.className"
|
||||
:fixed="d.fixed"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="d.label==='附件名称'">
|
||||
<a @click="downLoadAttach(scope.row)">
|
||||
{{
|
||||
scope.row.sys_attach__attach_name
|
||||
}}
|
||||
</a>
|
||||
</div>
|
||||
<div v-else-if="d.label === '操作'">
|
||||
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
||||
</div>
|
||||
<div v-else>{{ scope.row[d.prop] }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
:current-page="pager.pageNo"
|
||||
:page-sizes="[10, 30, 50, 100, 500]"
|
||||
:page-size="pager.pageSize"
|
||||
:total="pager.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from './api'
|
||||
// import buttons from '@/components/Buttons'
|
||||
export default {
|
||||
name: 'SafeIdsp',
|
||||
components: {
|
||||
// buttons
|
||||
},
|
||||
props: {
|
||||
dataId: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
tableName: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
funId: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
data: [],
|
||||
deptTree: [],
|
||||
ids: [],
|
||||
levels: [],
|
||||
pager: {
|
||||
pageNo: 0,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
},
|
||||
tableHeader: [
|
||||
{
|
||||
prop: 'selection',
|
||||
type: 'selection',
|
||||
fixed: 'left',
|
||||
width: '100px',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'sys_attach__attach_name',
|
||||
label: '附件名称',
|
||||
width: '250px',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'sys_attach__upload_user',
|
||||
label: '上传人',
|
||||
width: '100px',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
prop: 'sys_attach__upload_date',
|
||||
label: '上传日期',
|
||||
width: '150px',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
prop: 'opration',
|
||||
label: '操作',
|
||||
width: '100px',
|
||||
minWidth: '120px',
|
||||
show: true
|
||||
}],
|
||||
value: '',
|
||||
dept_id: '',
|
||||
level: '',
|
||||
id: '',
|
||||
parent_id: '',
|
||||
form: {
|
||||
dept_name: '',
|
||||
dept_code: '',
|
||||
memo: ''
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
dialogEditVisible: false,
|
||||
formLabelWidth: '120px',
|
||||
auditForm: {},
|
||||
saveFrom: {},
|
||||
treeData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'sys_dept__dept_name'
|
||||
},
|
||||
treeList: [],
|
||||
whereSql: false,
|
||||
whereValue: '',
|
||||
formData: {},
|
||||
attach_path: null,
|
||||
baseUrl: window.location.origin + '/bwhse/fileAction.do'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.initFormData()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
let pageNo = this.pager.pageNo * this.pager.pageSize - this.pager.pageSize
|
||||
if (pageNo < 0) {
|
||||
pageNo = 0
|
||||
}
|
||||
api.getDate(
|
||||
this.pager.pageSize,
|
||||
pageNo,
|
||||
this.dataId,
|
||||
this.tableName
|
||||
).then(data => {
|
||||
if (data.success) {
|
||||
this.data = data.data.root
|
||||
this.pager.total = data.data.total
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 200)
|
||||
} else {
|
||||
this.$message.error(data.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
initFormData() {
|
||||
this.formData.attach_path = ''
|
||||
this.formData.funid = 'sys_attach'
|
||||
this.formData.eventcode = 'create'
|
||||
this.formData.nousercheck = '1'
|
||||
this.formData.table_name = this.tableName
|
||||
this.formData.datafunid = this.funId
|
||||
this.formData.user_id = 'administrator'
|
||||
this.formData.dataid = this.dataId[0]
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const data = `funid=sys_dept&parentId=${this.dept_id}&levelCol=sys_dept.dept_level&keyid=&pagetype=editgrid&eventcode=save_eg&sys_dept__dept_code=${this.form.dept_code}&sys_dept__dept_name=${this.form.dept_name}&sys_dept__memo=${this.form.memo}&sys_dept__is_novalid=0&sys_dept__dept_id=&sys_dept__dept_level=${Number(this.level) + 1}&user_id=administrator&dataType= json`
|
||||
api.Crerte(data).then(data => {
|
||||
if (data.success) {
|
||||
this.getList()
|
||||
this.dialogFormVisible = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form.dept_name = ''
|
||||
this.form.dept_code = ''
|
||||
this.$message.success('新增成功!')
|
||||
} else {
|
||||
this.$message.error(data.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
Delete(row) {
|
||||
this.ids = []
|
||||
this.ids.push(row.sys_attach__attach_id)
|
||||
this.editDelete()
|
||||
},
|
||||
editDelete() {
|
||||
if (this.ids && this.ids.length > 0) {
|
||||
this.$confirm('确认删除附件?').then(() => {
|
||||
api.Delete(this.ids).then(data => {
|
||||
if (data.success) {
|
||||
this.getList()
|
||||
this.$message.success('删除成功!')
|
||||
} else {
|
||||
this.$message.error(data.message)
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message.warning('请选择数据进行删除')
|
||||
}
|
||||
},
|
||||
editSave() {
|
||||
console.log('editSave')
|
||||
},
|
||||
upload() {
|
||||
console.log('upload')
|
||||
},
|
||||
edit(row) {
|
||||
this.id = row.attach_id
|
||||
this.parent_id = this.id.substring(0, this.id.length - 4)
|
||||
console.log(this.parent_id, this.id)
|
||||
this.auditForm = row
|
||||
this.dialogEditVisible = true
|
||||
},
|
||||
auditFormChange(form) {
|
||||
this.saveFrom = form
|
||||
},
|
||||
cellDblclick(row) {
|
||||
},
|
||||
sizeChange(size) {
|
||||
this.pager.pageSize = size
|
||||
this.getList()
|
||||
},
|
||||
pageChange(page) {
|
||||
this.pager.pageNo = page
|
||||
this.getList()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
console.log(val)
|
||||
this.ids = val.map(d => d.sys_attach__attach_id)
|
||||
},
|
||||
downLoadAttach(row) {
|
||||
api.downLoad(row.sys_attach__attach_id).then()
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file)
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 9 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${file.name}?`)
|
||||
},
|
||||
onChange(file) {
|
||||
this.formData.attach_path = file.raw
|
||||
},
|
||||
onSuccess() {
|
||||
this.$message.success('上传成功!')
|
||||
this.getList()
|
||||
this.$refs.upload.clearFiles()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-card {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.el-table__row {
|
||||
a {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
.buttons{
|
||||
display: flex;
|
||||
}
|
||||
.el-button--primary {
|
||||
height: 26.8px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.pagination{
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
module.exports = {
|
||||
title: 'Vue Element Admin',
|
||||
title: '',
|
||||
|
||||
/**
|
||||
* @type {boolean} true | false
|
||||
|
@ -135,3 +135,14 @@
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
//设置el-dialog样式
|
||||
.el-dialog__body {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
.el-dialog__header {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.el-dialog__footer {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
import defaultSettings from '@/settings'
|
||||
|
||||
const title = defaultSettings.title || 'Vue Element Admin'
|
||||
const title = defaultSettings.title
|
||||
|
||||
export default function getPageTitle(pageTitle) {
|
||||
if (pageTitle) {
|
||||
return `${pageTitle} - ${title}`
|
||||
// return `${pageTitle} - ${title}` 网站页面标签
|
||||
return `${pageTitle}`
|
||||
}
|
||||
return `${title}`
|
||||
}
|
||||
|
@ -59,5 +59,12 @@ export default {
|
||||
method: 'post',
|
||||
data: `start=0&limit=10&where_sql=hidden_danger.hidden_danger_id = ?&where_value=${id}&where_type=string&is_query=1&query_type=0`
|
||||
}).then(response => response.data)
|
||||
},
|
||||
queryAttach(keyids) {
|
||||
return request({
|
||||
url: `/commonAction.do`,
|
||||
method: 'post',
|
||||
data: `funid=queryevent&pagetype=grid&eventcode=query_attach&tablename=hidden_danger&keyids=${keyids}&is_queryrelat=0&user_id=administrator&dataType=json&query_type=0&has_page=0`
|
||||
}).then(response => response.data)
|
||||
}
|
||||
}
|
||||
|
@ -5,27 +5,36 @@
|
||||
<el-table
|
||||
ref="deptTable"
|
||||
v-loading="loading"
|
||||
:data="data"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
stripe
|
||||
@selection-change="handleSelectionChange"
|
||||
@cell-dblclick="cellDblclick"
|
||||
>
|
||||
<template v-for="(d,i) in tableHeader">
|
||||
<el-table-column v-if="d.type && d.type === 'selection'" :key="i" :type="d.type" :fixed="d.fixed" />
|
||||
<el-table-column
|
||||
v-else
|
||||
v-else-if="d.show !== false"
|
||||
:key="i"
|
||||
:prop="d.prop"
|
||||
:label="d.label"
|
||||
:width="d.width"
|
||||
:min-width="d.minWidth"
|
||||
:class-name="d.className"
|
||||
:fixed="d.fixed"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="d.label==='隐患状态'">
|
||||
{{
|
||||
<el-tag size="medium">{{
|
||||
scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
|
||||
}}
|
||||
}}</el-tag>
|
||||
</div>
|
||||
<div v-else-if="d.label==='检查时间'">
|
||||
{{ parseDay(scope.row.hidden_danger__check_date) }}
|
||||
</div>
|
||||
<div v-else-if="d.label === '操作'">
|
||||
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
||||
<el-button icon="el-icon-folder" type="text" title="查看附件" @click="checkAttach(scope.row)" />
|
||||
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
||||
</div>
|
||||
<div v-else>{{ scope.row[d.prop] }}</div>
|
||||
@ -43,21 +52,44 @@
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</el-card>
|
||||
<el-dialog v-if="dialogUploadVisible" title="附件" :visible.sync="dialogUploadVisible" width="45%" @close="closeUploadDialog">
|
||||
<Attach ref="attach" :data-id="ids" table-name="hidden_danger" fun-id="hidden_check" @change="auditFormChange" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogUploadVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-drawer
|
||||
title="我是标题"
|
||||
:visible.sync="drawer"
|
||||
:with-header="false"
|
||||
>
|
||||
<el-card>
|
||||
<Attach ref="attach" :data-id="ids" table-name="hidden_danger" fun-id="hidden_check" @change="auditFormChange" />
|
||||
</el-card>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from './api'
|
||||
import buttons from '@/components/Buttons'
|
||||
import Attach from '@/components/sys_attach'
|
||||
import { parseDay } from '@/utils/index'
|
||||
export default {
|
||||
name: 'SafeIdsp',
|
||||
components: {
|
||||
buttons
|
||||
buttons,
|
||||
Attach
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
parseDay,
|
||||
loading: false,
|
||||
data: [],
|
||||
list: [],
|
||||
keyids: [],
|
||||
attachData: [],
|
||||
deptTree: [],
|
||||
ids: [],
|
||||
levels: [],
|
||||
@ -71,35 +103,55 @@ export default {
|
||||
prop: 'selection',
|
||||
type: 'selection',
|
||||
fixed: 'left'
|
||||
}, {
|
||||
},
|
||||
// {
|
||||
// prop: 'attach',
|
||||
// type: 'attach',
|
||||
// fixed: 'left',
|
||||
// width: '80px'
|
||||
// },
|
||||
{
|
||||
prop: 'hidden_danger__hidden_state',
|
||||
label: '隐患状态'
|
||||
label: '隐患状态',
|
||||
width: '80px',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__hidden_code',
|
||||
label: '隐患编号'
|
||||
label: '隐患编号',
|
||||
width: '200px',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
prop: 'hidden_danger__check_man',
|
||||
label: '检查人'
|
||||
label: '检查人',
|
||||
width: '150px',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__check_dept',
|
||||
label: '检查部门'
|
||||
label: '检查部门',
|
||||
width: '200px',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
prop: 'hidden_danger__check_date',
|
||||
label: '检查时间'
|
||||
label: '检查时间',
|
||||
width: '200px',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__check_location',
|
||||
label: '隐患描述'
|
||||
label: '隐患描述',
|
||||
width: '200px',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__check_content',
|
||||
label: '隐患描述'
|
||||
label: '检查内容',
|
||||
show: true
|
||||
}, {
|
||||
prop: 'opration',
|
||||
label: '操作',
|
||||
width: '70px',
|
||||
width: '100px',
|
||||
fixed: 'right',
|
||||
minWidth: '70px',
|
||||
minWidth: '100px',
|
||||
show: true
|
||||
}],
|
||||
value: '',
|
||||
@ -131,7 +183,10 @@ export default {
|
||||
},
|
||||
treeList: [],
|
||||
whereSql: false,
|
||||
whereValue: ''
|
||||
whereValue: '',
|
||||
dialogUploadVisible: false,
|
||||
options: [],
|
||||
drawer: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -155,6 +210,10 @@ export default {
|
||||
if (data.success) {
|
||||
this.data = data.data.root
|
||||
this.pager.total = data.data.total
|
||||
this.keyids = this.data.map(d => {
|
||||
return d.hidden_danger__hidden_danger_id
|
||||
}).join()
|
||||
this.queryAttach()
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 200)
|
||||
@ -163,6 +222,23 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
queryAttach() {
|
||||
api.queryAttach(this.keyids).then(data => {
|
||||
if (data.success) {
|
||||
if (data.data.length > 0) {
|
||||
this.attachData = data.data
|
||||
this.data.forEach((d, i) => {
|
||||
this.data[i].attach = this.attachData.filter(v => {
|
||||
return v.data_id === d.hidden_danger__hidden_danger_id
|
||||
})
|
||||
})
|
||||
}
|
||||
this.list = JSON.parse(JSON.stringify(this.data))
|
||||
} else {
|
||||
this.$message.error(data.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
editCreate() {
|
||||
const param = `/hidden_danger/hidden_check/create`
|
||||
this.$router.push(param)
|
||||
@ -192,7 +268,13 @@ export default {
|
||||
console.log('editSave')
|
||||
},
|
||||
upload() {
|
||||
console.log('upload')
|
||||
if (this.ids.length > 1) {
|
||||
this.$message.warning('只能选择一条数据!')
|
||||
} else if (this.ids.length === 0) {
|
||||
this.$message.warning('请选择一条数据!')
|
||||
} else {
|
||||
this.dialogUploadVisible = true
|
||||
}
|
||||
},
|
||||
edit(row) {
|
||||
const param = `/hidden_danger/hidden_check/audit/${row.hidden_danger__hidden_danger_id}`
|
||||
@ -221,6 +303,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
closeUploadDialog() {
|
||||
this.dialogUploadVisible = false
|
||||
},
|
||||
cellDblclick(row) {
|
||||
const param = `/hidden_danger/hidden_check/audit/${row.hidden_danger__hidden_danger_id}`
|
||||
this.$router.push(param)
|
||||
@ -246,6 +331,12 @@ export default {
|
||||
this.whereValue = encodeURI(`${data.sys_dept__dept_id}\%`)
|
||||
this.whereSql = true
|
||||
this.getList()
|
||||
},
|
||||
checkAttach(row) {
|
||||
// this.drawer = true
|
||||
this.ids = []
|
||||
this.ids.push(row.hidden_danger__hidden_danger_id)
|
||||
this.dialogUploadVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,25 +7,40 @@
|
||||
v-loading="loading"
|
||||
:data="data"
|
||||
style="width: 100%"
|
||||
stripe
|
||||
@selection-change="handleSelectionChange"
|
||||
@cell-dblclick="cellDblclick"
|
||||
>
|
||||
<template v-for="(d,i) in tableHeader">
|
||||
<el-table-column v-if="d.type && d.type === 'selection'" :key="i" :type="d.type" :fixed="d.fixed" />
|
||||
<el-table-column
|
||||
v-else
|
||||
v-else-if="d.show !== false"
|
||||
:key="i"
|
||||
:prop="d.prop"
|
||||
:label="d.label"
|
||||
:width="d.width"
|
||||
:min-width="d.minWidth"
|
||||
:class-name="d.className"
|
||||
:fixed="d.fixed"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="d.label==='隐患状态'">
|
||||
{{
|
||||
<el-tag v-if="scope.row.hidden_danger__hidden_state == 2" size="danger">{{
|
||||
scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
|
||||
}}
|
||||
}}</el-tag>
|
||||
<el-tag v-else-if="scope.row.hidden_danger__hidden_state == 3" size="danger">{{
|
||||
scope.row.hidden_danger__hidden_state == 3 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
|
||||
}}</el-tag>
|
||||
</div>
|
||||
<div v-else-if="d.label==='检查时间'">
|
||||
{{ parseDay(scope.row.hidden_danger__check_date) }}
|
||||
</div>
|
||||
<div v-else-if="d.label==='整改期限'">
|
||||
{{ parseDay(scope.row.hidden_danger__reform_limit) }}
|
||||
</div>
|
||||
<div v-else-if="d.label === '操作'">
|
||||
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
||||
<el-button icon="el-icon-folder" type="text" title="查看附件" @click="checkAttach(scope.row)" />
|
||||
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
||||
</div>
|
||||
<div v-else>{{ scope.row[d.prop] }}</div>
|
||||
@ -43,20 +58,30 @@
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-if="dialogUploadVisible" title="附件" :visible.sync="dialogUploadVisible" width="45%" @close="closeUploadDialog">
|
||||
<Attach ref="attach" :data-id="ids" table-name="hidden_danger" fun-id="hidden_check" @change="auditFormChange" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogUploadVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from './api'
|
||||
import buttons from '@/components/Buttons'
|
||||
import Attach from '@/components/sys_attach'
|
||||
import { parseDay } from '@/utils/index'
|
||||
export default {
|
||||
name: 'SafeIdsp',
|
||||
components: {
|
||||
buttons
|
||||
buttons,
|
||||
Attach
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
parseDay,
|
||||
loading: false,
|
||||
data: [],
|
||||
deptTree: [],
|
||||
@ -72,43 +97,63 @@ export default {
|
||||
prop: 'selection',
|
||||
type: 'selection',
|
||||
fixed: 'left'
|
||||
}, {
|
||||
},
|
||||
{
|
||||
prop: 'hidden_danger__hidden_code',
|
||||
label: '隐患编号'
|
||||
// width: '200px',
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__hidden_state',
|
||||
label: '隐患状态'
|
||||
// width: '80px',
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__check_man',
|
||||
label: '检查人'
|
||||
// width: '150px',
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__check_dept',
|
||||
label: '检查部门'
|
||||
// width: '150px',
|
||||
// show: true
|
||||
},
|
||||
{
|
||||
prop: 'hidden_danger__check_date',
|
||||
label: '检查时间'
|
||||
// width: '200px',
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__check_location',
|
||||
label: '隐患描述'
|
||||
// width: '200px',
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__check_content',
|
||||
label: '隐患描述'
|
||||
label: '隐患内容'
|
||||
// width: '200px',
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__reform_dept',
|
||||
label: '整改人'
|
||||
// width: '150px',
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__reform_man',
|
||||
label: '整改部门'
|
||||
// width: '150px',
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'hidden_danger__reform_limit',
|
||||
label: '整改期限'
|
||||
// show: true
|
||||
}, {
|
||||
prop: 'opration',
|
||||
label: '操作',
|
||||
width: '70px',
|
||||
width: '100px',
|
||||
fixed: 'right',
|
||||
minWidth: '70px',
|
||||
minWidth: '100px',
|
||||
show: true
|
||||
}],
|
||||
value: '',
|
||||
@ -140,7 +185,8 @@ export default {
|
||||
},
|
||||
treeList: [],
|
||||
whereSql: false,
|
||||
whereValue: ''
|
||||
whereValue: '',
|
||||
dialogUploadVisible: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -201,7 +247,13 @@ export default {
|
||||
console.log('editSave')
|
||||
},
|
||||
upload() {
|
||||
console.log('upload')
|
||||
if (this.ids.length > 1) {
|
||||
this.$message.warning('只能选择一条数据!')
|
||||
} else if (this.ids.length === 0) {
|
||||
this.$message.warning('请选择一条数据!')
|
||||
} else {
|
||||
this.dialogUploadVisible = true
|
||||
}
|
||||
},
|
||||
edit(row) {
|
||||
const param = `/hidden_danger/hidden_reform/audit/${row.hidden_danger__hidden_danger_id}`
|
||||
@ -230,6 +282,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
closeUploadDialog() {
|
||||
this.dialogUploadVisible = false
|
||||
},
|
||||
cellDblclick(row) {
|
||||
const param = `/hidden_danger/hidden_reform/audit/${row.hidden_danger__hidden_danger_id}`
|
||||
this.$router.push(param)
|
||||
@ -255,6 +310,12 @@ export default {
|
||||
this.whereValue = encodeURI(`${data.sys_dept__dept_id}\%`)
|
||||
this.whereSql = true
|
||||
this.getList()
|
||||
},
|
||||
checkAttach(row) {
|
||||
// this.drawer = true
|
||||
this.ids = []
|
||||
this.ids.push(row.hidden_danger__hidden_danger_id)
|
||||
this.dialogUploadVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
v-loading="loading"
|
||||
:data="data"
|
||||
style="width: 100%"
|
||||
stripe
|
||||
@selection-change="handleSelectionChange"
|
||||
@cell-dblclick="cellDblclick"
|
||||
>
|
||||
@ -20,12 +21,22 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="d.label==='隐患状态'">
|
||||
{{
|
||||
<el-tag v-if="scope.row.hidden_danger__hidden_state == 4" size="warning">{{
|
||||
scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
|
||||
}}
|
||||
}}</el-tag>
|
||||
<el-tag v-if="scope.row.hidden_danger__hidden_state == 5" size="success">{{
|
||||
scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
|
||||
}}</el-tag>
|
||||
</div>
|
||||
<div v-else-if="d.label==='检查时间'">
|
||||
{{ parseDay(scope.row.hidden_danger__check_date) }}
|
||||
</div>
|
||||
<div v-else-if="d.label==='整改期限'">
|
||||
{{ parseDay(scope.row.hidden_danger__reform_limit) }}
|
||||
</div>
|
||||
<div v-else-if="d.label === '操作'">
|
||||
<el-button icon="el-icon-view" type="text" title="编辑" @click="edit(scope.row)" />
|
||||
<el-button icon="el-icon-folder" type="text" title="查看附件" @click="checkAttach(scope.row)" />
|
||||
<el-button v-if="scope.row.status !== 'NULLIFY'" icon="el-icon-delete" style="color:#F56C6C" type="text" title="删除" @click="Delete(scope.row)" />
|
||||
</div>
|
||||
<div v-else>{{ scope.row[d.prop] }}</div>
|
||||
@ -43,20 +54,30 @@
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-if="dialogUploadVisible" title="附件" :visible.sync="dialogUploadVisible" width="45%" @close="closeUploadDialog">
|
||||
<Attach ref="attach" :data-id="ids" table-name="hidden_danger" fun-id="hidden_check" @change="auditFormChange" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogUploadVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from './api'
|
||||
import buttons from '@/components/Buttons'
|
||||
import Attach from '@/components/sys_attach'
|
||||
import { parseDay } from '@/utils/index'
|
||||
export default {
|
||||
name: 'SafeIdsp',
|
||||
components: {
|
||||
buttons
|
||||
buttons,
|
||||
Attach
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
parseDay,
|
||||
loading: false,
|
||||
data: [],
|
||||
deptTree: [],
|
||||
@ -140,7 +161,8 @@ export default {
|
||||
},
|
||||
treeList: [],
|
||||
whereSql: false,
|
||||
whereValue: ''
|
||||
whereValue: '',
|
||||
dialogUploadVisible: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -230,6 +252,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
closeUploadDialog() {
|
||||
this.dialogUploadVisible = false
|
||||
},
|
||||
cellDblclick(row) {
|
||||
const param = `/hidden_danger/hidden_review/audit/${row.hidden_danger__hidden_danger_id}`
|
||||
this.$router.push(param)
|
||||
@ -255,6 +280,12 @@ export default {
|
||||
this.whereValue = encodeURI(`${data.sys_dept__dept_id}\%`)
|
||||
this.whereSql = true
|
||||
this.getList()
|
||||
},
|
||||
checkAttach(row) {
|
||||
// this.drawer = true
|
||||
this.ids = []
|
||||
this.ids.push(row.hidden_danger__hidden_danger_id)
|
||||
this.dialogUploadVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<el-card>
|
||||
<buttons funid="insp_item" style="margin-bottom:10px" @editCreate="editCreate" @editDelete="editDelete" />
|
||||
<el-table
|
||||
|
@ -16,10 +16,14 @@
|
||||
<template v-for="(d,i) in tableHeader">
|
||||
<el-table-column v-if="d.type && d.type === 'selection'" :key="i" :type="d.type" :fixed="d.fixed" />
|
||||
<el-table-column
|
||||
v-else
|
||||
v-else-if="d.show !== false"
|
||||
:key="i"
|
||||
:prop="d.prop"
|
||||
:label="d.label"
|
||||
:width="d.width"
|
||||
:min-width="d.minWidth"
|
||||
:class-name="d.className"
|
||||
:fixed="d.fixed"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="d.label === '操作'">
|
||||
@ -31,15 +35,17 @@
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="pager.pageNo"
|
||||
:page-sizes="[10, 30, 50, 100, 500]"
|
||||
:page-size="pager.pageSize"
|
||||
:total="pager.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
:current-page="pager.pageNo"
|
||||
:page-sizes="[10, 30, 50, 100, 500]"
|
||||
:page-size="pager.pageSize"
|
||||
:total="pager.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
@ -105,9 +111,9 @@ export default {
|
||||
}, {
|
||||
prop: 'opration',
|
||||
label: '操作',
|
||||
width: '70px',
|
||||
width: '100px',
|
||||
fixed: 'right',
|
||||
minWidth: '70px',
|
||||
minWidth: '100px',
|
||||
show: true
|
||||
}],
|
||||
value: '',
|
||||
@ -258,4 +264,7 @@ export default {
|
||||
.el-card {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.pagination{
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -348,6 +348,7 @@ $light_gray:#eee;
|
||||
.el-button--primary {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.el-form-item {
|
||||
margin-bottom: 28px !important;
|
||||
|
@ -123,7 +123,6 @@ import buttons from '@/components/formBtn'
|
||||
import InspDet from '../insp_det'
|
||||
import SelUser from '@/components/selUser'
|
||||
import InspName from '../inspName'
|
||||
import { parseDay } from '@/utils'
|
||||
export default {
|
||||
name: 'EditForm',
|
||||
components: {
|
||||
@ -138,7 +137,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
parseDay,
|
||||
form: {
|
||||
safe_insp__insp_code: '',
|
||||
safe_insp__insp_name: '',
|
||||
@ -205,7 +203,6 @@ export default {
|
||||
api.getFormDate(this.id).then(data => {
|
||||
if (data.success) {
|
||||
this.form = data.data.root[0]
|
||||
this.form.safe_insp__insp_date = parseDay(data.data.root[0].safe_insp__insp_date)
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 200)
|
||||
|
@ -60,8 +60,8 @@
|
||||
|
||||
<script>
|
||||
import api from './api'
|
||||
import { parseDay } from '@/utils'
|
||||
import buttons from '@/components/Buttons'
|
||||
import { parseDay } from '@/utils/index'
|
||||
export default {
|
||||
name: 'SafeIdsp',
|
||||
components: {
|
||||
@ -69,12 +69,12 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
parseDay,
|
||||
loading: false,
|
||||
data: [],
|
||||
deptTree: [],
|
||||
ids: [],
|
||||
levels: [],
|
||||
parseDay,
|
||||
pager: {
|
||||
pageNo: 0,
|
||||
pageSize: 10,
|
||||
|
@ -92,13 +92,20 @@
|
||||
<el-button type="primary" @click="create">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog v-if="dialogEditVisible" title="部门" :visible.sync="dialogEditVisible" width="70%" @close="closeDialog">
|
||||
<el-dialog v-if="dialogEditVisible" title="部门" :visible.sync="dialogEditVisible" width="70%" @close="closeEditDialog">
|
||||
<AdutiUser :id="user_id" ref="auditForm" :audit-form="auditForm" :data="deptTree" @change="auditFormChange" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogEditVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog v-if="dialogUploadVisible" title="附件" :visible.sync="dialogUploadVisible" width="45%" @close="closeUploadDialog">
|
||||
<Attach :id="user_id" ref="attach" :data-id="ids" table-name="sys_user" fun-id="sys_user" @change="auditFormChange" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogUploadVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -106,11 +113,13 @@
|
||||
import api from './api'
|
||||
import buttons from '@/components/Buttons'
|
||||
import AdutiUser from './components/auditUser'
|
||||
import Attach from '@/components/sys_attach'
|
||||
export default {
|
||||
name: 'User',
|
||||
components: {
|
||||
buttons,
|
||||
AdutiUser
|
||||
AdutiUser,
|
||||
Attach
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -199,6 +208,7 @@ export default {
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
dialogEditVisible: false,
|
||||
dialogUploadVisible: false,
|
||||
formLabelWidth: '120px',
|
||||
auditForm: {},
|
||||
saveFrom: {},
|
||||
@ -359,7 +369,13 @@ export default {
|
||||
console.log('editSave')
|
||||
},
|
||||
upload() {
|
||||
console.log('upload')
|
||||
if (this.ids.length > 1) {
|
||||
this.$message.warning('只能选择一条数据!')
|
||||
} else if (this.ids.length === 0) {
|
||||
this.$message.warning('请选择一条数据!')
|
||||
} else {
|
||||
this.dialogUploadVisible = true
|
||||
}
|
||||
},
|
||||
edit(row) {
|
||||
this.id = row.sys_user__user_id
|
||||
@ -414,6 +430,12 @@ export default {
|
||||
this.$refs.auditForm.$refs.form.resetFields()
|
||||
this.form = ''
|
||||
},
|
||||
closeEditDialog() {
|
||||
this.dialogEditVisible = false
|
||||
},
|
||||
closeUploadDialog() {
|
||||
this.dialogUploadVisible = false
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
this.pager.pageNo = 0
|
||||
this.pager.pageSize = 10
|
||||
|
@ -6,7 +6,7 @@ function resolve(dir) {
|
||||
return path.join(__dirname, dir)
|
||||
}
|
||||
|
||||
const name = defaultSettings.title || 'vue Element Admin' // page title
|
||||
const name = defaultSettings.title // page title
|
||||
|
||||
// If your port is set to 80,
|
||||
// use administrator privileges to execute the command line.
|
||||
|
Loading…
x
Reference in New Issue
Block a user