liujun0708-动火作业流程图逻辑修改
liy 2024-07-04 11:47:28 +08:00
parent e42792bc57
commit c055b24d14
3 changed files with 729 additions and 0 deletions

View File

@ -0,0 +1,386 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="KEYWORDS" placeholder="搜索" class="filter-item" style="width: 200px;" />
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
</div>
<el-table ref="multipleTable" :data="varList" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="标题" prop="TITLE" width="180">
<template slot-scope="{row}">
<span
:style="{color:'#0c60e1',cursor: 'pointer'}"
@click="goList('casesummary',row.ID,'1')">{{ row.TITLE }}</span>
</template>
</el-table-column>
<el-table-column prop="LEVELNAME" label="事故级别" width="180" />
<el-table-column prop="CONTENT" label="内容" show-overflow-tooltip="true" />
<el-table-column prop="DEPARTMENT_NAME" width="180" align="center" label="附件" >
<template v-if="row.FILE_URL" slot-scope="{row}">
<el-button type="primary" icon="el-icon-down" size="mini" @click="download(row)"></el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-document" size="mini" @click="handleDetail(row)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.ID,row.NAME)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<template>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button type="danger" icon="el-icon-delete" plain @click="makeAll('0')"></el-button>
</template>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='editUser'?'修改':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="标题" prop="TITLE">
<el-input v-model="form.TITLE" placeholder="这里输入标题..." />
</el-form-item>
<el-form-item label="事故级别" prop="TYPE_DIC_ID">
<Treeselect
:options="treeData"
:normalizer="normalizer"
v-model="form.LEVEL"
:disable-branch-nodes="true"
placeholder="请选择法规"
no-options-text="暂无数据"
no-children-text="暂无数据"
/>
</el-form-item>
<el-form-item label="内容" prop="CONTENT">
<el-input
v-model="form.CONTENT"
:rows="10"
type="textarea"
placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="附件">
<el-upload
ref="upload"
:on-change="handleEditChange"
:on-remove="handleRemove"
:auto-upload="false"
:limit="1"
action="#" >
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormShow" title="查看" width="800px">
<table class="table-ui">
<tr>
<td class="tbg">标题</td>
<td>
<div v-html="form.TITLE" />
</td>
</tr>
<tr>
<td class="tbg">内容</td>
<td>
<div v-html="form.CONTENT" />
</td>
</tr>
<tr v-if="form.FILE_URL">
<td class="tbg">附件</td>
<td><a @click="download(form)"></a></td>
</tr>
<tr><td colspan="2" style="text-align: center">案件总结</td></tr>
<tbody v-for="item in caseSummaryList" :key="item.ID" >
<tr >
<td class="tbg">内容</td>
<td>
<div v-html="item.CONTENT" />
</td>
</tr>
<tr v-if="item.FILE_URL">
<td class="tbg">附件</td>
<td><a @click="download(item)"></a></td>
</tr>
</tbody>
</table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormShow = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import { upload } from '@/utils/upload'
import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
components: { Treeselect, Pagination },
data() {
return {
listQuery: {
page: 1,
limit: 10
},
total: 0,
varList: [],
KEYWORDS: '',
dialogFormEdit: false,
dialogFormShow: false,
dialogType: 'add',
form: {
TITLE: '',
CONTENT: '',
LEVEL: ''
},
rules: {
TITLE: [
{ required: true, message: '类型不能为空', trigger: 'blur' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }]
},
FFILE: [],
caseSummaryList: [],
treeData: [],
normalizer(node) {
return {
id: node.DICTIONARIES_ID,
label: node.name,
children: node.nodes
}
}
}
},
created() {
this.getList()
this.getTreeList()
},
methods: {
getTreeList() {
requestFN(
'/caseLibrary/listTree',
{
}
).then((data) => {
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
})
},
//
goList(page, CASE_ID, ticketType) {
this.$parent.activeName = page
this.$parent.CASE_ID = CASE_ID
this.$parent.ticketType = ticketType
},
//* **********************************************
download(obj) {
this.$confirm('确定要下载此文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.downloadUrl = config.fileUrl + obj.FILE_URL
const _this = this
setTimeout(function() {
window.open(_this.downloadUrl)
}, 200)
}).catch(() => {
})
},
// *******************************************
handleEditChange(file) {
file.MATERIALS_ID = Math.random()
const is5M = file.size / 1024 / 1024 < 5
if (is5M) this.FFILE.push(file)
},
handleRemove(file, fileList) {
this.FFILE = fileList
},
upload(fun) {
const formData = new FormData()
for (let i = 0; i < this.FFILE.length; i++) {
if (this.FFILE[i].raw) {
formData.append('FFILE', this.FFILE[i].raw)
}
}
upload(
'/file/upload',
formData
).then((data) => {
fun(data.fileurl)
}).catch((e) => {
})
},
//* *************************************************
getList() {
this.listLoading = true
requestFN(
'/caseLibrary/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
name: this.KEYWORDS
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
})
.catch((e) => {
this.listLoading = false
})
},
//* ***********************************************************
handleDetail(v) {
this.dialogFormShow = true
this.form = {
TITLE: v.TITLE,
CONTENT: v.CONTENT,
FILE_URL: v.FILE_URL,
LEVEL: v.LEVEL
}
//
requestFN(
'/caseLibrary/getCaseSummaryList',
{
id: v.ID
}
).then((data) => {
this.caseSummaryList = data.varList
})
},
//* *************************************************************
handleEdit(v) {
this.dialogFormEdit = true
this.form = {
TITLE: v.TITLE,
CONTENT: v.CONTENT,
LEVEL: v.LEVEL,
ID: v.ID
}
this.dialogType = 'editUser'
this.$refs.upload.clearFiles()
},
handleAdd() {
this.dialogFormEdit = true
this.form = {}
this.dialogType = 'saveUser'
this.$refs.upload.clearFiles()
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
if (this.FFILE.length > 0) {
this.upload((v) => {
this.form.FILE_URL = v
this.$refs.upload.clearFiles()
this.dataSave()
})
} else {
this.dataSave()
}
} else {
return false
}
})
},
dataSave() {
this.listLoading = true
requestFN(
'/caseLibrary/save', this.form
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
//* *************************************************************
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/caseLibrary/delete',
{
id: id
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
makeAll() {
const _selectData = this.$refs.multipleTable.selection
console.info('_selectData')
console.info(_selectData)
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/caseLibrary/deleteAll',
{
ids: ids
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
}
}
}
</script>

View File

@ -0,0 +1,324 @@
<template>
<div class="app-container">
<div class="filter-container" style=" display: flex;justify-content: space-between;">
<div>
<el-tag>案例总结</el-tag>
</div>
<div >
<el-button type="primary" @click="goBack"></el-button>
</div>
</div>
<el-table ref="multipleTable" :data="varList" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="CONTENT" label="内容" show-overflow-tooltip="true" />
<el-table-column prop="DEPARTMENT_NAME" width="180" align="center" label="附件" >
<template v-if="row.FILE_URL" slot-scope="{row}">
<el-button type="primary" icon="el-icon-down" size="mini" @click="download(row)"></el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-document" size="mini" @click="handleDetail(row)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.ID,row.NAME)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<template>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<!-- <el-button type="danger" icon="el-icon-delete" plain @click="makeAll('0')"></el-button>-->
</template>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='editUser'?'修改案例总结':'新增案例总结'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="内容" prop="CONTENT">
<el-input
v-model="form.CONTENT"
:rows="10"
type="textarea"
placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="附件">
<el-upload
ref="upload"
:on-change="handleEditChange"
:on-remove="handleRemove"
:auto-upload="false"
:limit="1"
action="#" >
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormShow" title="查看" width="800px">
<table class="table-ui">
<tr>
<td class="tbg">内容</td>
<td>
<div v-html="form.CONTENT" />
</td>
</tr>
<tr v-if="form.FILE_URL">
<td class="tbg">附件</td>
<td><a @click="download(form)"></a></td>
</tr>
</table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormShow = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request'
import { upload } from '@/utils/upload'
export default {
components: { Pagination },
data() {
return {
listQuery: {
page: 1,
limit: 10
},
total: 0,
varList: [],
KEYWORDS: '',
dialogFormEdit: false,
dialogFormShow: false,
dialogType: 'add',
form: {
NAME: '',
TYPE: '',
CONTENT: ''
},
rules: {
TYPE: [
{ required: true, message: '名称不能为空', trigger: 'blur' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
NAME: [
{ required: true, message: '类型不能为空', trigger: 'blur' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }]
},
FFILE: [],
caselibraryid: ''
}
},
created() {
if (this.$parent.CASE_ID) {
this.caselibraryid = this.$parent.CASE_ID
}
this.getList()
},
methods: {
goBack() {
this.$parent.activeName = 'casebasic'
},
//* **********************************************
download(obj) {
this.$confirm('确定要下载此文件吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.downloadUrl = config.fileUrl + obj.FILE_URL
const _this = this
setTimeout(function() {
window.open(_this.downloadUrl)
}, 200)
}).catch(() => {
})
},
// *******************************************
handleEditChange(file) {
file.MATERIALS_ID = Math.random()
const is5M = file.size / 1024 / 1024 < 5
if (is5M) this.FFILE.push(file)
},
handleRemove(file, fileList) {
this.FFILE = fileList
},
upload(fun) {
const formData = new FormData()
for (let i = 0; i < this.FFILE.length; i++) {
if (this.FFILE[i].raw) {
formData.append('FFILE', this.FFILE[i].raw)
}
}
upload(
'/file/upload',
formData
).then((data) => {
fun(data.fileurl)
}).catch((e) => {
})
},
//* *************************************************
getList() {
this.listLoading = true
requestFN(
'/caseLibrary/summarylist?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
id: this.caselibraryid
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
})
.catch((e) => {
this.listLoading = false
})
},
//* ***********************************************************
handleDetail(v) {
this.dialogFormShow = true
this.form = {
CONTENT: v.CONTENT,
FILE_URL: v.FILE_URL,
YJ_CASE_LIBRARY_ID: v.YJ_CASE_LIBRARY_ID
}
},
//* *************************************************************
handleEdit(v) {
this.dialogFormEdit = true
this.form = {
CONTENT: v.CONTENT,
ID: v.ID,
YJ_CASE_LIBRARY_ID: v.YJ_CASE_LIBRARY_ID
}
this.dialogType = 'editUser'
this.$refs.upload.clearFiles()
},
handleAdd() {
this.dialogFormEdit = true
this.form = {}
this.dialogType = 'saveUser'
this.$refs.upload.clearFiles()
},
confirm() {
this.form.YJ_CASE_LIBRARY_ID = this.caselibraryid
this.$refs.form.validate(valid => {
if (valid) {
if (this.FFILE.length > 0) {
this.upload((v) => {
this.form.FILE_URL = v
this.$refs.upload.clearFiles()
this.dataSave()
})
} else {
this.dataSave()
}
} else {
return false
}
})
},
dataSave() {
this.listLoading = true
requestFN(
'/caseLibrary/summarysave', this.form
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
//* *************************************************************
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/caseLibrary/summarydelete',
{
id: id
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
makeAll() {
const _selectData = this.$refs.multipleTable.selection
console.info('_selectData')
console.info(_selectData)
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/caseLibrary/deleteAll',
{
ids: ids
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
}
}
}
</script>

View File

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