rev:1. 保养/点检/润滑:添加保养/点检/润滑设备与人员对应关系2. 保养/点检/润滑/维修:新增单据页面,添加人员一行3.创建设备报修单时:添加故障分类标签选择4.设备报修允许点击报修单单号,查看详情信息5. 创建设备报修单时添加图片上传功能;查看跟修改时显示图片:只支持图片格式
This commit is contained in:
@@ -49,6 +49,24 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="润滑人" prop="update_optname">
|
||||
<el-select
|
||||
v-model="form.update_optname"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="请选择/搜索"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in optNameList"
|
||||
:label="item.person_name"
|
||||
:value="item.person_name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -141,6 +159,7 @@ import crudDevicelubricatemst from '@/views/wms/device_manage/lubricate/devicelu
|
||||
import DeviceDialog from '@/views/wms/device_manage/lubricate/devicelubricateplan/DeviceDialog'
|
||||
import ItemDialog from '@/views/wms/device_manage/lubricate/devicelubricateplan/ItemDialog'
|
||||
import CRUD, { form, crud } from '@crud/crud'
|
||||
import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/devicerepairmst'
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
@@ -161,6 +180,7 @@ export default {
|
||||
dialogVisible: false,
|
||||
deviceDialog: false,
|
||||
itemDialog: false,
|
||||
optNameList: [],
|
||||
rules: {
|
||||
plan_start_date: [
|
||||
{ required: true, message: '计划开始日期不能为空', trigger: 'blur' }
|
||||
@@ -181,6 +201,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudDevicerepairmst.getUser({}).then(res => {
|
||||
this.optNameList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
const arr = this.form.tableData
|
||||
|
||||
@@ -220,6 +220,9 @@ export default {
|
||||
if (data.invstatus !== '01') {
|
||||
return this.crud.notify('只能对生成状态的单据提交', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
if (data.update_optname === '') {
|
||||
return this.crud.notify('润滑人不允许为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudDevicelubricatemst.putIn(data).then(res => {
|
||||
this.crud.notify('提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
|
||||
@@ -77,8 +77,24 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="crud.status.edit !== 0 || crud.status.view !== 0 " label="维修人" prop="update_optname">
|
||||
<!--<el-form-item v-show="crud.status.edit !== 0 || crud.status.view !== 0 " label="维修人" prop="update_optname">
|
||||
<el-input v-show="crud.status.edit !== 0 || crud.status.view !== 0 " v-model.trim="form.update_optname" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>-->
|
||||
<el-form-item label="维修人" prop="update_optname">
|
||||
<el-select
|
||||
v-model="form.update_optname"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="请选择/搜索"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in optNameList"
|
||||
:label="item.person_name"
|
||||
:value="item.person_name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="crud.status.edit === 1" label="预计修复时间(小时)" prop="estimaterepair_times">
|
||||
<el-input-number v-show="crud.status.edit === 1" v-model="form.estimaterepair_times" :disabled="crud.status.view > 0" :precision="1" :min="0" :max="999" style="width: 200px" :controls="false" />
|
||||
@@ -185,6 +201,7 @@ export default {
|
||||
dialogVisible: false,
|
||||
deviceDialog: false,
|
||||
itemDialog: false,
|
||||
optNameList: [],
|
||||
rules: {
|
||||
plan_start_date: [
|
||||
{ required: true, message: '计划维修日期不能为空', trigger: 'blur' }
|
||||
@@ -208,6 +225,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudDevicerepairmst.getUser({}).then(res => {
|
||||
this.optNameList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
/* const arr = this.form.tableData
|
||||
|
||||
@@ -160,4 +160,12 @@ export function getIosMst(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { findByCode, add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive, getDeviceInfo, getIosMst }
|
||||
export function getUser(data) {
|
||||
return request({
|
||||
url: 'api/devicerepairmst/getUser',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { findByCode, add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive, getDeviceInfo, getIosMst, getUser }
|
||||
|
||||
@@ -34,6 +34,16 @@
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="故障标签">
|
||||
<treeselect
|
||||
v-model="query.faultclass_type_id"
|
||||
:load-options="loadClass"
|
||||
:options="classes2"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
@@ -62,6 +72,7 @@
|
||||
<el-table-column prop="class_name" label="设备类别" />
|
||||
<el-table-column prop="device_faultclass_code" label="设备故障分类编码" />
|
||||
<el-table-column prop="device_faultclass_name" label="设备故障分类名称" />
|
||||
<el-table-column prop="class_name_faultclass" label="故障类型" />
|
||||
<el-table-column prop="solutions" label="解决措施" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
@@ -115,6 +126,7 @@ export default {
|
||||
tableRadio: null,
|
||||
checkrow: null,
|
||||
classes: [],
|
||||
classes2: [],
|
||||
class_idStr: null,
|
||||
materOpt_code: '23',
|
||||
materOpt_code_2: '26',
|
||||
@@ -138,6 +150,7 @@ export default {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = this.class_idStr
|
||||
this.queryClassId()
|
||||
this.queryClassId2()
|
||||
})
|
||||
const data = {
|
||||
'materOpt_code': this.materOpt_code_2
|
||||
@@ -215,6 +228,19 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
queryClassId2() {
|
||||
const param = {
|
||||
'class_idStr': '3'
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes2 = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
getSubTypes(id) {
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
const date = res.content
|
||||
@@ -222,6 +248,13 @@ export default {
|
||||
this.classes = date
|
||||
})
|
||||
},
|
||||
getSubTypes2(id) {
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
const date = res.content
|
||||
this.buildClass(date)
|
||||
this.classes2 = date
|
||||
})
|
||||
},
|
||||
buildClass(classes) {
|
||||
classes.forEach(data => {
|
||||
if (data.children) {
|
||||
|
||||
@@ -94,8 +94,19 @@
|
||||
>
|
||||
不维修
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-upload"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="uploadImage"
|
||||
>
|
||||
上传图片
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0 || crud.status.view > 0" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@@ -143,7 +154,7 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班组配合人:" prop="product_person_name">
|
||||
<el-input v-model.trim="form.product_person_name" style="width: 200px;" />
|
||||
<el-input v-model.trim="form.product_person_name" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -151,7 +162,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="故障描述:" prop="fault_desc">
|
||||
<el-input v-model.trim="form.fault_desc" style="width: 650px;" rows="2" type="textarea" />
|
||||
<el-input v-model.trim="form.fault_desc" style="width: 650px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -159,7 +170,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input v-model.trim="form.remark" style="width: 650px;" rows="2" type="textarea" />
|
||||
<el-input v-model.trim="form.remark" style="width: 650px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -172,12 +183,16 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" min-width="35" />
|
||||
<el-table-column fixed="left" prop="request_code" min-width="140" label="报修单号" show-overflow-tooltip />
|
||||
<!-- <el-table-column fixed="left" prop="path" label="故障图片" min-width="90">
|
||||
<el-table-column fixed="left" prop="path" label="故障图片" min-width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" icon="el-icon-folder-opened" circle @click="Picconfirm(scope.$index, scope.row)" />
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
</el-table-column>
|
||||
<el-table-column fixed="left" prop="request_code" min-width="140" label="报修单号" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.request_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编码" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="extend_code" label="设备自编码" min-width="100" show-overflow-tooltip />
|
||||
@@ -209,6 +224,37 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
:headers="headers"
|
||||
class="upload-demo"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
:action="baseApi +'/api/devicerepairrequest/pictures/'+request_id"
|
||||
multiple
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="handleExceed"
|
||||
:on-error="handleError"
|
||||
:on-success="handleSuccess"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传不超过50MB的文件!</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="dialogVisible = false">取消</el-button>
|
||||
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<PicDialog ref="child" :dialog-show.sync="PicDialog" />
|
||||
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged2" />
|
||||
<FaultDialog :dialog-show.sync="faultDialog" :is-single="true" :open-param="openParam" @tableChanged="tableChanged" />
|
||||
@@ -232,6 +278,7 @@ import DeviceDialog from '@/views/wms/device_manage/repair/devicevprs/DeviceDial
|
||||
import FaultDialog from '@/views/wms/device_manage/repair/devicevprs/FaultDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudDept from '@/views/system/dept/dept'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
const defaultForm = { material_type_id: null, product_person_name: null, device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
|
||||
export default {
|
||||
@@ -258,13 +305,16 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
openParam: null,
|
||||
request_id: '',
|
||||
deviceDialog: false,
|
||||
faultDialog: false,
|
||||
dialogVisible: false,
|
||||
classes: [],
|
||||
class_idStr: null,
|
||||
depts: [],
|
||||
checkrows: [],
|
||||
materOpt_code: '23',
|
||||
headers: { 'Authorization': getToken() },
|
||||
statusList: [
|
||||
{ 'label': '生成', 'value': '01' },
|
||||
{ 'label': '维修中', 'value': '02' },
|
||||
@@ -293,9 +343,10 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
user: 'user'
|
||||
})
|
||||
...mapGetters([
|
||||
'baseApi',
|
||||
'fileUploadApi'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
const param = {
|
||||
@@ -417,7 +468,6 @@ export default {
|
||||
})
|
||||
},
|
||||
Picconfirm(index, row) {
|
||||
|
||||
this.$refs.child.setForm(row.request_code)
|
||||
this.PicDialog = true
|
||||
},
|
||||
@@ -474,6 +524,49 @@ export default {
|
||||
data.children = null
|
||||
}
|
||||
})
|
||||
},
|
||||
uploadImage() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
const data = _selectData[0]
|
||||
this.request_id = data.request_id
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
beforeUpload(file) {
|
||||
let isLt2M = true
|
||||
isLt2M = file.size / 1024 / 1024 < 50
|
||||
if (!isLt2M) {
|
||||
this.loading = false
|
||||
this.$message.error('上传文件大小不能超过 50MB!')
|
||||
}
|
||||
return isLt2M
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.crud.notify('当前限制最多能选择 1 个文件', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
handleSuccess(files, fileList) {
|
||||
this.crud.notify('上传成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$refs.upload.clearFiles()
|
||||
this.dialogVisible = false
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
submitUpload() {
|
||||
const flag = this.$refs.upload.submit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,25 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<el-form-item label="点检人" prop="update_optname">
|
||||
<el-select
|
||||
v-model="form.update_optname"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="请选择/搜索"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in optNameList"
|
||||
:label="item.person_name"
|
||||
:value="item.person_name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -141,6 +160,7 @@ import crudDevicesportcheckmst from '@/views/wms/device_manage/sportcheck/device
|
||||
import DeviceDialog from '@/views/wms/device_manage/sportcheck/devicesportcheckplan/DeviceDialog'
|
||||
import ItemDialog from '@/views/wms/device_manage/sportcheck/devicesportcheckplan/ItemDialog'
|
||||
import CRUD, { form, crud } from '@crud/crud'
|
||||
import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/devicerepairmst'
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
@@ -161,6 +181,7 @@ export default {
|
||||
dialogVisible: false,
|
||||
deviceDialog: false,
|
||||
itemDialog: false,
|
||||
optNameList: [],
|
||||
rules: {
|
||||
plan_start_date: [
|
||||
{ required: true, message: '计划开始日期不能为空', trigger: 'blur' }
|
||||
@@ -181,6 +202,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudDevicerepairmst.getUser({}).then(res => {
|
||||
this.optNameList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
const arr = this.form.tableData
|
||||
|
||||
@@ -220,6 +220,9 @@ export default {
|
||||
if (data.invstatus !== '01') {
|
||||
return this.crud.notify('只能对生成状态的单据提交', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
if (data.update_optname === '') {
|
||||
return this.crud.notify('点检人不允许为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudDevicesportcheckmst.putIn(data).then(res => {
|
||||
this.crud.notify('提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
|
||||
@@ -49,6 +49,25 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<el-form-item label="保养人" prop="update_optname">
|
||||
<el-select
|
||||
v-model="form.update_optname"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="请选择/搜索"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in optNameList"
|
||||
:label="item.person_name"
|
||||
:value="item.person_name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -141,6 +160,7 @@ import crudDevicemaintenancemst from '@/views/wms/device_manage/upkeep/devicemai
|
||||
import DeviceDialog from '@/views/wms/device_manage/upkeep/devicemaintenanceplan/DeviceDialog'
|
||||
import ItemDialog from '@/views/wms/device_manage/upkeep/devicemaintenanceplan/ItemDialog'
|
||||
import CRUD, { form, crud } from '@crud/crud'
|
||||
import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/devicerepairmst'
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
@@ -161,6 +181,7 @@ export default {
|
||||
dialogVisible: false,
|
||||
deviceDialog: false,
|
||||
itemDialog: false,
|
||||
optNameList: [],
|
||||
rules: {
|
||||
plan_start_date: [
|
||||
{ required: true, message: '计划开始日期不能为空', trigger: 'blur' }
|
||||
@@ -181,6 +202,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudDevicerepairmst.getUser({}).then(res => {
|
||||
this.optNameList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
const arr = this.form.tableData
|
||||
|
||||
@@ -222,6 +222,9 @@ export default {
|
||||
if (data.invstatus !== '01') {
|
||||
return this.crud.notify('只能对生成状态的单据提交', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
if (data.update_optname === '') {
|
||||
return this.crud.notify('保养人不允许为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudDevicemaintenancemst.putIn(data).then(res => {
|
||||
this.crud.notify('提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
|
||||
@@ -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/lubripersondevice/lubripersondevice'
|
||||
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/embilubridevice/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/lubripersondevice/lubripersondevice'
|
||||
|
||||
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: 'Lubripersondevice',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '润滑人与设备档案维护',
|
||||
url: 'api/embilubridevice',
|
||||
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/embilubridevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/embilubridevice/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/embilubridevice',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addPersons(data) {
|
||||
return request({
|
||||
url: 'api/embilubridevice/addPersons',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getHeader(data) {
|
||||
return request({
|
||||
url: 'api/embilubridevice/getHeader',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDeviceIdByUserId(data) {
|
||||
return request({
|
||||
url: 'api/embilubridevice/getDeviceIdByUserId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addDevices(data) {
|
||||
return request({
|
||||
url: 'api/embilubridevice/addDevices',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRow(data) {
|
||||
return request({
|
||||
url: 'api/embilubridevice/deleteRow',
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, addPersons, getHeader, deleteRow, addDevices }
|
||||
@@ -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/sportpersondevice/sportpersondevice'
|
||||
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/embisportdevice/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/sportpersondevice/sportpersondevice'
|
||||
|
||||
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: 'Sportpersondevice',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '点检人与设备档案维护',
|
||||
url: 'api/embisportdevice',
|
||||
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/embisportdevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/embisportdevice/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/embisportdevice',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addPersons(data) {
|
||||
return request({
|
||||
url: 'api/embisportdevice/addPersons',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getHeader(data) {
|
||||
return request({
|
||||
url: 'api/embisportdevice/getHeader',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDeviceIdByUserId(data) {
|
||||
return request({
|
||||
url: 'api/embisportdevice/getDeviceIdByUserId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addDevices(data) {
|
||||
return request({
|
||||
url: 'api/embisportdevice/addDevices',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRow(data) {
|
||||
return request({
|
||||
url: 'api/embisportdevice/deleteRow',
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, addPersons, getHeader, deleteRow, addDevices }
|
||||
@@ -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/upkeeppersondevice/upkeeppersondevice'
|
||||
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/embiupkeepdevice/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/upkeeppersondevice/upkeeppersondevice'
|
||||
|
||||
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: 'Upkeeppersondevice',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '保养人与设备档案维护',
|
||||
url: 'api/embiupkeepdevice',
|
||||
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/embiupkeepdevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/embiupkeepdevice/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/embiupkeepdevice',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addPersons(data) {
|
||||
return request({
|
||||
url: 'api/embiupkeepdevice/addPersons',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getHeader(data) {
|
||||
return request({
|
||||
url: 'api/embiupkeepdevice/getHeader',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDeviceIdByUserId(data) {
|
||||
return request({
|
||||
url: 'api/embiupkeepdevice/getDeviceIdByUserId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addDevices(data) {
|
||||
return request({
|
||||
url: 'api/embiupkeepdevice/addDevices',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRow(data) {
|
||||
return request({
|
||||
url: 'api/embiupkeepdevice/deleteRow',
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, addPersons, getHeader, deleteRow, addDevices }
|
||||
Reference in New Issue
Block a user