隐患排查标准库(新增导入)

pull/1/head
wangpeng 2024-01-26 08:36:21 +08:00
parent 6c4f0bb95f
commit ccf6c78b33
7 changed files with 995 additions and 2 deletions

View File

@ -0,0 +1,113 @@
<template>
<el-cascader
ref="cascader"
:value="value"
:options="options"
:props="props"
:disabled = "disabled"
:placeholder="placeholder"
:filterable = "filterable"
:clearable = "clearable"
style="width: 100%"
@change="cascaderChange" />
</template>
<script>
import { requestFN } from '@/utils/request'
export default {
name: 'CascaderDict',
props: {
/* 选项列表数据(树形结构的对象数组) */
/* 初始值 */
form: {
type: Object,
default: () => { return {} }
},
type: {
type: String,
default: () => { return 'search' }
},
dictId: {
type: String,
default: () => { return '' }
},
value: {
type: Array,
default: () => { return [] }
},
//
filterable: {
type: Boolean,
default: () => { return true }
},
/* 可清空 */
clearable: {
type: Boolean,
default: () => { return true }
},
placeholder: {
type: String,
default: () => { return '请选择' }
},
/* props属性 */
//
disabled: {
type: Boolean,
default: () => { return false }
},
//
checkStrictly: {
type: Boolean,
default: () => { return true }
}
},
data() {
return {
USER_LEVEL: JSON.parse(sessionStorage.getItem('user')).LEVEL || '2',
options: [],
props: {
checkStrictly: this.checkStrictly
}
}
},
mounted() {
this.initHandle()
},
methods: {
//
initHandle() {
let url = '/dictionaries/getDictTreeMoreLevel'
if (this.disabled) {
url = '/dictionaries/getDictById'
}
return new Promise((resolve) => {
requestFN(
url,
{
DICTIONARIES_ID: this.dictId // ID
}
).then((data) => {
if (data.list.length > 0) {
this.options = data.list
}
resolve()
}).catch((e) => {
})
})
},
cascaderChange(e) {
const value = e
this.$emit('input', value)
this.$emit('cascaderNames', this.$refs.cascader.getCheckedNodes()[0].pathLabels ? this.$refs.cascader.getCheckedNodes()[0].pathLabels.join(',') : '')
this.$nextTick(() => {
const dom = document.getElementsByClassName('el-radio is-checked')
const radioDom = dom[dom.length - 1]
const brother = radioDom.nextElementSibling
if (radioDom.getElementsByClassName('el-radio__original')[0].value.split(',').length < 5) {
brother.click()
}
this.$refs.cascader.dropDownVisible = false
})
}
}
}
</script>

View File

@ -0,0 +1,288 @@
<template>
<el-dialog :visible.sync="visible" :title="title" width="600px">
<el-form v-loading="loading" ref="form" :rules="rules" :model="form" label-position="top" label-width="110px" style="width: 500px;">
<el-form-item label="行业类型" prop="INDUSTRY_TYPE">
<el-cascader :props="industry_type_list_rule" v-model="form.INDUSTRY_TYPE" :options="industry_type_list" clearable style="width: 100%"/>
</el-form-item>
<el-form-item label="检查隐患类型" prop="HIDDEN_TYPES">
<el-cascader :props="hidden_types_list_rule" v-model="form.HIDDEN_TYPES" :options="hidden_types_list" clearable style="width: 100%"/>
</el-form-item>
<el-form-item label="隐患区域(风险单元名称)" prop="RISK_UNIT_NAME">
<el-input id="RISK_UNIT_NAME" ref="RISK_UNIT_NAME" v-model="form.RISK_UNIT_NAME" maxlength="255" placeholder="这里输入隐患区域(风险单元名称)..." title="隐患区域(风险单元名称)"/>
</el-form-item>
<el-form-item label="隐患部位" prop="HIDDEN_PART">
<el-input id="HIDDEN_PART" ref="HIDDEN_PART" v-model="form.HIDDEN_PART" maxlength="255" placeholder="这里输入隐患部位..." title="隐患部位"/>
</el-form-item>
<el-form-item label="隐患描述" prop="INSPECTION_BASIS">
<el-input id="INSPECTION_BASIS" ref="INSPECTION_BASIS" v-model="form.INSPECTION_BASIS" maxlength="255" placeholder="这里输入检查依据..." title="检查依据"/>
</el-form-item>
<el-form-item label="检查依据" prop="HIDDEN_DESCR">
<el-input id="HIDDEN_DESCR" ref="HIDDEN_DESCR" v-model="form.HIDDEN_DESCR" maxlength="255" placeholder="这里输入隐患描述..." title="隐患描述"/>
</el-form-item>
<el-form-item label="依据内容" prop="INSPECTION_INFO">
<el-input id="INSPECTION_INFO" ref="INSPECTION_INFO" v-model="form.INSPECTION_INFO" maxlength="255" placeholder="这里输入检查依据..." title="检查依据"/>
</el-form-item>
<el-form-item label="整改建议" prop="RECTIFYDESCR">
<el-input id="RECTIFYDESCR" ref="RECTIFYDESCR" v-model="form.RECTIFYDESCR" maxlength="255" placeholder="这里输入整改建议..." title="整改建议"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
export default {
components: { Pagination },
directives: { waves },
props: {
title: {
type: String,
default: ''
}
},
data() {
return {
loading: false,
form: {
HIDDEN_LIBRARY_ID: '',
INDUSTRY_TYPE_ONE: '', // 1()
INDUSTRY_TYPE_TWO: '', // 2()
INDUSTRY_TYPE_THREE: '', // 3()
INDUSTRY_TYPE_FOUR: '', // 4()
INDUSTRY_TYPE: [],
HIDDEN_TYPES: [], // ()
HIDDEN_TYPE_ONE: '', // ()
HIDDEN_TYPE_TWO: '', // ()
HIDDEN_TYPE_THREE: '', // ()
RISK_UNIT_ID: '', // ()
RISK_UNIT_NAME: '', // ()
HIDDEN_PART: '', //
HIDDEN_DESCR: '', //
CREATOR_ID: '', //
CREATOR_NAME: '', //
CREATED_TIME: '', //
OPERATOR_ID: '', // id
OPERATOR_NAME: '', //
OPERAT_TIME: '', //
INSPECTION_BASIS: '', //
INSPECTION_INFO: '',
CORP_INFO_ID: '', // id
ISDELETE: '', //
STATUS: '', // 0-1-
CORPINFO_ID: '',
SOURCE: '0'
},
rules: {
HIDDEN_TYPES: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('检查隐患类型必选'))
}
return callback()
},
trigger: 'blur'
}],
RISK_UNIT_NAME: [{ required: true, message: '隐患区域名称(风险单元名称)不能为空', trigger: 'blur' }],
HIDDEN_PART: [{ required: true, message: '隐患部位不能为空', trigger: 'blur' }],
INSPECTION_BASIS: [{ required: true, message: '隐患描述不能为空', trigger: 'blur' }],
RECTIFYDESCR: [{ required: true, message: '整改建议不能为空', trigger: 'blur' }],
CORPINFO_ID: [{ required: true, message: '企业必选', trigger: 'blur' }],
INDUSTRY_TYPE: [{
required: true,
validator: (rules, value, callback) => {
if (!value || value.length === 0 || value[0] === '') {
return callback(new Error('行业类型必选'))
}
return callback()
},
trigger: 'blur'
}]
},
industry_type_list_rule: {
value: 'DICTIONARIES_ID',
label: 'NAME',
children: 'children'
},
hidden_types_list_rule: {
value: 'DICTIONARIES_ID',
label: 'NAME',
children: 'children',
checkStrictly: true
},
industry_type_list: [],
hidden_types_list: [],
listQuery: {
page: 1,
limit: 10
},
corp_info_list: [],
risk_unit_list: [],
visible: false,
info: {}
}
},
methods: {
init(e) {
this.visible = true
this.getRiskUnit()
this.getDicTree()
if (e) {
this.form = e
this.$set(this.form, 'INDUSTRY_TYPE', [this.form.INDUSTRY_TYPE_ONE, this.form.INDUSTRY_TYPE_TWO, this.form.INDUSTRY_TYPE_THREE, this.form.INDUSTRY_TYPE_FOUR])
this.corp_info_list = [{ CORPINFO_ID: this.form.CORP_INFO_ID, CORP_NAME: this.form.CORP_INFO_NAME }]
this.form.CORPINFO_ID = this.form.CORP_INFO_ID
this.risk_unit_list = [{ RISKUNIT_ID: this.form.RISK_UNIT_ID, RISKUNITNAME: this.form.RISK_UNIT_NAME }]
if (!this.form.HIDDEN_TYPES) this.form.HIDDEN_TYPES = []
if (this.form.HIDDEN_TYPE_ONE) this.form.HIDDEN_TYPES.push(this.form.HIDDEN_TYPE_ONE)
if (this.form.HIDDEN_TYPE_TWO) this.form.HIDDEN_TYPES.push(this.form.HIDDEN_TYPE_TWO)
if (this.form.HIDDEN_TYPE_THREE) this.form.HIDDEN_TYPES.push(this.form.HIDDEN_TYPE_THREE)
}
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.loading = true
this.form.INDUSTRY_TYPE_ONE = this.form.INDUSTRY_TYPE ? this.form.INDUSTRY_TYPE[0] : ''
this.form.INDUSTRY_TYPE_TWO = this.form.INDUSTRY_TYPE ? this.form.INDUSTRY_TYPE[1] : ''
this.form.INDUSTRY_TYPE_THREE = this.form.INDUSTRY_TYPE ? this.form.INDUSTRY_TYPE[2] : ''
this.form.INDUSTRY_TYPE_FOUR = this.form.INDUSTRY_TYPE ? this.form.INDUSTRY_TYPE[3] : ''
this.form.CORP_INFO_ID = this.form.CORPINFO_ID
this.form.HIDDEN_TYPE_ONE = this.form.HIDDEN_TYPES ? this.form.HIDDEN_TYPES[0] : ''
this.form.HIDDEN_TYPE_TWO = this.form.HIDDEN_TYPES ? this.form.HIDDEN_TYPES[1] : ''
this.form.HIDDEN_TYPE_THREE = this.form.HIDDEN_TYPES ? this.form.HIDDEN_TYPES[2] : ''
requestFN(
'/hiddenLibrary/init', this.form
).then((data) => {
this.loading = false
this.close()
this.$emit('beforeClose', '')
this.$message.success('操作成功')
}).catch((e) => {
this.loading = false
})
} else {
return false
}
})
},
resetForm() {
this.form = {
INDUSTRY_TYPE_ONE: '', // 1()
INDUSTRY_TYPE_TWO: '', // 2()
INDUSTRY_TYPE_THREE: '', // 3()
INDUSTRY_TYPE_FOUR: '', // 4()
HIDDEN_TYPES: '', // ()
RISK_UNIT_ID: '', // ()
RISK_UNIT_NAME: '', // ()
HIDDEN_PART: '', //
HIDDEN_DESCR: '', //
CREATOR_ID: '', //
CREATOR_NAME: '', //
CREATED_TIME: '', //
OPERATOR_ID: '', // id
OPERATOR_NAME: '', //
OPERAT_TIME: '', //
INSPECTION_BASIS: '', //
CORP_INFO_ID: '', // id
ISDELETE: '', //
STATUS: '', // 0-1-
SOURCE: '0'
}
},
close() {
this.visible = false
this.form = {
HIDDEN_LIBRARY_ID: '',
INDUSTRY_TYPE_ONE: '', // 1()
INDUSTRY_TYPE_TWO: '', // 2()
INDUSTRY_TYPE_THREE: '', // 3()
INDUSTRY_TYPE_FOUR: '', // 4()
INDUSTRY_TYPE: '',
HIDDEN_TYPES: '', // ()
RISK_UNIT_ID: '', // ()
RISK_UNIT_NAME: '', // ()
HIDDEN_PART: '', //
HIDDEN_DESCR: '', //
CREATOR_ID: '', //
CREATOR_NAME: '', //
CREATED_TIME: '', //
OPERATOR_ID: '', // id
OPERATOR_NAME: '', //
OPERAT_TIME: '', //
INSPECTION_BASIS: '', //
INSPECTION_INFO: '',
CORP_INFO_ID: '', // id
ISDELETE: '', //
STATUS: '', // 0-1-
CORPINFO_ID: '',
SOURCE: '0'
}
},
getRiskUnit() {
requestFN(
'/riskUnit/getCorpInfoList', {}
).then((data) => {
this.corp_info_list = data.list
}).catch((e) => {
console.log(e)
})
},
getCorpInfo(query) {
if (query !== '') {
requestFN(
'/riskUnit/getCorpInfoList', { CORP_NAME: query }
).then((data) => {
this.corp_info_list = data.list
}).catch((e) => {
console.log(e)
})
} else {
requestFN(
'/riskUnit/getCorpInfoList', { CORP_NAME: query }
).then((data) => {
this.corp_info_list = data.list
}).catch((e) => {
console.log(e)
})
}
},
getDicTree() {
this.loading = true
const loadingLock = []
requestFN(
'/dictionaries/listAllDictToParIdCurrent', { parentId: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.industry_type_list = JSON.parse(data.tree)
if (loadingLock.length === 1) {
this.loading = false
} else {
loadingLock.push(1)
}
}).catch((e) => {
this.loading = false
})
requestFN(
'/dictionaries/listAllDictToParIdCurrent', { parentId: 'b4a7325f96af40808ec64c85c162933d' }
).then((data) => {
this.hidden_types_list = JSON.parse(data.tree)
if (loadingLock.length === 1) {
this.loading = false
} else {
loadingLock.push(1)
}
}).catch((e) => {
console.log(e)
})
}
}
}
</script>

