add:维修人与设备档案关系菜单、日计划
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
<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.device_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入设备编码或名称"
|
||||
style="width: 220px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<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="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_name" 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 equipmentfile from '@/views/wms/device_manage/deviceFile/equipmentfile/equipmentfile'
|
||||
|
||||
export default {
|
||||
name: 'SelectDeviceDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '设备选择', url: 'api/equipmentfile', crudMethod: { ...equipmentfile }, 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>
|
||||
|
||||
@@ -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 '@/views/wms/masterdata_manage/em/repairpersondevice/repairpersondevice'
|
||||
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/embirepairdevice/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>
|
||||
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 字典列表 -->
|
||||
<el-row :gutter="10">
|
||||
<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.username" clearable size="mini" placeholder="输入人员名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column prop="username" 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>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 字典详情列表 -->
|
||||
<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>
|
||||
<dictDetail ref="dictDetail" :permission="permission" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import dictDetail from './dictDetail.vue'
|
||||
import crudPersoncorrdevice from '@/views/wms/masterdata_manage/em/repairpersondevice/repairpersondevice'
|
||||
|
||||
import CRUD, { presenter, header, form } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
|
||||
const defaultForm = {}
|
||||
|
||||
export default {
|
||||
name: 'Repairpersondevice',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '维修人与设备档案维护',
|
||||
url: 'api/embirepairdevice',
|
||||
idField: 'jockey_id',
|
||||
crudMethod: { ...crudPersoncorrdevice },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
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']
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
// 获取数据前设置好接口地址
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.$refs.dictDetail) {
|
||||
this.$refs.dictDetail.query.user_id = ''
|
||||
this.rowDtl = null
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 选中字典后,设置字典详情数据
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,67 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/embirepairdevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/embirepairdevice/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/embirepairdevice',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addPersons(data) {
|
||||
return request({
|
||||
url: 'api/embirepairdevice/addPersons',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getHeader(data) {
|
||||
return request({
|
||||
url: 'api/embirepairdevice/getHeader',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDeviceIdByUserId(data) {
|
||||
return request({
|
||||
url: 'api/embirepairdevice/getDeviceIdByUserId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addDevices(data) {
|
||||
return request({
|
||||
url: 'api/embirepairdevice/addDevices',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRow(data) {
|
||||
return request({
|
||||
url: 'api/embirepairdevice/deleteRow',
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, addPersons, getHeader, deleteRow, addDevices }
|
||||
Reference in New Issue
Block a user