dev #1

Merged
wangpeng merged 5 commits from integrated_whb/integrated_whb_admin_vue:dev into dev 2024-02-22 11:25:44 +08:00
8 changed files with 438 additions and 59 deletions

View File

@ -1,5 +1,5 @@
<template>
<div>
<div style="position: relative">
<el-cascader
ref="cascader"
:value="value"
@ -11,7 +11,7 @@
:clearable = "clearable"
style="width: 100%"
@change="cascaderChange" />
<i v-show="loading" class="el-icon-loading"/>
<i v-show="loading" class="el-icon-loading" style="position: absolute;top: 10px;right: 25px;"/>
</div>
</template>
<script>

View File

@ -1,7 +1,7 @@
<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="INDUSTRY_TYPE_TREE">
<el-form-item label="行业类型" prop="INDUSTRY_TYPE_ARR">
<cascader-dict
ref="refIndustryType"
v-model = "form.INDUSTRY_TYPE_ARR"
@ -13,7 +13,7 @@
<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="状态">
<el-form-item label="状态" prop="COMMON_STATUS">
<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>

View File

@ -1,56 +1,62 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-row :gutter="20">
<div class="filter-row mb-10">
<el-form label-width="80px">
<el-col :span="8">
<el-form-item label="行业类型">
<cascader-dict
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="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" >
<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-button v-waves class="filter-item" type="primary" icon="el-icon-document-add" @click="importExcel('import')">
导入标准表
</el-button>
</el-form-item>
</el-col>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="行业类型">
<cascader-dict
v-model = "searchForm.INDUSTRY_TYPE_ARR"
:form.sync="searchForm"
:dict-id = "dictId"
/>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="标准名称">
<el-input v-model="searchForm.CHECK_STANDARD_NAME" placeholder="搜索标准名称..." class="filter-item" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<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="5">
<el-form-item label="状态">
<el-select v-model="searchForm.COMMON_STATUS" placeholder="状态" clearable style="width: 100%" 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" >
<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-row>
</el-form>
</el-row>
</div>
<div class="filter-flot">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-document-add" @click="importExcel('import')">
导入标准表
</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
@ -80,16 +86,18 @@
{{ row.COMMON_STATUS ? (row.COMMON_STATUS === 1 ? '有效' : '停用') : '' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<el-table-column label="操作" align="center" width="320">
<template slot-scope="{row}">
<el-row :gutter="20">
<el-row :gutter="20" style="margin-bottom: 5px">
<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" :disabled="row.COUNT_CUSTOM !== 0" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.COMMON_ID)"></el-button>
</el-row>
<el-row :gutter="20">
<el-button type="success" icon="el-icon-tickets" size="mini" @click="getCommonItem(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-row>
</template>
</el-table-column>
</el-table>
@ -312,3 +320,12 @@ export default {
}
</script>
<style lang="sass" scoped>
.filter-container
position: relative
.filter-flot
position: absolute
padding-bottom: 33px
right: 0
bottom: 0
</style>

View File

@ -56,7 +56,7 @@
<el-row :gutter="20">
<el-button type="success" icon="el-icon-view" size="mini" @click="getInfo(row)"></el-button>
<el-button v-show="edit" :disabled="row.COUNT_USE !== 0" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-show="del" :disabled="row.COUNT_USE !== 0" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.COMMON_ID)"></el-button>
<el-button v-show="del" :disabled="row.COUNT_USE !== 0" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.DICTIONARY_ID)"></el-button>
</el-row>
</template>
</el-table-column>

View File