View File

@ -0,0 +1,106 @@
<template>
<el-dialog :visible.sync="visible" :title="title" width="600px">
<table class="table-ui">
<tr>
<td class="tbg">行业类型</td>
<td>
{{ form.INDUSTRY_TYPE_ONE_NAME + ' - ' + form.INDUSTRY_TYPE_TWO_NAME + ' - ' + form.INDUSTRY_TYPE_THREE_NAME + ' - ' + form.INDUSTRY_TYPE_FOUR_NAME }}
</td>
</tr>
<tr>
<td class="tbg">检查隐患类型</td>
<td>
{{ form.HIDDEN_TYPE_ONE_NAME + '-' + form.HIDDEN_TYPE_TWO_NAME + '-' + form.HIDDEN_TYPE_THREE_NAME }}
</td>
</tr>
<tr>
<td class="tbg">隐患区域(风险单元名称)</td>
<td>
{{ form.RISK_UNIT_NAME }}
</td>
</tr>
<tr>
<td class="tbg">隐患部位</td>
<td>
{{ form.HIDDEN_PART }}
</td>
</tr>
<tr>
<td class="tbg">隐患描述</td>
<td>
{{ form.INSPECTION_BASIS }}
</td>
</tr>
<tr>
<td class="tbg">检查依据</td>
<td>
{{ form.HIDDEN_DESCR }}
</td>
</tr>
<tr>
<td class="tbg">依据内容</td>
<td>
{{ form.INSPECTION_INFO }}
</td>
</tr>
<tr>
<td class="tbg">整改建议</td>
<td>
{{ form.RECTIFYDESCR }}
</td>
</tr>
</table>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves'
export default {
components: { Pagination },
directives: { waves },
props: {
title: {
type: String,
default: ''
}
},
data() {
return {
loading: true,
visible: false,
form: {
INDUSTRY_TYPE_ONE_NAME: '',
INDUSTRY_TYPE_TWO_NAME: '',
INDUSTRY_TYPE_THREE_NAME: '',
INDUSTRY_TYPE_FOUR_NAME: '',
HIDDEN_TYPE_ONE_NAME: '',
HIDDEN_TYPE_TWO_NAME: '',
HIDDEN_TYPE_THREE_NAME: ''
}
}
},
created() {
},
methods: {
init(e) {
this.visible = true
if (e) {
this.form = e
}
},
close() {
this.visible = false
}
}
}
</script>
<style scoped>
.tbg{
width: 181px !important;
}
</style>

View File

@ -0,0 +1,304 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-row :gutter="20">
<el-form label-width="80px">
<el-col :span="8">
<el-form-item label="行业类型">
<cascader-dict
v-model = "form.INDUSTRY_TYPE_ARR"
:form.sync="form"
:dict-id = "dictId"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="标准名称">
<el-input v-model="form.CHECK_STANDARD_NAME" placeholder="搜索标准名称..." class="filter-item" />
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-search" @click="resetting">
重置
</el-button>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="importExcel">
批量导入
</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="INDUSTRY_TYPE_NAMES" label="行业类型" >
<template slot-scope="{row}">
{{ row.INDUSTRY_TYPE_NAMES.replaceAll(',', ' / ') }}
</template>
</el-table-column>
<el-table-column prop="CHECK_STANDARD_NAME" label="隐患排查标准名称" />
<el-table-column prop="CREATED_TIME" label="导入时间" />
<el-table-column label="操作" align="center" width="250">
<template slot-scope="{row}">
<el-row :gutter="20">
<el-col :span="8">
<el-button type="primary" icon="el-icon-video-camera" size="mini" @click="getInfo(row)"></el-button>
</el-col>
<el-col :span="8">
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
</el-col>
<el-col :span="8">
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.COMMON_ID)"></el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="false" type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<edit ref="edit" :title="title" href="edit" @beforeClose="getList"/>
<info ref="info" :title="title"/>
<update-file ref="updateFile" @logical-end="getResult"/>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import edit from './edit.vue'
import info from './info.vue'
import Info from '../../../onlinexxks/stage/exam/components/info.vue'
import updateFile from './updateFile.vue'
import CascaderDict from '../../../../components/CascaderDict'
export default {
components: { updateFile, Info, edit, Pagination, info, CascaderDict },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
KEYWORDS: '',
varList: [],
title: '新增',
dictId: 'f2598ba72e864eadabf0ca4b664d26b9', //
form: {
INDUSTRY_TYPE_ARR: [],
INDUSTRY_TYPE_TREE: '',
CHECK_STANDARD_NAME: ''
},
industry_type_list_rule: {
value: 'DICTIONARIES_ID',
label: 'NAME',
children: 'children',
lazy: true,
lazyLoad(node, resolve) {
if (!node.value) return
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: node.value }
).then((data) => {
resolve(data.list)
}).catch((e) => {
console.log(e)
})
}
},
hidden_types_list_rule: {
value: 'DICTIONARIES_ID',
label: 'NAME',
children: 'children',
lazy: true,
lazyLoad(node, resolve) {
if (!node.value) return
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: node.value }
).then((data) => {
resolve(data.list)
}).catch((e) => {
console.log(e)
})
}
},
industry_type_list: [],
hidden_types_list: []
}
},
created() {
this.getList()
this.getDict()
},
methods: {
getRowKey(row) {
return row.COMMON_ID
},
getQuery() {
this.getList()
},
resetting() {
this.form = {
INDUSTRY_TYPE_ARR: [],
INDUSTRY_TYPE_TREE: '',
CHECK_STANDARD_NAME: ''
}
this.getList()
},
getList() {
this.listLoading = true
this.form.INDUSTRY_TYPE_TREE = this.form.INDUSTRY_TYPE_ARR.join(',')
requestFN(
'/hiddenDangerCheckStandardCommon/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
this.form
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.$refs.edit.init()
this.title = '新增'
},
handleEdit(row) {
this.$refs.edit.init(row)
this.title = '编辑'
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/hiddenDangerCheckStandardCommon/delete',
{ COMMON_ID: id }
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.COMMON_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/hiddenDangerCheckStandardCommon/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'hiddenDangerCheckStandardCommon:add,hiddenDangerCheckStandardCommon:del,hiddenDangerCheckStandardCommon:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.hiddenDangerCheckStandardCommonfhadminadd //
this.del = data.hiddenDangerCheckStandardCommonfhadmindel //
this.edit = data.hiddenDangerCheckStandardCommonfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
getDict: function() {
requestFN(
'dictionaries/getLevels', { DICTIONARIES_ID: 'f2598ba72e864eadabf0ca4b664d26b9' }
).then((data) => {
this.industry_type_list = data.list
}).catch((e) => {
this.loading = false
})
requestFN(
'/dictionaries/getLevels', { DICTIONARIES_ID: 'b4a7325f96af40808ec64c85c162933d' }
).then((data) => {
this.hidden_types_list = data.list
}).catch((e) => { console.log(e) })
},
getInfo(e) {
this.$refs.info.init(e)
this.title = '详情'
},
importExcel() {
this.$refs.updateFile.init()
},
getResult(e) {
this.getList()
}
}
}
</script>

View File

@ -0,0 +1,165 @@
<template>
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="上传" width="600" @close="goBack">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="行业类型" prop="INDUSTRY_TYPE_TREE">
<cascader-dict
v-model = "form.INDUSTRY_TYPE_ARR"
:form.sync="form"
:dict-id = "dictId"
@cascaderNames="cascaderNames"
/>
</el-form-item>
<el-form-item label="标准名称" prop="CHECK_STANDARD_NAME">
<el-input id="CHECK_STANDARD_NAME" ref="CHECK_STANDARD_NAME" v-model="form.CHECK_STANDARD_NAME" maxlength="255" placeholder="这里输入标准名称..." title="标准名称"/>
</el-form-item>
<el-form-item label="导入标准Excel:" prop="excelFileList">
<el-upload
ref="fileRef"
:on-change="uploadChange"
:before-remove="uploadBeforeRemove"
:on-remove="uploadRemoved"
:auto-upload="false"
:file-list="form.excelFileList"
:limit="1"
class="avatar-uploader"
action="#"
accept=".xls">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传xls文件</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="downloadTemplate"></el-button>
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { upload } from '@/utils/upload'
import uploadFile from '../../../../components/UploadFile/index.vue'
import CascaderDict from '../../../../components/CascaderDict'
export default {
components: { Pagination, uploadFile, CascaderDict },
directives: { waves },
data() {
return {
config: config,
visible: false,
dictId: 'f2598ba72e864eadabf0ca4b664d26b9', //
form: {
INDUSTRY_TYPE_ARR: [],
INDUSTRY_TYPE: '',
INDUSTRY_TYPE_TREE: '',
INDUSTRY_TYPE_NAMES: '',
CHECK_STANDARD_NAME: '',
excelFileList: []
},
rules: {
INDUSTRY_TYPE_ARR: [{ required: true, message: '行业类型不能为空', trigger: 'blur' }],
CHECK_STANDARD_NAME: [{ required: true, message: '标准名称不能为空', trigger: 'blur' }],
excelFileList: [{ required: true, message: '导入文件不能为空', trigger: 'blur' }]
},
loading: false
}
},
methods: {
init(e) {
this.visible = true
},
goBack() {
this.resetForm()
this.visible = false
},
cascaderNames(e) {
this.form.INDUSTRY_TYPE_NAMES = e
console.log(this.form.INDUSTRY_TYPE_NAMES)
},
/** 上传组件 Begin */
uploadChange(file, fileList) {
console.log(file.raw.type)
const types = ['application/vnd.ms-excel']
const isImage = types.includes(file.raw.type)
if (!isImage) {
this.$message.error('上传文件只能是 XLS 格式!')
fileList.pop()
} else {
this.form.excelFileList = fileList
}
},
uploadBeforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
uploadRemoved(file, fileList) {
this.form.excelFileList = fileList
},
save() {
this.$refs.form.validate(valid => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '上传中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.form.INDUSTRY_TYPE = this.form.INDUSTRY_TYPE_ARR[this.form.INDUSTRY_TYPE_ARR.length - 1]
this.form.INDUSTRY_TYPE_TREE = this.form.INDUSTRY_TYPE_ARR.join(',')
const formData = new FormData()
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
formData.delete('INDUSTRY_TYPE_ARR')
formData.delete('excelFileList')
for (let i = 0; i < this.form.excelFileList.length; i++) {
if (this.form.excelFileList[i].raw) {
formData.append('FILE', this.form.excelFileList[i].raw)
}
}
upload(
'/hiddenDangerCheckStandardCommon/importExcel',
formData
).then((data) => {
loading.close()
if (data.resultStr) {
this.$message({
dangerouslyUseHTMLString: true,
message: data.resultStr,
type: data.resultType,
showClose: true,
duration: 5 * 1000
})
}
this.resetForm()
this.visible = false
this.$emit('logical-end', { result: 'OK' })
}).catch((e) => {
loading.close()
console.log(e)
})
} else {
return false
}
})
},
resetForm() {
this.$refs.fileRef.clearFiles()
this.form = {
INDUSTRY_TYPE_ARR: [],
INDUSTRY_TYPE: '',
INDUSTRY_TYPE_TREE: '',
INDUSTRY_TYPE_NAMES: '',
CHECK_STANDARD_NAME: '',
excelFileList: []
}
},
downloadTemplate() {
window.open(config.httpurl + 'hiddenDangerCheckStandardCommon/excelModel')
}
}
}
</script>

View File

@ -0,0 +1,17 @@
<template>
<div>
<List v-show="activeName==='List'" ref="list" />
</div>
</template>
<script>
import List from './components/list.vue'
export default {
components: { List },
data() {
return {
activeName: 'List'
}
}
}
</script>

View File

@ -1,6 +1,6 @@
const config = {
weburl: 'http://192.168.0.112:8082/', // 前台地址
httpurl: 'http://192.168.0.112:8098/', // 后台地址
weburl: 'http://192.168.0.69:8082/', // 前台地址
httpurl: 'http://192.168.0.69:8098/', // 后台地址
// httpurl: 'https://operate.zcloudchina.com/', // 后台地址
qyurl: 'https://qyag.zcloudchina.com/qyag/', // 企业前台
adminurl: 'https://www.qdkjchina.com/qa-prevention-admin/',