任务清单
parent
175239e20e
commit
c46a6dd3f5
|
@ -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>
|
|
@ -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 + '¤tPage=' + 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>
|
|
@ -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>
|
Loading…
Reference in New Issue