增加考勤机管理接口调试
This commit is contained in:
parent
8e141943e1
commit
0f4440dfeb
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 获取工程和考勤机树形数据
|
||||
export function getProjectAndMacTreeAPI() {
|
||||
return request({
|
||||
url: '/system/attMacManage/tree',
|
||||
url: '/bmw/kqManager/getProKqjTree',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
|
@ -11,7 +11,7 @@ export function getProjectAndMacTreeAPI() {
|
|||
// 根据考勤机编号获取人员列表
|
||||
export function getPersonListByMacNoAPI(params) {
|
||||
return request({
|
||||
url: '/system/attMacManage/personList',
|
||||
url: '/bmw/kqManager/getWorkerByDeviceId',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
|
|
@ -20,17 +20,18 @@ export function getPersonListByMacNoAPI(params) {
|
|||
// 获取所有人员列表
|
||||
export function getAllPersonListAPI(params) {
|
||||
return request({
|
||||
url: '/system/attMacManage/allPersonList',
|
||||
url: '/bmw/kqManager/getProDeviceWorker',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除人员
|
||||
export function deletePersonAPI(id) {
|
||||
export function deletePersonAPI(data) {
|
||||
return request({
|
||||
url: '/system/attMacManage/deletePerson/' + id,
|
||||
url: '/bmw/kqManager/delWorkerByDevice/',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +47,7 @@ export function batchDeletePersonAPI(ids) {
|
|||
// 下发
|
||||
export function sendDownAPI(data) {
|
||||
return request({
|
||||
url: '/system/attMacManage/sendDown',
|
||||
url: '/bmw/kqManager/pushWorkerByDevice',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
|
|
@ -64,17 +65,17 @@ export function configAPI(data) {
|
|||
// 刷新
|
||||
export function refreshAPI(macNo) {
|
||||
return request({
|
||||
url: '/system/attMacManage/refresh',
|
||||
url: '/bmw/kqManager/refreshDevice',
|
||||
method: 'post',
|
||||
data: { macNo },
|
||||
data: { deviceCode: macNo },
|
||||
})
|
||||
}
|
||||
|
||||
// 重启
|
||||
export function restartAPI(macNo) {
|
||||
return request({
|
||||
url: '/system/attMacManage/restart',
|
||||
url: '/bmw/kqManager/restartDevice',
|
||||
method: 'post',
|
||||
data: { macNo },
|
||||
data: { deviceCode: macNo },
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export default {
|
|||
treeData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
label: 'name',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
@ -58,6 +58,7 @@ export default {
|
|||
async getTreeData() {
|
||||
try {
|
||||
const res = await getProjectAndMacTreeAPI()
|
||||
|
||||
if (res.code === 200) {
|
||||
this.treeData = res.data || []
|
||||
}
|
||||
|
|
@ -103,7 +104,7 @@ export default {
|
|||
// 树节点过滤
|
||||
filterNode(value, data) {
|
||||
if (!value) return true
|
||||
return data.label.indexOf(value) !== -1
|
||||
return data.name.indexOf(value) !== -1
|
||||
},
|
||||
// 树节点点击事件
|
||||
handleNodeClick(data) {
|
||||
|
|
|
|||
|
|
@ -1,75 +1,190 @@
|
|||
<template>
|
||||
<el-card class="table-card" shadow="hover">
|
||||
<div class="table-container">
|
||||
<TableModel
|
||||
:formLabel="formLabel"
|
||||
:columnsList="columnsList"
|
||||
:request-api="requestApi"
|
||||
:showOperation="true"
|
||||
:isSelectShow="true"
|
||||
:sendParams="sendParams"
|
||||
ref="tableRef"
|
||||
>
|
||||
<template slot="btn">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
:disabled="selectedData.length === 0"
|
||||
@click="handleBatchDelete"
|
||||
>
|
||||
批量删除
|
||||
<div>
|
||||
<el-card class="table-card" shadow="hover">
|
||||
<div class="table-container">
|
||||
<TableModel
|
||||
:formLabel="formLabel"
|
||||
:columnsList="columnsList"
|
||||
:request-api="requestApi"
|
||||
:showOperation="true"
|
||||
:isSelectShow="true"
|
||||
:sendParams="sendParams"
|
||||
ref="tableRef"
|
||||
>
|
||||
<template slot="btn">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
:disabled="selectedData.length === 0"
|
||||
@click="handleBatchDelete"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
@click="handleSendDown"
|
||||
>
|
||||
下发
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-setting"
|
||||
@click="handleConfig"
|
||||
>
|
||||
配置
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleRefresh"
|
||||
>
|
||||
刷新
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-switch-button"
|
||||
@click="handleRestart"
|
||||
>
|
||||
重启
|
||||
</el-button>
|
||||
</template>
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(data)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</TableModel>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 下发弹框 -->
|
||||
<DialogModel
|
||||
:dialogConfig="sendDownDialogConfig"
|
||||
@closeDialogOuter="handleCloseSendDownDialog"
|
||||
>
|
||||
<template slot="outerContent">
|
||||
<el-form
|
||||
ref="sendDownFormRef"
|
||||
:model="sendDownFormData"
|
||||
:rules="sendDownFormRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="选择人员:" prop="personIds">
|
||||
<el-select
|
||||
v-model="sendDownFormData.personIds"
|
||||
multiple
|
||||
filterable
|
||||
placeholder="请选择人员"
|
||||
style="width: 100%"
|
||||
:loading="personListLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in personList"
|
||||
:key="item.id"
|
||||
:label="`${item.name}(${item.idNumber})`"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="下发内容:" prop="content">
|
||||
<el-input
|
||||
v-model="sendDownFormData.content"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
placeholder="请输入下发内容"
|
||||
clearable
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row class="dialog-footer-btn">
|
||||
<el-button size="medium" @click="handleCloseSendDownDialog">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
size="medium"
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
@click="handleSendDown"
|
||||
@click="handleSendDownSubmit"
|
||||
>
|
||||
下发
|
||||
确定
|
||||
</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</DialogModel>
|
||||
|
||||
<!-- 配置弹框 -->
|
||||
<DialogModel
|
||||
:dialogConfig="configDialogConfig"
|
||||
@closeDialogOuter="handleCloseConfigDialog"
|
||||
>
|
||||
<template slot="outerContent">
|
||||
<el-form
|
||||
ref="configFormRef"
|
||||
:model="configFormData"
|
||||
:rules="configFormRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="选择人员:" prop="personIds">
|
||||
<el-select
|
||||
v-model="configFormData.personIds"
|
||||
multiple
|
||||
filterable
|
||||
placeholder="请选择人员"
|
||||
style="width: 100%"
|
||||
:loading="personListLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in personList"
|
||||
:key="item.id"
|
||||
:label="`${item.name}(${item.idNumber})`"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="配置项:" prop="configItem">
|
||||
<el-input
|
||||
v-model="configFormData.configItem"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
placeholder="请输入配置项"
|
||||
clearable
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row class="dialog-footer-btn">
|
||||
<el-button size="medium" @click="handleCloseConfigDialog">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
size="medium"
|
||||
type="primary"
|
||||
icon="el-icon-setting"
|
||||
@click="handleConfig"
|
||||
@click="handleConfigSubmit"
|
||||
>
|
||||
配置
|
||||
确定
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleRefresh"
|
||||
>
|
||||
刷新
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-switch-button"
|
||||
@click="handleRestart"
|
||||
>
|
||||
重启
|
||||
</el-button>
|
||||
</template>
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(data)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</TableModel>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-row>
|
||||
</template>
|
||||
</DialogModel>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableModel from '@/components/TableModel'
|
||||
import DialogModel from '@/components/DialogModel'
|
||||
import {
|
||||
getPersonListByMacNoAPI,
|
||||
getAllPersonListAPI,
|
||||
|
|
@ -77,18 +192,25 @@ import {
|
|||
batchDeletePersonAPI,
|
||||
refreshAPI,
|
||||
restartAPI,
|
||||
sendDownAPI,
|
||||
configAPI,
|
||||
} from '@/api/system/attMacManage.js'
|
||||
|
||||
export default {
|
||||
name: 'RightTable',
|
||||
components: {
|
||||
TableModel,
|
||||
DialogModel,
|
||||
},
|
||||
props: {
|
||||
macNo: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
proId: {
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -135,17 +257,80 @@ export default {
|
|||
t_width: '180',
|
||||
},
|
||||
],
|
||||
// 下发弹框配置
|
||||
sendDownDialogConfig: {
|
||||
outerVisible: false,
|
||||
outerTitle: '下发',
|
||||
outerWidth: '50%',
|
||||
maxHeight: '80vh',
|
||||
},
|
||||
// 配置弹框配置
|
||||
configDialogConfig: {
|
||||
outerVisible: false,
|
||||
outerTitle: '配置',
|
||||
outerWidth: '50%',
|
||||
maxHeight: '80vh',
|
||||
},
|
||||
// 下发表单数据
|
||||
sendDownFormData: {
|
||||
personIds: [],
|
||||
content: '',
|
||||
},
|
||||
// 配置表单数据
|
||||
configFormData: {
|
||||
personIds: [],
|
||||
configItem: '',
|
||||
},
|
||||
// 下发表单校验规则
|
||||
sendDownFormRules: {
|
||||
personIds: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择人员',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
content: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入下发内容',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
// 配置表单校验规则
|
||||
configFormRules: {
|
||||
personIds: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择人员',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
configItem: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入配置项',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
// 人员列表
|
||||
personList: [],
|
||||
personListLoading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 根据是否有考勤机编号决定使用哪个API
|
||||
requestApi() {
|
||||
return this.macNo ? getPersonListByMacNoAPI : getAllPersonListAPI
|
||||
return this.macNo
|
||||
? getPersonListByMacNoAPI
|
||||
: getPersonListByMacNoAPI
|
||||
},
|
||||
// 传递给表格的查询参数
|
||||
sendParams() {
|
||||
return {
|
||||
macNo: this.macNo || '',
|
||||
deviceCode: this.macNo || '',
|
||||
}
|
||||
},
|
||||
// 获取选中的数据
|
||||
|
|
@ -218,11 +403,113 @@ export default {
|
|||
},
|
||||
// 下发
|
||||
handleSendDown() {
|
||||
this.$parent.openSendDownDialog()
|
||||
if (!this.macNo) {
|
||||
this.$modal.msgWarning('请先选择考勤机')
|
||||
return
|
||||
}
|
||||
this.sendDownDialogConfig.outerVisible = true
|
||||
this.resetSendDownForm()
|
||||
this.getPersonList()
|
||||
},
|
||||
// 配置
|
||||
handleConfig() {
|
||||
this.$parent.openConfigDialog()
|
||||
if (!this.macNo) {
|
||||
this.$modal.msgWarning('请先选择考勤机')
|
||||
return
|
||||
}
|
||||
this.configDialogConfig.outerVisible = true
|
||||
this.resetConfigForm()
|
||||
this.getPersonList()
|
||||
},
|
||||
// 获取人员列表
|
||||
async getPersonList() {
|
||||
this.personListLoading = true
|
||||
try {
|
||||
const res = await getAllPersonListAPI({
|
||||
proId: this.proId,
|
||||
})
|
||||
if (res.code === 200) {
|
||||
this.personList = res.rows || res.data || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取人员列表失败:', error)
|
||||
} finally {
|
||||
this.personListLoading = false
|
||||
}
|
||||
},
|
||||
// 关闭下发弹框
|
||||
handleCloseSendDownDialog() {
|
||||
this.sendDownDialogConfig.outerVisible = false
|
||||
this.resetSendDownForm()
|
||||
},
|
||||
// 重置下发表单
|
||||
resetSendDownForm() {
|
||||
this.sendDownFormData = {
|
||||
personIds: [],
|
||||
content: '',
|
||||
}
|
||||
if (this.$refs.sendDownFormRef) {
|
||||
this.$refs.sendDownFormRef.resetFields()
|
||||
}
|
||||
},
|
||||
// 提交下发表单
|
||||
handleSendDownSubmit() {
|
||||
this.$refs.sendDownFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
macNo: this.macNo,
|
||||
personIds: this.sendDownFormData.personIds,
|
||||
content: this.sendDownFormData.content,
|
||||
}
|
||||
sendDownAPI(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess('下发成功')
|
||||
this.handleCloseSendDownDialog()
|
||||
this.getTableList()
|
||||
this.$emit('refresh-tree')
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 关闭配置弹框
|
||||
handleCloseConfigDialog() {
|
||||
this.configDialogConfig.outerVisible = false
|
||||
this.resetConfigForm()
|
||||
},
|
||||
// 重置配置表单
|
||||
resetConfigForm() {
|
||||
this.configFormData = {
|
||||
personIds: [],
|
||||
configItem: '',
|
||||
}
|
||||
if (this.$refs.configFormRef) {
|
||||
this.$refs.configFormRef.resetFields()
|
||||
}
|
||||
},
|
||||
// 提交配置表单
|
||||
handleConfigSubmit() {
|
||||
this.$refs.configFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
macNo: this.macNo,
|
||||
personIds: this.configFormData.personIds,
|
||||
configItem: this.configFormData.configItem,
|
||||
}
|
||||
configAPI(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess('配置成功')
|
||||
this.handleCloseConfigDialog()
|
||||
this.getTableList()
|
||||
this.$emit('refresh-tree')
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 刷新
|
||||
handleRefresh() {
|
||||
|
|
@ -288,4 +575,9 @@ export default {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.dialog-footer-btn {
|
||||
text-align: right;
|
||||
padding-top: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -10,161 +10,44 @@
|
|||
<rightTable
|
||||
ref="rightTableRef"
|
||||
:mac-no="selectedMacNo"
|
||||
:pro-id="selectedProId"
|
||||
@refresh-tree="handleRefreshTree"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 下发弹框 -->
|
||||
<DialogModel
|
||||
:dialogConfig="sendDownDialogConfig"
|
||||
@closeDialogOuter="handleCloseSendDownDialog"
|
||||
>
|
||||
<template slot="outerContent">
|
||||
<el-form
|
||||
ref="sendDownFormRef"
|
||||
:model="sendDownFormData"
|
||||
:rules="sendDownFormRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="下发内容:" prop="content">
|
||||
<el-input
|
||||
v-model="sendDownFormData.content"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
placeholder="请输入下发内容"
|
||||
clearable
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row class="dialog-footer-btn">
|
||||
<el-button size="medium" @click="handleCloseSendDownDialog">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
size="medium"
|
||||
type="primary"
|
||||
@click="handleSendDownSubmit"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</DialogModel>
|
||||
|
||||
<!-- 配置弹框 -->
|
||||
<DialogModel
|
||||
:dialogConfig="configDialogConfig"
|
||||
@closeDialogOuter="handleCloseConfigDialog"
|
||||
>
|
||||
<template slot="outerContent">
|
||||
<el-form
|
||||
ref="configFormRef"
|
||||
:model="configFormData"
|
||||
:rules="configFormRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="配置项:" prop="configItem">
|
||||
<el-input
|
||||
v-model="configFormData.configItem"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
placeholder="请输入配置项"
|
||||
clearable
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row class="dialog-footer-btn">
|
||||
<el-button size="medium" @click="handleCloseConfigDialog">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
size="medium"
|
||||
type="primary"
|
||||
@click="handleConfigSubmit"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</DialogModel>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import leftTree from './components/leftTree.vue'
|
||||
import rightTable from './components/rightTable.vue'
|
||||
import DialogModel from '@/components/DialogModel'
|
||||
import { sendDownAPI, configAPI } from '@/api/system/attMacManage.js'
|
||||
|
||||
export default {
|
||||
name: 'AttMacManage',
|
||||
components: {
|
||||
leftTree,
|
||||
rightTable,
|
||||
DialogModel,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectedMacNo: '', // 选中的考勤机编号
|
||||
// 下发弹框配置
|
||||
sendDownDialogConfig: {
|
||||
outerVisible: false,
|
||||
outerTitle: '下发',
|
||||
outerWidth: '50%',
|
||||
maxHeight: '80vh',
|
||||
},
|
||||
// 配置弹框配置
|
||||
configDialogConfig: {
|
||||
outerVisible: false,
|
||||
outerTitle: '配置',
|
||||
outerWidth: '50%',
|
||||
maxHeight: '80vh',
|
||||
},
|
||||
// 下发表单数据
|
||||
sendDownFormData: {
|
||||
content: '',
|
||||
},
|
||||
// 配置表单数据
|
||||
configFormData: {
|
||||
configItem: '',
|
||||
},
|
||||
// 下发表单校验规则
|
||||
sendDownFormRules: {
|
||||
content: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入下发内容',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
// 配置表单校验规则
|
||||
configFormRules: {
|
||||
configItem: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入配置项',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
selectedProId: '', // 选中的工程id
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 树节点点击事件
|
||||
handleNodeClick(data) {
|
||||
if (data.level === 2) {
|
||||
// 二级节点(考勤机)
|
||||
this.selectedMacNo = data.macNo || data.id
|
||||
} else {
|
||||
// 一级节点(工程)或根节点,显示所有人员
|
||||
this.selectedMacNo = ''
|
||||
}
|
||||
console.log('data选择的节点', data)
|
||||
|
||||
this.selectedMacNo = data.id
|
||||
this.selectedProId = data.proId
|
||||
// if (data.level === 2) {
|
||||
// // 二级节点(考勤机)
|
||||
// this.selectedMacNo = data.id
|
||||
// } else {
|
||||
// // 一级节点(工程)或根节点,显示所有人员
|
||||
// this.selectedMacNo = ''
|
||||
// }
|
||||
// 刷新右侧表格
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.rightTableRef) {
|
||||
|
|
@ -178,89 +61,8 @@ export default {
|
|||
this.$refs.leftTreeRef.getTreeData()
|
||||
}
|
||||
},
|
||||
// 打开下发弹框
|
||||
openSendDownDialog() {
|
||||
this.sendDownDialogConfig.outerVisible = true
|
||||
this.resetSendDownForm()
|
||||
},
|
||||
// 关闭下发弹框
|
||||
handleCloseSendDownDialog() {
|
||||
this.sendDownDialogConfig.outerVisible = false
|
||||
this.resetSendDownForm()
|
||||
},
|
||||
// 重置下发表单
|
||||
resetSendDownForm() {
|
||||
this.sendDownFormData = {
|
||||
content: '',
|
||||
}
|
||||
if (this.$refs.sendDownFormRef) {
|
||||
this.$refs.sendDownFormRef.resetFields()
|
||||
}
|
||||
},
|
||||
// 提交下发表单
|
||||
handleSendDownSubmit() {
|
||||
this.$refs.sendDownFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
macNo: this.selectedMacNo,
|
||||
content: this.sendDownFormData.content,
|
||||
}
|
||||
sendDownAPI(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess('下发成功')
|
||||
this.handleCloseSendDownDialog()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 打开配置弹框
|
||||
openConfigDialog() {
|
||||
this.configDialogConfig.outerVisible = true
|
||||
this.resetConfigForm()
|
||||
},
|
||||
// 关闭配置弹框
|
||||
handleCloseConfigDialog() {
|
||||
this.configDialogConfig.outerVisible = false
|
||||
this.resetConfigForm()
|
||||
},
|
||||
// 重置配置表单
|
||||
resetConfigForm() {
|
||||
this.configFormData = {
|
||||
configItem: '',
|
||||
}
|
||||
if (this.$refs.configFormRef) {
|
||||
this.$refs.configFormRef.resetFields()
|
||||
}
|
||||
},
|
||||
// 提交配置表单
|
||||
handleConfigSubmit() {
|
||||
this.$refs.configFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
macNo: this.selectedMacNo,
|
||||
configItem: this.configFormData.configItem,
|
||||
}
|
||||
configAPI(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess('配置成功')
|
||||
this.handleCloseConfigDialog()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-footer-btn {
|
||||
text-align: right;
|
||||
padding-top: 20px;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue