未分页bug修复
parent
03a1881fa6
commit
5b145195c8
|
@ -0,0 +1,316 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-loading="loading"
|
||||
:visible.sync="visible"
|
||||
:append-to-body="appendToBody"
|
||||
:before-close="beforeClose"
|
||||
title="审批"
|
||||
width="1200px"
|
||||
destroy-on-close>
|
||||
<el-form ref="form" :model="material" :rules="rules" label-width="200px" label-position="right" type="flex">
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="typeInfo" label="映射类型: ">
|
||||
<el-select v-model="material.typeInfo" filterable style="width: 300px" placeholder="请选择" @change="saveInfo">
|
||||
<el-option v-for="item in dic.mapType" :key="item.value" :label="item.name" :value="JSON.stringify(item)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门:" prop="departmentId">
|
||||
<Treeselect
|
||||
:options="dic.deptList"
|
||||
:normalizer="normalizer"
|
||||
v-model="material.departmentId"
|
||||
placeholder="请选择部门"
|
||||
no-options-text="暂无数据"
|
||||
no-children-text="暂无数据"
|
||||
style="width: 300px"
|
||||
@select="getPeopleList($event)"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="人员:" prop="userInfo">
|
||||
<el-select v-model="material.userInfo" style="width: 300px" placeholder="请选择" @change="chooseUser">
|
||||
<el-option
|
||||
v-for="item in dic.userList"
|
||||
:key="item.USER_ID"
|
||||
:value="JSON.stringify(item)"
|
||||
:label="item.NAME"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编号:" prop="deviceId">
|
||||
<el-input v-model="material.deviceId" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称:" prop="deviceName">
|
||||
<el-input v-model="material.deviceName" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他系统编号:" prop="id">
|
||||
<el-input v-model="material.id" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他系统编号备注:" prop="id_remark">
|
||||
<el-input v-model="material.idRemark" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注:" prop="id">
|
||||
<el-input v-model="material.remark" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">关 闭</el-button>
|
||||
<el-button type="primary" @click="sendMessage('1')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vueQr from 'vue-qr'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import { requestFN } from '@/utils/request'
|
||||
import uploadFile from '../../../util/uploadFile/index.vue'
|
||||
|
||||
export default {
|
||||
components: { uploadFile, Treeselect, vueQr },
|
||||
props: {
|
||||
appendToBody: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
material: {
|
||||
typeInfo: '',
|
||||
type: '',
|
||||
typeName: '',
|
||||
deptInfo: '',
|
||||
departmentId: null,
|
||||
departmentName: '',
|
||||
userInfo: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
deviceId: '',
|
||||
deviceName: '',
|
||||
id: '',
|
||||
idRemark: '',
|
||||
remark: ''
|
||||
},
|
||||
form: {
|
||||
required: {
|
||||
type: '',
|
||||
typeName: '',
|
||||
departmentId: '',
|
||||
departmentName: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
deviceId: '',
|
||||
deviceName: '',
|
||||
id: '',
|
||||
idRemark: ''
|
||||
},
|
||||
remark: ''
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.nodes
|
||||
}
|
||||
},
|
||||
|
||||
rules: {
|
||||
typeInfo: [
|
||||
{ required: true, message: '请选择映射类型', trigger: 'change' }
|
||||
],
|
||||
userInfo: [
|
||||
{ required: true, message: '请选择映射人', trigger: 'change' }
|
||||
],
|
||||
departmentId: [
|
||||
{ required: true, message: '请选择部门', trigger: 'change' }
|
||||
],
|
||||
deviceId: [
|
||||
{ required: true, message: '请填写其他系统编号', trigger: 'change' }
|
||||
],
|
||||
deviceName: [
|
||||
{ required: true, message: '请填写其他系统名称', trigger: 'change' }
|
||||
],
|
||||
id: [
|
||||
{ required: true, message: '请填写其他系统编号', trigger: 'change' }
|
||||
],
|
||||
idRemark: [
|
||||
{ required: true, message: '请填写其他系统编号备注', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
heirloom: {},
|
||||
departmentTree: [],
|
||||
peopleList: [],
|
||||
dic: {
|
||||
alarmStatus: [],
|
||||
logType: [],
|
||||
mapType: [],
|
||||
deptList: [],
|
||||
userList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init(e) {
|
||||
if (e) {
|
||||
this.heirloom = e
|
||||
}
|
||||
this.visible = true
|
||||
await this.getDepartmentTree()
|
||||
this.getDict()
|
||||
},
|
||||
getMenu() {
|
||||
return new Promise(resolve => {
|
||||
requestFN(
|
||||
'/flowTrain/getPintName', { FLOWS_TYPE: this.info.FLOWS_TYPE, FLOWS_STEP: this.info.FLOWS_STEP }
|
||||
).then((data) => {
|
||||
this.menu.department = data.Department
|
||||
this.menu.user = data.User
|
||||
this.menu.uploadFile = data.UploadFile
|
||||
this.menu.limitFlag = data.limitFlag
|
||||
resolve(true)
|
||||
}).catch((e) => {
|
||||
})
|
||||
})
|
||||
},
|
||||
sendMessage(e) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (!valid) {
|
||||
this.$message.error('请填写完整信息')
|
||||
} else {
|
||||
this.form.required.type = this.material.type
|
||||
this.form.required.typeName = this.material.typeName
|
||||
this.form.required.departmentId = this.material.departmentId
|
||||
this.form.required.departmentName = this.material.departmentName
|
||||
this.form.required.userId = this.material.userId
|
||||
this.form.required.userName = this.material.userName
|
||||
this.form.required.deviceId = this.material.deviceId
|
||||
this.form.required.deviceName = this.material.deviceName
|
||||
this.form.required.id = this.material.id
|
||||
this.form.required.idRemark = this.material.idRemark
|
||||
this.form.remark = this.material.remark
|
||||
|
||||
requestFN(
|
||||
'/dingWei/saveOrUpdateMap', { data: JSON.stringify(this.form) }
|
||||
).then((data) => {
|
||||
if (data.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.handleClose()
|
||||
this.$emit('refresh')
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
}).catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getPeopleList(e) {
|
||||
this.material.departmentName = e.name
|
||||
requestFN(
|
||||
'/user/listAll',
|
||||
{
|
||||
DEPARTMENT_ID: e.id
|
||||
}
|
||||
).then((data) => {
|
||||
this.dic.userList = data.userList
|
||||
this.material.userInfo = ''
|
||||
}).catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
chooseUser(e) {
|
||||
const entity = JSON.parse(e)
|
||||
this.material.userId = entity.USER_ID
|
||||
this.material.userName = entity.NAME
|
||||
},
|
||||
handleClose() {
|
||||
this.form = {
|
||||
STATUS: '',
|
||||
APPOINT_DEPARTMENT_ID: null,
|
||||
APPOINT_DEPARTMENT_NAME: '',
|
||||
APPOINT_USER_ID: '',
|
||||
APPOINT_USER_NAME: '',
|
||||
OPINION: '',
|
||||
user: '',
|
||||
list: [],
|
||||
tm: new Date().getTime()
|
||||
}
|
||||
this.visible = false
|
||||
},
|
||||
beforeClose() {
|
||||
this.visible = false
|
||||
this.form = {
|
||||
STATUS: '',
|
||||
APPOINT_DEPARTMENT_ID: null,
|
||||
APPOINT_DEPARTMENT_NAME: '',
|
||||
APPOINT_USER_ID: '',
|
||||
APPOINT_USER_NAME: '',
|
||||
OPINION: '',
|
||||
user: '',
|
||||
list: [],
|
||||
tm: new Date().getTime()
|
||||
}
|
||||
},
|
||||
saveInfo(e) {
|
||||
const info = JSON.parse(e)
|
||||
this.material.type = info.value
|
||||
this.material.typeName = info.name
|
||||
},
|
||||
getDict() {
|
||||
requestFN('dingWei/getDictionary').then((data) => {
|
||||
this.dic.alarmStatus = JSON.parse(data.AlarmStatus)
|
||||
this.dic.logType = JSON.parse(data.LogType)
|
||||
this.dic.mapType = JSON.parse(data.MapType)
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
getDepartmentTree() {
|
||||
return new Promise(resolve => {
|
||||
requestFN(
|
||||
'/department/listTree',
|
||||
).then((data) => {
|
||||
this.dic.deptList = this.removeEmptyChildren(JSON.parse(data.zTreeNodes))
|
||||
resolve(true)
|
||||
}).catch((e) => {
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
|
@ -58,6 +58,7 @@
|
|||
</div>
|
||||
<pagination :total="listQuery.total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/>
|
||||
</div>
|
||||
<info ref="info" @flush="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -65,10 +66,11 @@
|
|||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
||||
import { requestFN } from '@/utils/request'
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
import info from './info.vue'
|
||||
import vueQr from 'vue-qr'
|
||||
|
||||
export default {
|
||||
components: { Pagination, vueQr },
|
||||
components: { Pagination, vueQr, info },
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
|
@ -93,13 +95,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
handleSelectWithDifferentStatus(row, rowIndex) {
|
||||
if (row.STATUS === 0) {
|
||||
// 不禁用
|
||||
return true
|
||||
} else {
|
||||
// 禁用
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
getQuery() {
|
||||
if (this.$refs.multipleTable) {
|
||||
|
@ -128,30 +124,7 @@ export default {
|
|||
})
|
||||
},
|
||||
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)
|
||||
this.$refs.info.init()
|
||||
},
|
||||
hasButton() {
|
||||
var keys = 'trainingbatch:add,trainingbatch:del,trainingbatch:edit,fhSms,email,fromExcel,toExcel'
|
||||
|
|
Loading…
Reference in New Issue