qa-prevention-gwj-vue/src/views/oneCompany/reflection/components/list.vue

195 lines
6.2 KiB
Vue
Raw Normal View History

2024-04-13 10:27:29 +08:00
<template>
<div class="app-container">
<el-form label-width="130px">
<el-row>
<el-col :span="6">
<el-form-item label="用户名">
<el-input v-model="KEYWORDS" placeholder="请输入用户名"/>
</el-form-item>
</el-col>
<el-col v-if="false" :span="6">
<el-form-item label="培训状态">
<el-select v-model="STATUS" placeholder="请选择培训状态" style="width: 100%;" clearable>
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"/>
</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" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<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 :selectable="handleSelectWithDifferentStatus" type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="USERNAME" label="用户名" align="center"/>
<el-table-column prop="NAME" label="姓名" align="center"/>
2024-04-13 10:59:29 +08:00
<el-table-column prop="departmentName" label="部门名称" align="center"/>
<el-table-column prop="userPhone" label="用户手机号" align="center"/>
<el-table-column prop="deviceId" label="设备id" align="center"/>
<el-table-column prop="deviceName" label="设备名称" align="center"/>
<el-table-column prop="id" label="其他系统编号" align="center"/>
<el-table-column prop="idRemark" label="其他系统备注" align="center"/>
<el-table-column prop="createTime" label="创建时间" align="center"/>
<el-table-column label="操作" align="center" width="200">
2024-04-13 10:27:29 +08:00
<template slot-scope="{row}">
2024-04-13 10:59:29 +08:00
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleDelete(row)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleDelete(row)"></el-button>
2024-04-13 10:27:29 +08:00
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
2024-04-13 10:59:29 +08:00
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
2024-04-13 10:27:29 +08:00
</div>
2024-04-13 10:59:29 +08:00
<pagination :total="listQuery.total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/>
2024-04-13 10:27:29 +08:00
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import vueQr from 'vue-qr'
export default {
2024-04-13 10:45:56 +08:00
components: { Pagination, vueQr },
2024-04-13 10:27:29 +08:00
directives: { waves },
data() {
return {
config: config,
listQuery: {
2024-04-13 10:59:29 +08:00
page: 0,
limit: 10,
total: 0
2024-04-13 10:27:29 +08:00
},
add: false, // 新增按钮
del: false, // 删除按钮
edit: false // 修改按钮
}
},
created() {
this.getDict()
this.getList()
this.hasButton()
},
methods: {
handleSelectWithDifferentStatus(row, rowIndex) {
if (row.STATUS === 0) {
// 不禁用
return true
} else {
// 禁用
return false
}
},
getQuery() {
if (this.$refs.multipleTable) {
this.$refs.multipleTable.clearSelection()
}
this.listQuery = {
page: 1,
limit: 10
}
this.getList()
},
goKeyReset() {
this.KEYWORDS = ''
this.STATUS = ''
this.getQuery()
},
getList() {
this.listLoading = true
requestFN(
2024-04-13 10:59:29 +08:00
'/dw/getMapList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
2024-04-13 10:27:29 +08:00
{
KEYWORDS: this.KEYWORDS,
STATUS: '1',
EMPLOY_FLAG: '1',
CHECK_STATUS: '1'
}
).then((data) => {
this.listLoading = false
this.varList = data.list
this.total = data.page.totalResult
})
.catch((e) => {
this.listLoading = false
})
},
handleAdd() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '未勾选培训人员...',
type: 'error'
})
return false
}
var users = []
_selectData.map(item => {
if (item.STATUS === 0) {
users.push(item.USER_ID)
}
})
if (users == null || users.length == 0) {
this.$message({
message: '勾选人员暂无法提交申请...',
type: 'error'
})
return false
}
this.$refs.apply.init(users)
},
hasButton() {
var keys = 'trainingbatch:add,trainingbatch:del,trainingbatch:edit,fhSms,email,fromExcel,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys, tm: new Date().getTime()
}
).then((data) => {
if (data.result == 'success') {
this.add = data.trainingbatchfhadminadd // 增
this.del = data.trainingbatchfhadmindel // 删
this.edit = data.trainingbatchfhadminedit // 改
this.fromExcel = data.fromExcel // 从excel导入权限
this.toExcel = data.toExcel // 导出到excel权限
} else if (data.result == 'exception') {
// showException('按钮权限', data.exception)// 显示异常
console.info('按钮权限:', data.exception)
}
})
.catch((e) => {
this.listLoading = false
})
},
getDict: function() {
2024-04-13 10:59:29 +08:00
requestFN('dw/getDictionary').then((data) => {
2024-04-13 10:27:29 +08:00
this.wenhuachengduList = data.list
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>