@ -238,7 +238,8 @@ export default {
{ title: '教育培训', model: 'educationAndTraining' },
{ title: '高危作业管理', model: 'highRisk' },
{ title: '监测预警', model: 'monitor' },
{ title: '综合管理', model: 'comprehensive' }
{ title: '综合管理', model: 'comprehensive' },
{ title: '定位管理', model: 'positioning' }
],
dialog: {
visible: false,

View File

@ -0,0 +1,108 @@
<template>
<el-dialog :visible.sync="visible" :title="title" width="600px">
<el-form v-loading="loading" ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="编号" prop="TASK_NUM">
<el-input id="TASK_NUM" ref="TASK_NUM" v-model="form.TASK_NUM" placeholder="这里输入隐患部位..." title="隐患部位"/>
</el-form-item>
<el-form-item label="描述" prop="TERM_DESCRIBE">
<el-input id="TERM_DESCRIBE" ref="TERM_DESCRIBE" v-model="form.TERM_DESCRIBE" type="textarea" placeholder="这里输入描述..." title="描述"/>
</el-form-item>
<el-form-item label="归属类型" prop="WORK_TYPE">
<el-select v-model="form.WORK_TYPE" clearable placeholder="请选择">
<el-option value="1" label="主要负责人" />
<el-option value="2" label="技术负责人" />
<el-option value="3" label="操作负责人" />
</el-select>
</el-form-item>
<el-form-item label="排序" prop="SORT">
<el-input id="SORT" ref="SORT" v-model="form.SORT" 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,
visible: false,
dialogType: 'add',
form: {
TASK_NUM: '',
TERM_DESCRIBE: '',
WORK_TYPE: '',
SORT: ''
},
rules: {
TASK_NUM: [{ required: true, message: '编号不能为空', trigger: 'blur' },
{ pattern: /^[0-9]{1,2}$/,
message: '编号必须是1~2位数字' }],
TERM_DESCRIBE: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
WORK_TYPE: [{ required: true, message: '归属类型不能为空', trigger: 'blur' }],
SORT: [{ required: true, message: '排序不能为空', trigger: 'blur' }]
}
}
},
methods: {
init(e) {
this.visible = true
if (e) {
this.dialogType = 'edit'
this.form = e
}
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.loading = true
requestFN(
'/hiddenTermLibrary/' + 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.form = {
TASK_NUM: '',
TERM_DESCRIBE: '',
WORK_TYPE: '',
SORT: ''
}
},
close() {
this.visible = false
this.form = {
TASK_NUM: '',
TERM_DESCRIBE: '',
WORK_TYPE: '',
SORT: ''
}
}
}
}
</script>

View File

@ -0,0 +1,236 @@
<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="form.KEYWORDS" placeholder="按关键字查询" class="filter-item" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="归属类型">
<el-select v-model="form.WORK_TYPE" clearable placeholder="请选择">
<el-option value="1" label="主要负责人" />
<el-option value="2" label="技术负责人" />
<el-option value="3" label="操作负责人" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<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-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="TERM_DESCRIBE" label="描述" />
<el-table-column label="归属类型" >
<template slot-scope="{row}">
<span v-if="row.WORK_TYPE === '1'"></span>
<span v-if="row.WORK_TYPE === '2'"></span>
<span v-if="row.WORK_TYPE === '3'"></span>
</template>
</el-table-column>
<el-table-column prop="CREATE_TIME" label="创建时间" />
<el-table-column prop="SORT" label="顺序" />
<el-table-column label="操作" align="center" width="250">
<template slot-scope="{row}">
<el-row :gutter="20">
<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.TERM_LIBRARY_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"/>
</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'
export default {
components: { edit, Pagination },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 10
},
total: 0,
KEYWORDS: '',
varList: [],
title: '新增',
form: {
KEYWORDS: '',
WORK_TYPE: ''
}
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.HIDDEN_LIBRARY_ID
},
getQuery() {
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/hiddenTermLibrary/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(
'/hiddenTermLibrary/delete',
{ TERM_LIBRARY_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.TERM_LIBRARY_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/hiddenTermLibrary/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 = 'hiddenTermLibrary:add,hiddenTermLibrary:del,hiddenTermLibrary:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.hiddenTermLibraryfhadminadd //
this.del = data.hiddenTermLibraryfhadmindel //
this.edit = data.hiddenTermLibraryfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
resetting() {
this.form = {
KEYWORDS: '',
WORK_TYPE: ''
}
this.getList()
},
getResult(e) {
this.getList()
}
}
}
</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>