隐患排查标准库(编辑,查看,删除)
parent
ccf6c78b33
commit
41d54e8349
|
@ -1,15 +1,18 @@
|
|||
<template>
|
||||
<el-cascader
|
||||
ref="cascader"
|
||||
:value="value"
|
||||
:options="options"
|
||||
:props="props"
|
||||
:disabled = "disabled"
|
||||
:placeholder="placeholder"
|
||||
:filterable = "filterable"
|
||||
:clearable = "clearable"
|
||||
style="width: 100%"
|
||||
@change="cascaderChange" />
|
||||
<div>
|
||||
<el-cascader
|
||||
ref="cascader"
|
||||
:value="value"
|
||||
:options="options"
|
||||
:props="props"
|
||||
:disabled = "disabled"
|
||||
:placeholder="placeholder"
|
||||
:filterable = "filterable"
|
||||
:clearable = "clearable"
|
||||
style="width: 100%"
|
||||
@change="cascaderChange" />
|
||||
<i v-show="loading" class="el-icon-loading"/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { requestFN } from '@/utils/request'
|
||||
|
@ -62,6 +65,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
USER_LEVEL: JSON.parse(sessionStorage.getItem('user')).LEVEL || '2',
|
||||
options: [],
|
||||
props: {
|
||||
|
@ -73,12 +77,13 @@ export default {
|
|||
this.initHandle()
|
||||
},
|
||||
methods: {
|
||||
clearNodes() {
|
||||
this.$refs.cascader.clearCheckedNodes()
|
||||
},
|
||||
// 初始化值
|
||||
initHandle() {
|
||||
let url = '/dictionaries/getDictTreeMoreLevel'
|
||||
if (this.disabled) {
|
||||
url = '/dictionaries/getDictById'
|
||||
}
|
||||
this.loading = true
|
||||
const url = '/dictionaries/getDictTreeMoreLevel'
|
||||
return new Promise((resolve) => {
|
||||
requestFN(
|
||||
url,
|
||||
|
@ -89,6 +94,7 @@ export default {
|
|||
if (data.list.length > 0) {
|
||||
this.options = data.list
|
||||
}
|
||||
this.loading = false
|
||||
resolve()
|
||||
}).catch((e) => {
|
||||
})
|
||||
|
|
|
@ -1,29 +1,22 @@
|
|||
<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-dialog v-if="visible" :visible.sync="visible" :title="title" width="600px" @close="close">
|
||||
<el-form v-loading="loading" ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
|
||||
<el-form-item label="行业类型" prop="INDUSTRY_TYPE_TREE">
|
||||
<cascader-dict
|
||||
ref="refIndustryType"
|
||||
v-model = "form.INDUSTRY_TYPE_ARR"
|
||||
:form.sync="form"
|
||||
:dict-id = "dictId"
|
||||
@cascaderNames="cascaderNames"
|
||||
/>
|
||||
</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 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="隐患区域(风险单元名称)" 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 label="状态">
|
||||
<el-select v-model="form.COMMON_STATUS" placeholder="状态" style="width: 100px" class="filter-item">
|
||||
<el-option v-for="item in commonStatusList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -33,11 +26,11 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
||||
import { requestFN } from '@/utils/request'
|
||||
import waves from '@/directive/waves'
|
||||
import CascaderDict from '../../../../components/CascaderDict'
|
||||
export default {
|
||||
components: { Pagination },
|
||||
components: { CascaderDict },
|
||||
directives: { waves },
|
||||
props: {
|
||||
title: {
|
||||
|
@ -48,75 +41,24 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialogType: 'add',
|
||||
dictId: 'f2598ba72e864eadabf0ca4b664d26b9', // 行业类型
|
||||
commonStatusList: [
|
||||
{ id: 1, name: '有效' },
|
||||
{ id: 2, name: '停用' }
|
||||
],
|
||||
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'
|
||||
COMMON_ID: '',
|
||||
INDUSTRY_TYPE_ARR: [],
|
||||
INDUSTRY_TYPE_TREE: '',
|
||||
CHECK_STANDARD_NAME: '',
|
||||
COMMON_STATUS: ''
|
||||
},
|
||||
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_ARR: [{ required: true, message: '行业类型不能为空', trigger: 'blur' }],
|
||||
CHECK_STANDARD_NAME: [{ required: true, message: '标准名称不能为空', trigger: 'blur' }],
|
||||
COMMON_STATUS: [{ required: true, message: '状态不能为空', 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
|
||||
|
@ -130,36 +72,26 @@ export default {
|
|||
methods: {
|
||||
init(e) {
|
||||
this.visible = true
|
||||
this.getRiskUnit()
|
||||
this.getDicTree()
|
||||
if (e) {
|
||||
this.dialogType = 'edit'
|
||||
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)
|
||||
this.$set(this.form, 'INDUSTRY_TYPE_ARR', this.form.INDUSTRY_TYPE_TREE ? this.form.INDUSTRY_TYPE_TREE.split(',') : [])
|
||||
console.log(this.form)
|
||||
}
|
||||
},
|
||||
cascaderNames(e) {
|
||||
this.form.INDUSTRY_TYPE_NAMES = e
|
||||
},
|
||||
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] : ''
|
||||
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(',')
|
||||
|
||||
requestFN(
|
||||
'/hiddenLibrary/init', this.form
|
||||
'/hiddenDangerCheckStandardCommon/' + this.dialogType,
|
||||
this.form
|
||||
).then((data) => {
|
||||
this.loading = false
|
||||
this.close()
|
||||
|
@ -174,113 +106,20 @@ export default {
|
|||
})
|
||||
},
|
||||
resetForm() {
|
||||
// this.$refs.refIndustryType.clearNodes()
|
||||
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'
|
||||
COMMON_ID: '',
|
||||
INDUSTRY_TYPE_ARR: [],
|
||||
INDUSTRY_TYPE_TREE: '',
|
||||
CHECK_STANDARD_NAME: '',
|
||||
COMMON_STATUS: ''
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.resetForm()
|
||||
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)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,52 +1,52 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="title" width="600px">
|
||||
<el-dialog :visible.sync="visible" :title="title" width="95%">
|
||||
<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>
|
||||
<td colspan="3">{{ form.INDUSTRY_TYPE_NAMES.replaceAll(',', ' / ') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">检查隐患类型</td>
|
||||
<td>
|
||||
{{ form.HIDDEN_TYPE_ONE_NAME + '-' + form.HIDDEN_TYPE_TWO_NAME + '-' + form.HIDDEN_TYPE_THREE_NAME }}
|
||||
</td>
|
||||
<td class="tbg">标准名称</td>
|
||||
<td colspan="3">{{ form.CHECK_STANDARD_NAME }}</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td class="tbg">状态</td>
|
||||
<td colspan="3">{{ form.COMMON_STATUS ? (form.COMMON_STATUS === 1 ? '有效' : '停用') : '' }}</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 class="tbg">标准明细</td>
|
||||
<td colspan="3" style="padding:0;">
|
||||
<table style="padding:0;width:100%" class="table-vi">
|
||||
<tr>
|
||||
<th class="title">检查类别</th>
|
||||
<th class="title">检查类别</th>
|
||||
<th class="title">检查项目</th>
|
||||
<th class="title">检查内容</th>
|
||||
<th class="title">检查标准</th>
|
||||
<th class="title">参考依据</th>
|
||||
<th class="title">检查合格项</th>
|
||||
<th class="title">检查不合格项</th>
|
||||
<th class="title">操作类型</th>
|
||||
</tr>
|
||||
<tbody v-if="form.itemList.length > 0">
|
||||
<tr v-for="(item,index) in form.itemList" :key="index">
|
||||
<td class="title">{{ index + 1 }}</td>
|
||||
<td class="title">{{ item.CHECK_CATEGORY_NAME }}</td>
|
||||
<td class="title">{{ item.CHECK_ITEM_NAME }}</td>
|
||||
<td class="title">{{ item.CHECK_CONTENT }}</td>
|
||||
<td class="title">{{ item.CHECK_STANDARD }}</td>
|
||||
<td class="title">{{ item.REFERENCE_BASIS }}</td>
|
||||
<td class="title">{{ item.CHECK_QUALIFIED }}</td>
|
||||
<td class="title">{{ item.CHECK_UNQUALIFIED }}</td>
|
||||
<td class="title">{{ item.OPERATION_TYPE ? (item.OPERATION_TYPE === 1 ? '选择' : '填写') : '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody v-else>
|
||||
<tr>
|
||||
<td colspan="9" style="text-align: center">暂无数据</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -56,10 +56,9 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
||||
import waves from '@/directive/waves'
|
||||
import { requestFN } from '@/utils/request'
|
||||
export default {
|
||||
components: { Pagination },
|
||||
directives: { waves },
|
||||
props: {
|
||||
title: {
|
||||
|
@ -72,13 +71,11 @@ export default {
|
|||
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: ''
|
||||
COMMON_ID: '',
|
||||
INDUSTRY_TYPE_NAMES: '',
|
||||
CHECK_STANDARD_NAME: '',
|
||||
COMMON_STATUS: '',
|
||||
itemList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -88,9 +85,21 @@ export default {
|
|||
init(e) {
|
||||
this.visible = true
|
||||
if (e) {
|
||||
this.form = e
|
||||
this.getData(e)
|
||||
}
|
||||
},
|
||||
getData(COMMON_ID) {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardCommon/getInfo',
|
||||
{ COMMON_ID: COMMON_ID }
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.form = data.pd
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.visible = false
|
||||
}
|
||||
|
@ -101,6 +110,6 @@ export default {
|
|||
|
||||
<style scoped>
|
||||
.tbg{
|
||||
width: 181px !important;
|
||||
width: 110px !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,205 @@
|
|||
<template>
|
||||
<el-dialog v-if="visible" :visible.sync="visible" :title="title" width="600px" @close="close">
|
||||
<el-form v-loading="loading" ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
|
||||
<el-form-item label="标准类别" prop="CHECK_CATEGORY">
|
||||
<div class="uo-flex">
|
||||
<el-select v-if="form.CHECK_CATEGORY_WAY === 'select'" v-model="form.CHECK_CATEGORY" placeholder="选择标准类别..." clearable style="width: 100%" class="filter-item" @change="changeCategory">
|
||||
<el-option v-for="item in checkCategoryList" :key="item.DICTIONARY_ID" :label="item.DICTIONARY_NAME" :value="item.DICTIONARY_ID" />
|
||||
</el-select>
|
||||
<el-input v-if="form.CHECK_CATEGORY_WAY === 'value'" id="leaPostVal" :disabled="form.CHECK_CATEGORY_WAY === 'select'" v-model="form.CHECK_CATEGORY" placeholder="这里输入新的标准类别..." />
|
||||
<el-button
|
||||
type="success"
|
||||
style="margin-left: 5px;height: 32px;"
|
||||
size="mini"
|
||||
@click="changeEditWay">{{ form.CHECK_CATEGORY_WAY === 'select' ? '输入' : '选择' }}</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="标准项目" prop="CHECK_ITEM">
|
||||
<el-select v-if="form.CHECK_CATEGORY_WAY === 'select'" v-model="form.CHECK_ITEM" placeholder="选择标准项目..." clearable style="width: 100%" class="filter-item">
|
||||
<el-option v-for="item in checkItemList" :key="item.DICTIONARY_ID" :label="item.DICTIONARY_NAME" :value="item.DICTIONARY_ID" />
|
||||
</el-select>
|
||||
<el-input v-if="form.CHECK_CATEGORY_WAY === 'value'" id="leaPostVal" :disabled="form.CHECK_CATEGORY_WAY === 'select'" v-model="form.CHECK_ITEM" placeholder="这里输入新的标准项目..." />
|
||||
</el-form-item>
|
||||
<el-form-item label="检查内容" prop="CHECK_CONTENT">
|
||||
<el-input v-model="form.CHECK_CONTENT" :autosize="{ minRows: 1}" type="textarea" maxlength="500" placeholder="输入检查内容..." />
|
||||
</el-form-item>
|
||||
<el-form-item label="检查标准" prop="CHECK_STANDARD">
|
||||
<el-input v-model="form.CHECK_STANDARD" :autosize="{ minRows: 1}" type="textarea" maxlength="500" placeholder="输入检查标准..." />
|
||||
</el-form-item>
|
||||
<el-form-item label="参考依据" prop="REFERENCE_BASIS">
|
||||
<el-input v-model="form.REFERENCE_BASIS" :autosize="{ minRows: 1}" type="textarea" maxlength="500" placeholder="输入参考依据..." />
|
||||
</el-form-item>
|
||||
<el-form-item label="检查合格项" prop="CHECK_QUALIFIED">
|
||||
<el-input v-model="form.CHECK_QUALIFIED" :autosize="{ minRows: 1}" type="textarea" maxlength="500" placeholder="输入检查合格项..." />
|
||||
</el-form-item>
|
||||
<el-form-item label="检查不合格项" prop="CHECK_UNQUALIFIED">
|
||||
<el-input v-model="form.CHECK_UNQUALIFIED" :autosize="{ minRows: 1}" type="textarea" maxlength="500" placeholder="输入检查不合格项..." />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作类型" prop="OPERATION_TYPE">
|
||||
<el-select v-model="form.OPERATION_TYPE" placeholder="选择操作类型..." style="width: 100%" class="filter-item">
|
||||
<el-option v-for="item in operationTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="COMMON_ITEM_SORT">
|
||||
<el-input-number :min="1" :precision="0" v-model="form.COMMON_ITEM_SORT" style="width: 100%;" controls-position="right" autocomplete="off" placeholder="这里输入排序..." />
|
||||
</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 { requestFN } from '@/utils/request'
|
||||
import waves from '@/directive/waves'
|
||||
import CascaderDict from '../../../../components/CascaderDict'
|
||||
export default {
|
||||
components: { CascaderDict },
|
||||
directives: { waves },
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialogType: 'addItem',
|
||||
checkCategoryList: [], // 标准类别
|
||||
checkItemAllList: [], // 标准项目
|
||||
checkItemList: [], // 标准项目
|
||||
operationTypeList: [
|
||||
{ id: 1, name: '选择' },
|
||||
{ id: 2, name: '填写' }
|
||||
],
|
||||
tempData: {
|
||||
CHECK_CATEGORY: '',
|
||||
CHECK_ITEM: ''
|
||||
},
|
||||
form: {
|
||||
COMMON_ITEM_ID: '',
|
||||
COMMON_ID: this.$parent.COMMON_ID,
|
||||
CHECK_CATEGORY_WAY: 'select',
|
||||
CHECK_CATEGORY: '',
|
||||
CHECK_ITEM: '',
|
||||
CHECK_CONTENT: '',
|
||||
CHECK_STANDARD: '',
|
||||
REFERENCE_BASIS: '',
|
||||
CHECK_QUALIFIED: '',
|
||||
CHECK_UNQUALIFIED: '',
|
||||
OPERATION_TYPE: '',
|
||||
COMMON_ITEM_SORT: ''
|
||||
},
|
||||
rules: {
|
||||
CHECK_CATEGORY: [{ required: true, message: '标准类别不能为空', trigger: 'blur' }],
|
||||
CHECK_ITEM: [{ required: true, message: '标准项目不能为空', trigger: 'blur' }],
|
||||
CHECK_CONTENT: [{ required: true, message: '检查内容不能为空', trigger: 'blur' }],
|
||||
CHECK_STANDARD: [{ required: true, message: '检查标准不能为空', trigger: 'blur' }],
|
||||
REFERENCE_BASIS: [{ required: true, message: '参考依据不能为空', trigger: 'blur' }],
|
||||
CHECK_QUALIFIED: [{ required: true, message: '检查合格项不能为空', trigger: 'blur' }],
|
||||
CHECK_UNQUALIFIED: [{ required: true, message: '检查不合格项不能为空', trigger: 'blur' }],
|
||||
OPERATION_TYPE: [{ required: true, message: '操作类型不能为空', trigger: 'blur' }],
|
||||
COMMON_ITEM_SORT: [{ required: true, message: '排序不能为空', trigger: 'blur' }]
|
||||
},
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
corp_info_list: [],
|
||||
risk_unit_list: [],
|
||||
visible: false,
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
this.visible = true
|
||||
this.checkCategoryList = e.checkCategoryList
|
||||
this.checkItemAllList = e.checkItemAllList
|
||||
this.form.COMMON_ITEM_SORT = e.form.COMMON_ITEM_SORT
|
||||
if (e.form.COMMON_ITEM_ID) {
|
||||
this.checkItemList = this.checkItemAllList.filter(item => item.PARENT_IDS.includes(e.form.CHECK_CATEGORY))
|
||||
this.$forceUpdate()
|
||||
this.dialogType = 'editItem'
|
||||
this.form = e.form
|
||||
this.tempData.CHECK_CATEGORY = e.form.CHECK_CATEGORY
|
||||
this.tempData.CHECK_ITEM = e.form.CHECK_ITEM
|
||||
this.$set(this.form, 'CHECK_CATEGORY_WAY', 'select')
|
||||
console.log(this.form)
|
||||
}
|
||||
},
|
||||
changeEditWay() {
|
||||
this.form.CHECK_CATEGORY_WAY = this.form.CHECK_CATEGORY_WAY === 'select' ? 'value' : 'select'
|
||||
if (this.form.CHECK_CATEGORY_WAY === 'select') {
|
||||
this.form.CHECK_CATEGORY = this.tempData.CHECK_CATEGORY
|
||||
this.form.CHECK_ITEM = this.tempData.CHECK_ITEM
|
||||
} else {
|
||||
this.form.CHECK_CATEGORY = ''
|
||||
this.form.CHECK_ITEM = ''
|
||||
}
|
||||
},
|
||||
changeCategory() {
|
||||
this.form.CHECK_ITEM = ''
|
||||
this.checkItemList = []
|
||||
this.checkItemAllList.forEach((item) => {
|
||||
if (item.PARENT_IDS.includes(this.form.CHECK_CATEGORY)) {
|
||||
this.checkItemList.push(item)
|
||||
}
|
||||
})
|
||||
this.$forceUpdate()
|
||||
},
|
||||
confirm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardCommon/' + this.dialogType,
|
||||
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.$refs.refIndustryType.clearNodes()
|
||||
this.form = {
|
||||
COMMON_ITEM_ID: '',
|
||||
COMMON_ID: this.$parent.COMMON_ID,
|
||||
CHECK_CATEGORY: '',
|
||||
CHECK_ITEM: '',
|
||||
CHECK_CONTENT: '',
|
||||
CHECK_STANDARD: '',
|
||||
REFERENCE_BASIS: '',
|
||||
CHECK_QUALIFIED: '',
|
||||
CHECK_UNQUALIFIED: '',
|
||||
OPERATION_TYPE: '',
|
||||
COMMON_ITEM_SORT: ''
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.resetForm()
|
||||
this.visible = false
|
||||
},
|
||||
getDicTree() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.uo-flex {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="title" width="800px">
|
||||
<table class="table-ui">
|
||||
<tr>
|
||||
<td class="tbg" style="width: 150px">行业类型</td>
|
||||
<td>{{ form.CHECK_CATEGORY_NAME }}</td>
|
||||
<td class="tbg">标准项目</td>
|
||||
<td>{{ form.CHECK_ITEM_NAME }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">检查内容</td>
|
||||
<td colspan="3">{{ form.CHECK_CONTENT }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">检查标准</td>
|
||||
<td colspan="3">{{ form.CHECK_STANDARD }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">参考依据</td>
|
||||
<td colspan="3">{{ form.REFERENCE_BASIS }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">检查合格项</td>
|
||||
<td colspan="3">{{ form.CHECK_QUALIFIED }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">检查不合格项</td>
|
||||
<td colspan="3">{{ form.CHECK_UNQUALIFIED }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">操作类型</td>
|
||||
<td>{{ form.OPERATION_TYPE ? (form.OPERATION_TYPE === 1 ? '选择' : '填写') : '' }}</td>
|
||||
<td class="tbg">排序</td>
|
||||
<td>{{ form.COMMON_ITEM_SORT }}</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: {
|
||||
COMMON_ITEM_ID: '',
|
||||
COMMON_ID: '',
|
||||
CHECK_CATEGORY: '',
|
||||
CHECK_ITEM: '',
|
||||
CHECK_CONTENT: '',
|
||||
CHECK_STANDARD: '',
|
||||
REFERENCE_BASIS: '',
|
||||
CHECK_QUALIFIED: '',
|
||||
CHECK_UNQUALIFIED: '',
|
||||
OPERATION_TYPE: '',
|
||||
COMMON_ITEM_SORT: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
this.visible = true
|
||||
if (e) {
|
||||
this.form = e
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tbg{
|
||||
width: 110px !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,322 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-row :gutter="20">
|
||||
<el-form label-width="80px">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="标准类别">
|
||||
<el-select v-model="searchForm.CHECK_CATEGORY" placeholder="标准类别" clearable style="width: 150px" class="filter-item">
|
||||
<el-option v-for="item in checkCategoryList" :key="item.DICTIONARY_ID" :label="item.DICTIONARY_NAME" :value="item.DICTIONARY_ID" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="标准项目">
|
||||
<el-select v-model="searchForm.CHECK_ITEM" placeholder="标准项目" clearable style="width: 200px" class="filter-item">
|
||||
<el-option v-for="item in checkItemList" :key="item.DICTIONARY_ID" :label="item.DICTIONARY_NAME" :value="item.DICTIONARY_ID" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检查内容">
|
||||
<el-input v-model="searchForm.CHECK_CONTENT" 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-refresh-left" @click="resetting">
|
||||
重置
|
||||
</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="CHECK_CATEGORY_NAME" label="检查类别" width="100" />
|
||||
<el-table-column prop="CHECK_ITEM_NAME" label="检查项目" width="150" />
|
||||
<el-table-column prop="CHECK_CONTENT" label="检查内容" />
|
||||
<el-table-column prop="CHECK_STANDARD" label="检查标准" />
|
||||
<el-table-column prop="REFERENCE_BASIS" label="参考依据" />
|
||||
<el-table-column prop="CHECK_QUALIFIED" label="检查合格项" />
|
||||
<el-table-column prop="CHECK_UNQUALIFIED" label="检查不合格项" />
|
||||
<el-table-column prop="OPERATION_TYPE" label="操作类型" width="70" align="center" >
|
||||
<template slot-scope="{row}">
|
||||
{{ row.OPERATION_TYPE ? (row.OPERATION_TYPE === 1 ? '选择' : '填写') : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="300">
|
||||
<template slot-scope="{row}">
|
||||
<el-row :gutter="20">
|
||||
<el-button type="success" icon="el-icon-view" size="mini" @click="getInfo(row)">查看</el-button>
|
||||
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.COMMON_ITEM_ID)">删除</el-button>
|
||||
</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>
|
||||
<item-edit ref="edit" :title="title" href="edit" @beforeClose="refreshDict"/>
|
||||
<item-info ref="info" :title="title"/>
|
||||
</div>
|
||||
<div class="ui-height" />
|
||||
<div class="ui-foot">
|
||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
||||
import { requestFN } from '@/utils/request'
|
||||
import waves from '@/directive/waves'
|
||||
import ItemEdit from './itemEdit.vue'
|
||||
import ItemInfo from './itemInfo.vue'
|
||||
export default {
|
||||
components: { Pagination, ItemEdit, ItemInfo },
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
listLoading: true,
|
||||
add: false,
|
||||
del: false,
|
||||
edit: false,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
total: 0,
|
||||
KEYWORDS: '',
|
||||
varList: [],
|
||||
title: '新增',
|
||||
checkCategoryAllList: [], // 标准类别
|
||||
checkCategoryList: [], // 标准类别
|
||||
checkItemAllList: [], // 标准项目
|
||||
checkItemList: [], // 标准项目
|
||||
commonStatusList: [
|
||||
{ id: 1, name: '有效' },
|
||||
{ id: 2, name: '停用' }
|
||||
],
|
||||
searchForm: {
|
||||
CHECK_CATEGORY: '',
|
||||
CHECK_ITEM: '',
|
||||
CHECK_CONTENT: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'searchForm.CHECK_CATEGORY': {
|
||||
handler() {
|
||||
this.changeCategory(this.searchForm.CHECK_CATEGORY)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDictCheckCategory()
|
||||
this.getDictCheckItem()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getRowKey(row) {
|
||||
return row.COMMON_ITEM_ID
|
||||
},
|
||||
changeCategory(CHECK_CATEGORY) {
|
||||
this.searchForm.CHECK_ITEM = ''
|
||||
this.checkItemList = []
|
||||
this.checkItemAllList.forEach((item) => {
|
||||
if (item.PARENT_IDS.includes(CHECK_CATEGORY)) {
|
||||
this.checkItemList.push(item)
|
||||
}
|
||||
})
|
||||
this.$forceUpdate()
|
||||
},
|
||||
getQuery() {
|
||||
this.getList()
|
||||
},
|
||||
resetting() {
|
||||
this.searchForm = {
|
||||
CHECK_CATEGORY: '',
|
||||
CHECK_ITEM: '',
|
||||
CHECK_CONTENT: ''
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
refreshDict() {
|
||||
this.getDictCheckCategory()
|
||||
this.getDictCheckItem()
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardCommon/pageItem?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
{
|
||||
COMMON_ID: this.$parent.COMMON_ID,
|
||||
CHECK_CATEGORY: this.searchForm.CHECK_CATEGORY,
|
||||
CHECK_ITEM: this.searchForm.CHECK_ITEM,
|
||||
CHECK_CONTENT: this.searchForm.CHECK_CONTENT
|
||||
}
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.varList
|
||||
this.total = data.page.totalResult
|
||||
this.hasButton()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
const data = {}
|
||||
data.form = JSON.parse(JSON.stringify({ COMMON_ITEM_SORT: this.total + 1 }))
|
||||
data.checkCategoryList = this.checkCategoryList
|
||||
data.checkItemAllList = this.checkItemAllList
|
||||
this.$refs.edit.init(data)
|
||||
this.title = '新增'
|
||||
},
|
||||
handleEdit(row) {
|
||||
const data = {}
|
||||
data.form = JSON.parse(JSON.stringify(row))
|
||||
data.checkCategoryList = this.checkCategoryList
|
||||
data.checkItemAllList = this.checkItemAllList
|
||||
this.$refs.edit.init(data)
|
||||
this.title = '编辑'
|
||||
},
|
||||
handleDelete(id) {
|
||||
this.$confirm('确定要删除吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardCommon/deleteItem',
|
||||
{ COMMON_ITEM_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_ITEM_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
|
||||
})
|
||||
},
|
||||
async getDictCheckCategory() {
|
||||
const { list } = await requestFN(
|
||||
'/hiddenDangerCheckStandardDictionary/listSelect',
|
||||
{
|
||||
COMMON_ID: this.COMMON_ID, // 标准ID
|
||||
DICTIONARY_LEVEL: 1 // 标准类别
|
||||
}
|
||||
)
|
||||
this.checkCategoryList = list
|
||||
},
|
||||
async getDictCheckItem() {
|
||||
const { list } = await requestFN(
|
||||
'/hiddenDangerCheckStandardDictionary/listSelect',
|
||||
{
|
||||
COMMON_ID: this.COMMON_ID, // 标准ID
|
||||
DICTIONARY_LEVEL: 2 // 标准类别
|
||||
}
|
||||
)
|
||||
this.checkItemAllList = list
|
||||
},
|
||||
getInfo(e) {
|
||||
this.$refs.info.init(e)
|
||||
this.title = '详情'
|
||||
},
|
||||
getResult(e) {
|
||||
this.getList()
|
||||
},
|
||||
goBack() {
|
||||
this.$parent.activeName = 'List'
|
||||
this.$parent.COMMON_ID = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
|
@ -6,15 +6,34 @@
|
|||
<el-col :span="8">
|
||||
<el-form-item label="行业类型">
|
||||
<cascader-dict
|
||||
v-model = "form.INDUSTRY_TYPE_ARR"
|
||||
:form.sync="form"
|
||||
v-model = "searchForm.INDUSTRY_TYPE_ARR"
|
||||
:form.sync="searchForm"
|
||||
: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-input v-model="searchForm.CHECK_STANDARD_NAME" placeholder="搜索标准名称..." class="filter-item" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="导入时间">
|
||||
<el-date-picker
|
||||
v-model="searchForm.CREATE_TIME"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="searchForm.COMMON_STATUS" placeholder="状态" clearable style="width: 100px" class="filter-item">
|
||||
<el-option v-for="item in commonStatusList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" >
|
||||
|
@ -22,11 +41,11 @@
|
|||
<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 v-waves class="filter-item" type="success" icon="el-icon-refresh-left" @click="resetting">
|
||||
重置
|
||||
</el-button>
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="importExcel">
|
||||
批量导入
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-document-add" @click="importExcel('import')">
|
||||
导入标准表
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -55,19 +74,21 @@
|
|||
</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">
|
||||
<el-table-column prop="CREATE_TIME" label="导入时间" width="140" align="center" />
|
||||
<el-table-column prop="COMMON_STATUS" label="状态" width="60" align="center" >
|
||||
<template slot-scope="{row}">
|
||||
{{ row.COMMON_STATUS ? (row.COMMON_STATUS === 1 ? '有效' : '停用') : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="300">
|
||||
<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-button type="success" icon="el-icon-view" size="mini" @click="getInfo(row)">查看</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="importExcel('reimport', row)">重新导入</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="mini" @click="importExcel('appendImport', row)">追加导入</el-button>
|
||||
<el-button type="success" icon="el-icon-tickets" size="mini" @click="getCommonItem(row)">清单详细</el-button>
|
||||
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.COMMON_ID)">删除</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -111,45 +132,17 @@ export default {
|
|||
varList: [],
|
||||
title: '新增',
|
||||
dictId: 'f2598ba72e864eadabf0ca4b664d26b9', // 行业类型
|
||||
form: {
|
||||
commonStatusList: [
|
||||
{ id: 1, name: '有效' },
|
||||
{ id: 2, name: '停用' }
|
||||
],
|
||||
searchForm: {
|
||||
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: []
|
||||
CHECK_STANDARD_NAME: '',
|
||||
COMMON_STATUS: '',
|
||||
CREATE_TIME: []
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -164,19 +157,27 @@ export default {
|
|||
this.getList()
|
||||
},
|
||||
resetting() {
|
||||
this.form = {
|
||||
this.searchForm = {
|
||||
INDUSTRY_TYPE_ARR: [],
|
||||
INDUSTRY_TYPE_TREE: '',
|
||||
CHECK_STANDARD_NAME: ''
|
||||
CHECK_STANDARD_NAME: '',
|
||||
COMMON_STATUS: '',
|
||||
CREATE_TIME: []
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
this.form.INDUSTRY_TYPE_TREE = this.form.INDUSTRY_TYPE_ARR.join(',')
|
||||
this.searchForm.INDUSTRY_TYPE_TREE = this.searchForm.INDUSTRY_TYPE_ARR.join(',')
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardCommon/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
this.form
|
||||
{
|
||||
INDUSTRY_TYPE_TREE: this.searchForm.INDUSTRY_TYPE_TREE,
|
||||
CHECK_STANDARD_NAME: this.searchForm.CHECK_STANDARD_NAME,
|
||||
COMMON_STATUS: this.searchForm.COMMON_STATUS,
|
||||
CREATE_TIME_BEGIN: this.searchForm.CREATE_TIME[0] || '',
|
||||
CREATE_TIME_END: this.searchForm.CREATE_TIME[1] || ''
|
||||
}
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.varList
|
||||
|
@ -191,7 +192,7 @@ export default {
|
|||
this.title = '新增'
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.$refs.edit.init(row)
|
||||
this.$refs.edit.init(JSON.parse(JSON.stringify(row)))
|
||||
this.title = '编辑'
|
||||
},
|
||||
handleDelete(id) {
|
||||
|
@ -288,12 +289,21 @@ export default {
|
|||
this.hidden_types_list = data.list
|
||||
}).catch((e) => { console.log(e) })
|
||||
},
|
||||
getInfo(e) {
|
||||
this.$refs.info.init(e)
|
||||
getInfo(row) {
|
||||
this.$refs.info.init(row.COMMON_ID)
|
||||
this.title = '详情'
|
||||
},
|
||||
importExcel() {
|
||||
this.$refs.updateFile.init()
|
||||
getCommonItem(row) {
|
||||
this.$parent.activeName = 'ItemList'
|
||||
this.$parent.COMMON_ID = row.COMMON_ID
|
||||
},
|
||||
importExcel(importType, row) {
|
||||
const data = {}
|
||||
if (importType !== 'import') {
|
||||
data.form = JSON.parse(JSON.stringify(row))
|
||||
}
|
||||
data.importType = importType
|
||||
this.$refs.updateFile.init(data)
|
||||
},
|
||||
getResult(e) {
|
||||
this.getList()
|
||||
|
|
|
@ -1,16 +1,24 @@
|
|||
<template>
|
||||
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" title="上传" width="600" @close="goBack">
|
||||
<el-dialog v-loading="loading" v-if="visible" :visible.sync="visible" :title="title" width="600" @close="goBack">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item label="行业类型" prop="INDUSTRY_TYPE_TREE">
|
||||
<el-form-item label="行业类型" prop="INDUSTRY_TYPE_ARR">
|
||||
<cascader-dict
|
||||
v-model = "form.INDUSTRY_TYPE_ARR"
|
||||
:form.sync="form"
|
||||
:dict-id = "dictId"
|
||||
:disabled="importType !== 'import'"
|
||||
@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-input
|
||||
id="CHECK_STANDARD_NAME"
|
||||
ref="CHECK_STANDARD_NAME"
|
||||
v-model="form.CHECK_STANDARD_NAME"
|
||||
:disabled="importType !== 'import'"
|
||||
maxlength="255"
|
||||
placeholder="这里输入标准名称..."
|
||||
title="标准名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="导入标准Excel:" prop="excelFileList">
|
||||
<el-upload
|
||||
|
@ -37,6 +45,7 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import Pagination from '@/components/Pagination'
|
||||
import waves from '@/directive/waves'
|
||||
import { upload } from '@/utils/upload'
|
||||
|
@ -50,6 +59,8 @@ export default {
|
|||
return {
|
||||
config: config,
|
||||
visible: false,
|
||||
importType: '',
|
||||
title: '',
|
||||
dictId: 'f2598ba72e864eadabf0ca4b664d26b9', // 行业类型
|
||||
form: {
|
||||
INDUSTRY_TYPE_ARR: [],
|
||||
|
@ -70,6 +81,23 @@ export default {
|
|||
methods: {
|
||||
init(e) {
|
||||
this.visible = true
|
||||
this.importType = e.importType
|
||||
switch (e.importType) {
|
||||
case 'reimport':
|
||||
this.title = '重新导入'
|
||||
break
|
||||
case 'appendImport':
|
||||
this.title = '追加导入'
|
||||
break
|
||||
default:
|
||||
this.title = '导入标准表'
|
||||
break
|
||||
}
|
||||
if (e.importType !== 'import') {
|
||||
this.form = e.form
|
||||
this.$set(this.form, 'INDUSTRY_TYPE_ARR', this.form.INDUSTRY_TYPE_TREE ? this.form.INDUSTRY_TYPE_TREE.split(',') : [])
|
||||
this.$set(this.form, 'excelFileList', [])
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
this.resetForm()
|
||||
|
@ -77,11 +105,9 @@ export default {
|
|||
},
|
||||
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) {
|
||||
|
@ -112,6 +138,7 @@ export default {
|
|||
Object.keys(this.form).map(key => {
|
||||
formData.append(key, this.form[key])
|
||||
})
|
||||
formData.append('importType', this.importType)
|
||||
formData.delete('INDUSTRY_TYPE_ARR')
|
||||
formData.delete('excelFileList')
|
||||
for (let i = 0; i < this.form.excelFileList.length; i++) {
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
<template>
|
||||
<div>
|
||||
<List v-show="activeName==='List'" ref="list" />
|
||||
<ItemList v-if="activeName === 'ItemList'"/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import List from './components/list.vue'
|
||||
import ItemList from './components/itemList.vue'
|
||||
export default {
|
||||
components: { List },
|
||||
components: { List, ItemList },
|
||||
data() {
|
||||
return {
|
||||
activeName: 'List'
|
||||
activeName: 'List',
|
||||
COMMON_ID: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
<template>
|
||||
<el-dialog v-if="visible" :visible.sync="visible" :title="title" width="600px" @close="close">
|
||||
<el-form v-loading="loading" ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
|
||||
<el-form-item v-if="form.DICTIONARY_LEVEL === 2" label="所属标准类别" prop="PARENT_NAME">
|
||||
<el-input id="PARENT_NAME" ref="PARENT_NAME" v-model="form.PARENT_NAME" disabled maxlength="255" placeholder="这里输入所属标准类别..." title="所属标准类别"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="label.DICTIONARY_NAME" prop="DICTIONARY_NAME">
|
||||
<el-input id="DICTIONARY_NAME" ref="DICTIONARY_NAME" v-model="form.DICTIONARY_NAME" :placeholder="'这里输入'+label.DICTIONARY_NAME+'...'" :title="label.DICTIONARY_NAME" maxlength="255"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="DICTIONARY_SORT">
|
||||
<el-input-number :min="1" :precision="0" v-model="form.DICTIONARY_SORT" style="width: 100%;" controls-position="right" autocomplete="off" placeholder="这里输入排序..." />
|
||||
</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 { requestFN } from '@/utils/request'
|
||||
import waves from '@/directive/waves'
|
||||
import CascaderDict from '../../../../components/CascaderDict'
|
||||
export default {
|
||||
components: { CascaderDict },
|
||||
directives: { waves },
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialogType: 'add',
|
||||
dictId: 'f2598ba72e864eadabf0ca4b664d26b9', // 行业类型
|
||||
commonStatusList: [
|
||||
{ id: 1, name: '有效' },
|
||||
{ id: 2, name: '停用' }
|
||||
],
|
||||
label: {
|
||||
DICTIONARY_NAME: ''
|
||||
},
|
||||
form: {
|
||||
DICTIONARY_ID: '',
|
||||
DICTIONARY_NAME: '',
|
||||
PARENT_ID: '',
|
||||
PARENT_IDS: '',
|
||||
PARENT_NAME: '',
|
||||
DICTIONARY_NAMES: '',
|
||||
DICTIONARY_LEVEL: '',
|
||||
DICTIONARY_SORT: '',
|
||||
DICTIONARY_SOURCE: ''
|
||||
},
|
||||
rules: {
|
||||
DICTIONARY_NAME: [{ required: true, message: '类目名称不能为空', trigger: 'blur' }],
|
||||
DICTIONARY_SORT: [{ required: true, message: '排序不能为空', trigger: 'blur' }]
|
||||
},
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
visible: false,
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
this.visible = true
|
||||
if (e) {
|
||||
this.dialogType = 'edit'
|
||||
this.form = e
|
||||
if (this.form.DICTIONARY_LEVEL === 2) {
|
||||
this.label.DICTIONARY_NAME = '标准项目'
|
||||
this.$set(this.form, 'PARENT_NAME', this.form.DICTIONARY_NAMES.substr(0, this.form.DICTIONARY_NAMES.lastIndexOf(',')))
|
||||
this.rules.DICTIONARY_NAME = [{ required: true, message: '标准项目不能为空', trigger: 'blur' }]
|
||||
} else {
|
||||
this.label.DICTIONARY_NAME = '标准类别'
|
||||
this.rules.DICTIONARY_NAME = [{ required: true, message: '标准类别不能为空', trigger: 'blur' }]
|
||||
}
|
||||
console.log(this.form)
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardDictionary/' + this.dialogType,
|
||||
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.$refs.refIndustryType.clearNodes()
|
||||
this.form = {
|
||||
COMMON_ID: '',
|
||||
INDUSTRY_TYPE_ARR: [],
|
||||
INDUSTRY_TYPE_TREE: '',
|
||||
DICTIONARY_NAME: '',
|
||||
COMMON_STATUS: ''
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.resetForm()
|
||||
this.visible = false
|
||||
},
|
||||
getDicTree() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="title" width="600">
|
||||
<table class="table-ui">
|
||||
<tr>
|
||||
<td class="tbg">类目名称</td>
|
||||
<td>{{ form.DICTIONARY_NAME }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">类别</td>
|
||||
<td>{{ form.DICTIONARY_LEVEL ? (form.DICTIONARY_LEVEL === 1 ? '标准类别' : '标准项目') : '' }}</td>
|
||||
</tr>
|
||||
<tr v-if="form.DICTIONARY_LEVEL !== 1">
|
||||
<td class="tbg">标准类别</td>
|
||||
<td>{{ form.DICTIONARY_NAMES.substr(0,form.DICTIONARY_NAMES.lastIndexOf(',')) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">来源</td>
|
||||
<td>{{ form.DICTIONARY_SOURCE ? (form.DICTIONARY_SOURCE === 1 ? '运营添加' : '企业自建') : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tbg">排序</td>
|
||||
<td>{{ form.DICTIONARY_SORT }}</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td class="tbg">状态</td>
|
||||
<td colspan="3">{{ form.COMMON_STATUS ? (form.COMMON_STATUS === 1 ? '有效' : '停用') : '' }}</td>
|
||||
</tr>-->
|
||||
</table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import waves from '@/directive/waves'
|
||||
import { requestFN } from '@/utils/request'
|
||||
export default {
|
||||
directives: { waves },
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
visible: false,
|
||||
form: {
|
||||
DICTIONARY_ID: '',
|
||||
DICTIONARY_NAME: '',
|
||||
PARENT_ID: '',
|
||||
PARENT_IDS: '',
|
||||
DICTIONARY_NAMES: '',
|
||||
DICTIONARY_LEVEL: '',
|
||||
DICTIONARY_SORT: '',
|
||||
DICTIONARY_SOURCE: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
this.visible = true
|
||||
if (e) {
|
||||
this.form = e
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tbg{
|
||||
width: 110px !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,241 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-form label-width="80px">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="searchForm.DICTIONARY_NAMES" 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-refresh-left" @click="resetting">
|
||||
重置
|
||||
</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'
|
||||
}"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
default-expand-all>
|
||||
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="DICTIONARY_NAME" label="类目名称" />
|
||||
<el-table-column prop="DICTIONARY_LEVEL" label="类别" width="140" align="center" >
|
||||
<template slot-scope="{row}">
|
||||
{{ row.DICTIONARY_LEVEL ? (row.DICTIONARY_LEVEL === 1 ? '标准类别' : '标准项目') : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="DICTIONARY_SOURCE" label="来源" width="140" align="center" >
|
||||
<template slot-scope="{row}">
|
||||
{{ row.DICTIONARY_SOURCE ? (row.DICTIONARY_SOURCE === 1 ? '运营添加' : '企业自建') : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="DICTIONARY_SORT" label="排序" width="60" align="center" />
|
||||
<el-table-column label="操作" align="center" width="300">
|
||||
<template slot-scope="{row}">
|
||||
<el-row :gutter="20">
|
||||
<el-button type="success" icon="el-icon-view" size="mini" @click="getInfo(row)">查看</el-button>
|
||||
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.COMMON_ID)">删除</el-button>
|
||||
</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"/>
|
||||
</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'
|
||||
export default {
|
||||
components: { Info, edit, Pagination },
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
listLoading: true,
|
||||
add: false,
|
||||
del: false,
|
||||
edit: false,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
total: 0,
|
||||
KEYWORDS: '',
|
||||
varList: [],
|
||||
title: '新增',
|
||||
dictId: 'f2598ba72e864eadabf0ca4b664d26b9', // 行业类型
|
||||
commonStatusList: [
|
||||
{ id: 1, name: '有效' },
|
||||
{ id: 2, name: '停用' }
|
||||
],
|
||||
searchForm: {
|
||||
DICTIONARY_NAMES: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
getRowKey(row) {
|
||||
return row.DICTIONARY_ID
|
||||
},
|
||||
getQuery() {
|
||||
this.getList()
|
||||
},
|
||||
resetting() {
|
||||
this.searchForm = {
|
||||
DICTIONARY_NAMES: ''
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardDictionary/listTree?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
{
|
||||
DICTIONARY_NAMES: this.searchForm.DICTIONARY_NAMES
|
||||
}
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.varList
|
||||
this.hasButton()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.edit.init()
|
||||
this.title = '新增'
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.$refs.edit.init(JSON.parse(JSON.stringify(row)))
|
||||
this.title = '编辑'
|
||||
},
|
||||
handleDelete(id) {
|
||||
this.$confirm('确定要删除吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardDictionary/delete',
|
||||
{ DICTIONARY_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.DICTIONARY_ID
|
||||
}).join(',')
|
||||
|
||||
this.$confirm('确定要删除选中的数据吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/hiddenDangerCheckStandardDictionary/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 = 'hiddenDangerCheckStandardDictionary:add,hiddenDangerCheckStandardDictionary:del,hiddenDangerCheckStandardDictionary:edit,toExcel'
|
||||
requestFN(
|
||||
'/head/hasButton',
|
||||
{
|
||||
keys: keys
|
||||
}
|
||||
).then((data) => {
|
||||
console.log(data)
|
||||
this.add = data.hiddenDangerCheckStandardDictionaryfhadminadd // 新增权限
|
||||
this.del = data.hiddenDangerCheckStandardDictionaryfhadmindel // 删除权限
|
||||
this.edit = data.hiddenDangerCheckStandardDictionaryfhadminedit // 修改权限
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
getDict: function() {
|
||||
},
|
||||
getInfo(row) {
|
||||
this.$refs.info.init(row)
|
||||
this.title = '详情'
|
||||
},
|
||||
getResult(e) {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
|
@ -0,0 +1,18 @@
|
|||
<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',
|
||||
COMMON_ID: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue