add: 班组对应人员、人员对应设备
This commit is contained in:
@@ -1,144 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.user_name === ''">
|
||||
<div class="my-code">点击查看设备详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length < 1"
|
||||
@click="deleteRows(crud.selections)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="device_code" label="设备编码"/>
|
||||
<el-table-column prop="device_name" label="设备名称" :min-width="180" show-overflow-tooltip/>
|
||||
<el-table-column prop="workprocedure_name" label="所属工序" :min-width="180" show-overflow-tooltip/>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:show-overflow-tooltip="true"
|
||||
:prop="item.prop"
|
||||
:width="item.width"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
import CRUD, {header, presenter, form} from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
|
||||
const defaultForm = {
|
||||
user_id: null,
|
||||
user_name: null,
|
||||
team_person_device_id: null,
|
||||
jockey_id: null,
|
||||
device_id: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'DevicesDialog',
|
||||
components: {pagination, crudOperation},
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '设备详情',
|
||||
url: 'api/personcorrdevice/getDeviceByPerson',
|
||||
idField: 'team_person_device_id',
|
||||
query: {user_id: '', user_name: ''},
|
||||
sort: ['update_time,asc'],
|
||||
crudMethod: {...crudPersoncorrdevice},
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(function() {
|
||||
return Object.assign({ person: { user_id: this.query.user_id }}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
materType: '',
|
||||
openParam: {},
|
||||
tableLabel: [],
|
||||
permission: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.getHeader()
|
||||
return true
|
||||
},
|
||||
deleteRows(data) {
|
||||
this.$confirm('此操作将删除"' + data.length + '"条信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPersoncorrdevice.deleteRow({ user_id: this.query.user_id, rows: data }).then(res => {
|
||||
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
getHeader(workprocedure_id) {
|
||||
crudPersoncorrdevice.getHeader({user_id: this.query.user_id}).then(res => {
|
||||
this.tableLabel = res.newArray
|
||||
})
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,15 +18,6 @@
|
||||
style="width: 220px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<label class="el-form-item-label">所属工序</label>
|
||||
<el-select v-model="query.workprocedure_id" filterable clearable size="small" placeholder="所属工序" class="filter-item" style="width: 220px" @change="changeHeader(query.search, query.workprocedure_id)">
|
||||
<el-option
|
||||
v-for="item in workList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
|
||||
<!--表格渲染-->
|
||||
@@ -40,25 +31,20 @@
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_name" label="设备名称" />
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:show-overflow-tooltip="true"
|
||||
:prop="item.prop"
|
||||
:width="item.width"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
@@ -70,34 +56,25 @@ import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
import crudDevice from '@/api/wms/pdm/device'
|
||||
|
||||
export default {
|
||||
name: 'SelectDeviceDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '设备选择', url: 'api/device', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
return CRUD({ title: '设备选择', url: 'api/device', crudMethod: { ...crudDevice }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
user_id: '',
|
||||
tableData: [],
|
||||
workList: [],
|
||||
tableLabel: []
|
||||
tableRadio: null,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -109,72 +86,32 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.getWorkprocedure()
|
||||
this.getDeviceIdByUserId(this.user_id)
|
||||
},
|
||||
setForm(user_id) {
|
||||
this.user_id = user_id
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.tableData.forEach(person => {
|
||||
if (Number(row.device_id) === Number(person.device_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
if (this.tableRadio === null) {
|
||||
this.$message('至少选择一条设备信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudPersoncorrdevice.addDevices({ user_id: this.user_id, devices: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
},
|
||||
changeHeader(search, workprocedure_id) {
|
||||
this.getHeader(search,workprocedure_id)
|
||||
this.crud.toQuery()
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.getHeader(this.query.search, this.query.workprocedure_id)
|
||||
return true
|
||||
},
|
||||
getWorkprocedure() {
|
||||
crudDevice.getWorkprocedure().then(res => {
|
||||
this.workList = res
|
||||
})
|
||||
},
|
||||
getHeader(search, workprocedure_id) {
|
||||
crudDevice.getItemByDeviceId({ search: search, workprocedure_id: workprocedure_id }).then(res => {
|
||||
this.tableLabel = res.newArray
|
||||
})
|
||||
},
|
||||
getDeviceIdByUserId(user_id) {
|
||||
crudPersoncorrdevice.getDeviceIdByUserId({ user_id: user_id }).then(res => {
|
||||
this.tableData = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="人员选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="名称或邮箱"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nickName" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码"/>
|
||||
<el-table-column prop="email" label="邮箱" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
|
||||
export default {
|
||||
name: 'SelectPeersonDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员信息', url: 'api/users', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
user_id: '',
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
setForm(user_id) {
|
||||
this.user_id = user_id
|
||||
},
|
||||
setData(data) {
|
||||
this.tableData = data
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
console.log(this.tableData)
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.tableData.forEach(person => {
|
||||
if (row.id === Number(person.jockey_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
this.$message('至少选择一条人员信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudPersoncorrdevice.addPersons({ persons: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
152
mes/qd/src/views/wms/mps/personcorrdevice/dictDetail.vue
Normal file
152
mes/qd/src/views/wms/mps/personcorrdevice/dictDetail.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.user_id === ''">
|
||||
<div class="my-code">点击查看设备详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.label"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="输入字典标签查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="设备编码" prop="device_code">
|
||||
<template scope="scope">
|
||||
<el-input v-model="form.device_code" disabled style="width: 250px;" clearable >
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryDevice(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column label="所属人员" min-width="100" show-overflow-tooltip>
|
||||
{{ query.person_name }}
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编码" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
v-permission="['admin','dict:edit','dict:del']"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="115px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<SelectDeviceDialog ref="selectDeviceDialog" :dialog-show.sync="deviceShow" @tableChanged3="tableChanged3" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
import CRUD, { form, header, presenter } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import SelectDeviceDialog from './SelectDeviceDialog'
|
||||
|
||||
const defaultForm = {
|
||||
device_code: null
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { pagination, rrOperation, udOperation, SelectDeviceDialog },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '设备详情',
|
||||
url: 'api/personcorrdevice/device',
|
||||
query: { code: '' },
|
||||
idField: 'person_id',
|
||||
sort: ['person_id,asc', 'person_id,desc'],
|
||||
crudMethod: { ...crudPersoncorrdevice },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [
|
||||
presenter(),
|
||||
header(),
|
||||
form(function() {
|
||||
return Object.assign({}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
dictId: null,
|
||||
deviceShow: false,
|
||||
rules: {
|
||||
device_code: [
|
||||
{ required: true, message: '请输入设备号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryDevice() {
|
||||
this.deviceShow = true
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.form.device_code = row.device_code
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-input-number .el-input__inner {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 班组列表-->
|
||||
<!-- 字典列表 -->
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-col :xs="13" :sm="13" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.search" clearable size="small" placeholder="输入人员名称或者电话" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-input v-model="query.username" clearable size="mini" placeholder="输入人员名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
@@ -18,118 +18,119 @@
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nick_name" label="昵称" />
|
||||
<el-table-column prop="person_name" label="名称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addDevice(scope.row)">添加设备</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 物料详情列表 -->
|
||||
<el-col :xs="24" :sm="24" :md="11" :lg="11" :xl="11">
|
||||
<!-- 字典详情列表 -->
|
||||
<el-col :xs="11" :sm="11" :md="11" :lg="11" :xl="11">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>设备详情</span>
|
||||
<el-button
|
||||
v-if="this.rowDtl !== null"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
style="float: right;padding: 4px 10px"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="$refs.dictDetail && $refs.dictDetail.crud.toAdd()"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
<DevicesDialog ref="devicesDialog" :permission="permission" />
|
||||
<dictDetail ref="dictDetail" :permission="permission" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<SelectPeersonDialog ref="selectPeersonDialog" :dialog-show.sync="selectPeersonDialog" @tableChanged3="tableChanged3" />
|
||||
<SelectDeviceDialog ref="selectDeviceDialog" :dialog-show.sync="selectDeviceDialog" @tableChanged3="tableChanged3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import dictDetail from './dictDetail.vue'
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
|
||||
import CRUD, { presenter, header, form } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DevicesDialog from './DevicesDialog'
|
||||
import SelectPeersonDialog from './SelectPeersonDialog'
|
||||
import SelectDeviceDialog from './SelectDeviceDialog'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
|
||||
const defaultForm = {}
|
||||
|
||||
const defaultForm = { team_person_device_id: null, jockey_id: null, device_id: null, user_id: null, user_name: null }
|
||||
export default {
|
||||
name: 'Personcorrdevice',
|
||||
components: { pagination, crudOperation, rrOperation, DevicesDialog, SelectPeersonDialog, SelectDeviceDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
name: 'Dict',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员设备维护', url: 'api/personcorrdevice', idField: 'jockey_id', sort: 'team_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudPersoncorrdevice }})
|
||||
return [
|
||||
CRUD({
|
||||
title: '人员对应设备',
|
||||
url: 'api/personcorrdevice',
|
||||
idField: 'jockey_id',
|
||||
crudMethod: { ...crudPersoncorrdevice },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
selectPeersonDialog: false,
|
||||
selectDeviceDialog: false,
|
||||
permission: {},
|
||||
rowDtl: null,
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '字典名称' },
|
||||
{ key: 'description', display_name: '描述' }
|
||||
],
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
addDevice(row) {
|
||||
this.$refs.selectDeviceDialog.setForm(row.user_id)
|
||||
this.selectDeviceDialog = true
|
||||
this.$refs.selectDeviceDialog.crud.toQuery()
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
checkPermission,
|
||||
// 获取数据前设置好接口地址
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.$refs.devicesDialog) {
|
||||
this.$refs.devicesDialog.query.user_name = ''
|
||||
if (this.$refs.dictDetail) {
|
||||
this.$refs.dictDetail.query.user_id = ''
|
||||
this.rowDtl = null
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
return true
|
||||
},
|
||||
/** 新建 - 之前 */
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
this.$refs.selectPeersonDialog.setData(this.crud.data)
|
||||
this.selectPeersonDialog = true
|
||||
this.$refs.selectPeersonDialog.crud.toQuery()
|
||||
// return true
|
||||
},
|
||||
// 选中字典后,设置字典详情数据
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.$refs.devicesDialog.query.user_name = val.username
|
||||
this.$refs.devicesDialog.query.user_id = val.user_id
|
||||
this.$refs.devicesDialog.crud.toQuery()
|
||||
this.rowDtl = val
|
||||
this.$refs.dictDetail.query.user_id = val.user_id
|
||||
this.$refs.dictDetail.query.person_name = val.person_name
|
||||
this.$refs.dictDetail.form.user_id = val.user_id
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
this.$refs.devicesDialog.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.team_name === ''">
|
||||
<div class="my-code">点击查看人员详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" label="所属班组id">
|
||||
{{ query.team_id }}
|
||||
</el-table-column>
|
||||
<el-table-column label="所属班组">
|
||||
{{ query.team_name }}
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nick_name" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter, form } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
// import crudStructrelamaterial from '@/api/wms/st/basedata/structrelamaterial'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: null,
|
||||
material_name: null,
|
||||
team_id: null,
|
||||
team_code: null,
|
||||
team_name: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'PersonDialog',
|
||||
components: { pagination, crudOperation },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '人员详情',
|
||||
url: 'api/teamcorrperson',
|
||||
idField: 'team_person_id',
|
||||
query: { team_id: '', team_name: '' },
|
||||
sort: ['update_time,asc'],
|
||||
crudMethod: { ...crudTeamcorrperson },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: true,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(function() {
|
||||
return Object.assign({ team: { team_id: this.query.team_id }}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
materType: '',
|
||||
openParam: {},
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
material_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.beforeDelete](row) {
|
||||
return true
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
128
mes/qd/src/views/wms/mps/teamcorrperson/SelectDeviceDialog.vue
Normal file
128
mes/qd/src/views/wms/mps/teamcorrperson/SelectDeviceDialog.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="设备选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="输入账号或者名称"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<rrOperation :crud="crud" />
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;margin-top: 15px"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="person_name" label="人员名称" />
|
||||
<el-table-column prop="username" label="账号编码" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="电话" />
|
||||
<el-table-column prop="email" label="邮箱" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudUser from '@/views/system/user/user'
|
||||
|
||||
export default {
|
||||
name: 'SelectDeviceDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员选择', url: 'api/users', crudMethod: { ...crudUser }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableRadio: null,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
setForm(user_id) {
|
||||
this.user_id = user_id
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.tableRadio === null) {
|
||||
this.$message('至少选择一条设备信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="人员选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="名称或邮箱"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nickName" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
|
||||
export default {
|
||||
name: 'SelectPeersonDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员信息', url: 'api/users', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
team_id: '',
|
||||
personIds: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudTeamcorrperson.getPersonIdByTeamId({ team_id: this.team_id }).then(res => {
|
||||
this.personIds = res
|
||||
})
|
||||
},
|
||||
setForm(team_id) {
|
||||
this.team_id = team_id
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.personIds.forEach(person => {
|
||||
if (row.id === Number(person.jockey_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
this.$message('至少选择一条人员信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudTeamcorrperson.addPersons({ team_id: this.team_id, persons: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
157
mes/qd/src/views/wms/mps/teamcorrperson/dictDetail.vue
Normal file
157
mes/qd/src/views/wms/mps/teamcorrperson/dictDetail.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.team_id === ''">
|
||||
<div class="my-code">点击查看设备详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.label"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="输入字典标签查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="人员编码" prop="user_name">
|
||||
<template scope="scope">
|
||||
<el-input v-model="form.user_name" disabled style="width: 250px;" clearable >
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryDevice(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column label="所属班组" min-width="100" show-overflow-tooltip>
|
||||
{{ query.team_name }}
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="人员编码" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="person_name" label="人员名称" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="phone" label="电话" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="email" label="邮箱" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
v-permission="['admin','dict:edit','dict:del']"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="115px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<SelectDeviceDialog ref="selectDeviceDialog" :dialog-show.sync="userShow" @tableChanged3="tableChanged3" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
import CRUD, { form, header, presenter } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import SelectDeviceDialog from './SelectDeviceDialog'
|
||||
|
||||
const defaultForm = {
|
||||
user_id: null,
|
||||
user_name: null
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { pagination, rrOperation, udOperation, SelectDeviceDialog },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '人员详情',
|
||||
url: 'api/pdmBiTeamcorrperson/queryUser',
|
||||
query: { code: '' },
|
||||
idField: 'team_person_id',
|
||||
sort: ['team_person_id,asc', 'team_person_id,desc'],
|
||||
crudMethod: { ...crudTeamcorrperson },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [
|
||||
presenter(),
|
||||
header(),
|
||||
form(function() {
|
||||
return Object.assign({}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
dictId: null,
|
||||
userShow: false,
|
||||
rules: {
|
||||
user_name: [
|
||||
{ required: true, message: '请选择人员', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryDevice() {
|
||||
this.userShow = true
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.form.user_name = row.person_name
|
||||
this.form.user_id = row.user_id
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-input-number .el-input__inner {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
@@ -1,208 +1,133 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 班组列表-->
|
||||
<!-- 字典列表 -->
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-col :xs="13" :sm="13" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.search" clearable size="small" placeholder="输入编码或者名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-input v-model="query.team_code" clearable size="mini" placeholder="输班组编码名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="班组编码" prop="team_code">
|
||||
<el-input v-model="form.team_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="team_name">
|
||||
<el-input v-model="form.team_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="所属班制">
|
||||
<el-select v-model="form.classsystem_id" filterable clearable class="filter-item" style="width: 370px">
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
:key="item.classsystem_id"
|
||||
:label="item.classsystem_name"
|
||||
:value="item.classsystem_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column prop="team_code" label="班组编码" />
|
||||
<el-table-column prop="team_name" label="班组名称" />
|
||||
<el-table-column prop="is_active" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_active(scope.row.is_active)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_active)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人姓名" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addPerson(scope.row)">添加人员</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 物料详情列表 -->
|
||||
<el-col :xs="24" :sm="24" :md="11" :lg="11" :xl="11">
|
||||
<!-- 字典详情列表 -->
|
||||
<el-col :xs="11" :sm="11" :md="11" :lg="11" :xl="11">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>人员详情</span>
|
||||
<span>班组详情</span>
|
||||
<el-button
|
||||
v-if="this.rowDtl !== null"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
style="float: right;padding: 4px 10px"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="$refs.dictDetail && $refs.dictDetail.crud.toAdd()"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
<PersonDialog ref="personDialog" :permission="permission" />
|
||||
<dictDetail ref="dictDetail" :permission="permission" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<SelectPeersonDialog ref="selectPeersonDialog" :dialog-show.sync="selectPeersonDialog" @tableChanged3="tableChanged3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import checkPermission from '@/utils/permission'
|
||||
import dictDetail from './dictDetail.vue'
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
|
||||
import CRUD, { presenter, header, form } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudWorkteam from "@/api/wms/mps/workteam"
|
||||
import PersonDialog from './PersonDialog'
|
||||
import SelectPeersonDialog from './SelectPeersonDialog'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
|
||||
const defaultForm = {}
|
||||
|
||||
const defaultForm = { team_id: null, team_code: null, team_name: null, classsystem_id: null, remark: null, is_active: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, sysdeptid: null, syscompanyid: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Teamcorrperson',
|
||||
components: { pagination, crudOperation, rrOperation, PersonDialog, SelectPeersonDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
name: 'Dict',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return CRUD({ title: '班组', url: 'api/workteam', idField: 'team_id', sort: 'team_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudWorkteam }})
|
||||
return [
|
||||
CRUD({
|
||||
title: '班组对应人员',
|
||||
url: 'api/pdmBiTeamcorrperson',
|
||||
idField: 'team_id',
|
||||
crudMethod: { ...crudTeamcorrperson },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
selectPeersonDialog: false,
|
||||
permission: {},
|
||||
classList: [],
|
||||
personIds: [],
|
||||
rowDtl: null,
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '字典名称' },
|
||||
{ key: 'description', display_name: '描述' }
|
||||
],
|
||||
rules: {
|
||||
team_code: [
|
||||
{ required: true, message: '班组编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
team_name: [
|
||||
{ required: true, message: '班组名称不能为空', trigger: 'blur' }
|
||||
code: [
|
||||
{ required: true, message: '请选择人员', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getClasssystem()
|
||||
},
|
||||
methods: {
|
||||
addPerson(row) {
|
||||
this.$refs.selectPeersonDialog.setForm(row.team_id)
|
||||
this.selectPeersonDialog = true
|
||||
this.$refs.selectPeersonDialog.crud.toQuery()
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
checkPermission,
|
||||
// 获取数据前设置好接口地址
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.$refs.personDialog) {
|
||||
this.$refs.personDialog.query.team_name = ''
|
||||
if (this.$refs.dictDetail) {
|
||||
this.$refs.dictDetail.query.team_id = ''
|
||||
this.rowDtl = null
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
return true
|
||||
},
|
||||
/** 新建 - 之前 */
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
// return true
|
||||
},
|
||||
// 选中字典后,设置字典详情数据
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.$refs.personDialog.query.team_name = val.team_name
|
||||
this.$refs.personDialog.query.team_id = val.team_id
|
||||
this.$refs.personDialog.crud.toQuery()
|
||||
this.rowDtl = val
|
||||
this.$refs.dictDetail.query.team_id = val.team_id
|
||||
this.$refs.dictDetail.query.team_name = val.team_name
|
||||
this.$refs.dictDetail.form.team_id = val.team_id
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
this.$refs.personDialog.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
},
|
||||
// 改变状态
|
||||
format_is_active(is_active) {
|
||||
return is_active === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudWorkteam.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_active = !data.is_active
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
getClasssystem() {
|
||||
crudWorkteam.getClasssystem().then(res => {
|
||||
this.classList = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
27
mes/qd/src/views/wms/mps/teamcorrperson/teamcorrperson.js
Normal file
27
mes/qd/src/views/wms/mps/teamcorrperson/teamcorrperson.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/pdmBiTeamcorrperson',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/pdmBiTeamcorrperson/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/pdmBiTeamcorrperson',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user