feat: 设备管理前端迁移
This commit is contained in:
221
klp-ui/src/components/dvplanSelect/index.vue
Normal file
221
klp-ui/src/components/dvplanSelect/index.vue
Normal file
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<el-dialog title="设备选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="80%"
|
||||
center
|
||||
>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="计划编号" prop="planCode">
|
||||
<el-input
|
||||
v-model="queryParams.planCode"
|
||||
placeholder="请输入计划编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划名称" prop="planName">
|
||||
<el-input
|
||||
v-model="queryParams.planName"
|
||||
placeholder="请输入计划名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="checkplanList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
|
||||
<el-table-column width="55" align="center" >
|
||||
<template v-slot="scope">
|
||||
<el-radio v-model="selectedPlanId" :label="scope.row.planId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划编码" align="center" prop="planCode" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
>{{scope.row.planCode}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划名称" align="center" width="200px" prop="planName" />
|
||||
<el-table-column label="计划类型" align="center" width="120px" prop="planType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.dv_plan_type" :value="scope.row.planType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始日期" align="center" prop="startDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束日期" align="center" prop="endDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="频率" align="center" prop="cycleType" width="120px">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.cycleCount}}<dict-tag :options="dict.type.mes_cycle_type" :value="scope.row.cycleType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="130px" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="scope.row.status =='PREPARE'"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.status =='FINISHED'"
|
||||
>停用</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||
<el-button @click="showFlag=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCheckplan } from "@/api/mes/dv/checkplan";
|
||||
|
||||
export default {
|
||||
name: "CheckplanSelect",
|
||||
dicts: ['mes_cycle_type','mes_order_status','dv_plan_type'],
|
||||
props: {
|
||||
planType: {
|
||||
type: String,
|
||||
default: 'CHECK'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showFlag: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
selectedPlanId: undefined,
|
||||
selectedRow: undefined,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备点检计划头表格数据
|
||||
checkplanList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
planCode: null,
|
||||
planName: null,
|
||||
planType: this.planType,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
cycleType: null,
|
||||
cycleCount: null,
|
||||
status: 'FINISHED'
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询设备点检计划头列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCheckplan(this.queryParams).then(response => {
|
||||
this.checkplanList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
handleCurrent(row){
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
}
|
||||
},
|
||||
//行双击选中
|
||||
handleRowDbClick(row){
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
this.$emit('onSelected',this.selectedRow);
|
||||
this.showFlag = false;
|
||||
}
|
||||
},
|
||||
// 单选选中数据
|
||||
handleRowChange(row) {
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
}
|
||||
},
|
||||
//确定选中
|
||||
confirmSelect(){
|
||||
if(this.selectedPlanId ==null || this.selectedPlanId==0){
|
||||
this.$notify({
|
||||
title:'提示',
|
||||
type:'warning',
|
||||
message: '请至少选择一条数据!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$emit('onSelected',this.selectedRow);
|
||||
this.showFlag = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
157
klp-ui/src/components/dvsubjectSelect/multi.vue
Normal file
157
klp-ui/src/components/dvsubjectSelect/multi.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<el-dialog title="项目选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="80%"
|
||||
center
|
||||
>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目编码" prop="subjectCode">
|
||||
<el-input
|
||||
v-model="queryParams.subjectCode"
|
||||
placeholder="请输入项目编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="subjectName">
|
||||
<el-input
|
||||
v-model="queryParams.subjectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="dvsubjectList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目编码" align="center" prop="subjectCode" />
|
||||
<el-table-column label="项目类型" align="center" prop="subjectType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_dvsubject_type" :value="scope.row.subjectType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目内容" align="center" prop="subjectContent" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="标准" align="center" prop="subjectStandard" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="是否启用" align="center" prop="enableFlag">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||
<el-button @click="showFlag=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDvsubject} from "@/api/mes/dv/dvsubject";
|
||||
export default {
|
||||
name: "DvsubjectSelect",
|
||||
dicts: ['sys_yes_no', 'mes_dvsubject_type'],
|
||||
props:{
|
||||
subjectType: null,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showFlag:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组s
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备点检保养项目表格数据
|
||||
dvsubjectList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
subjectCode: null,
|
||||
subjectName: null,
|
||||
subjectType: this.subjectType,
|
||||
subjectContent: null,
|
||||
subjectStandard: null,
|
||||
enableFlag: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询设备点检保养项目列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDvsubject(this.queryParams).then(response => {
|
||||
this.dvsubjectList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.queryParams = {}
|
||||
this.queryParams.pageNum = 1;
|
||||
this.queryParams.pageSize = 10;
|
||||
this.queryParams.subjectType = this.subjectType
|
||||
this.getList();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.queryParams.pageSize = 10;
|
||||
this.getList();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.subjectId)
|
||||
this.selectedRows = selection;
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
//确定选中
|
||||
confirmSelect(){
|
||||
if(this.ids ==[] || this.ids.length==0){
|
||||
this.$notify({
|
||||
title:'提示',
|
||||
type:'warning',
|
||||
message: '请至少选择一条数据!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$emit('onSelected',this.selectedRows);
|
||||
this.showFlag = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
167
klp-ui/src/components/dvsubjectSelect/single.vue
Normal file
167
klp-ui/src/components/dvsubjectSelect/single.vue
Normal file
@@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<el-dialog title="设备点检保养项目选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="80%"
|
||||
center
|
||||
>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目编码" prop="subjectCode">
|
||||
<el-input
|
||||
v-model="queryParams.subjectCode"
|
||||
placeholder="请输入项目编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="subjectName">
|
||||
<el-input
|
||||
v-model="queryParams.subjectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="dvsubjectList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
|
||||
<el-table-column width="55" align="center" >
|
||||
<template v-slot="scope">
|
||||
<el-radio v-model="selectedId" :label="scope.row.subjectId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目编码" align="center" prop="subjectCode" />
|
||||
<el-table-column label="项目名称" align="center" prop="subjectName" />
|
||||
<el-table-column label="项目内容" align="center" prop="subjectContent" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="标准" align="center" prop="subjectStandard" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||
<el-button @click="showFlag=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDvsubject} from "@/api/mes/dv/dvsubject";
|
||||
export default {
|
||||
name: "DvsubjectSelect",
|
||||
dicts: ['sys_yes_no', 'mes_dvsubject_type'],
|
||||
props:{
|
||||
subjectType: null,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showFlag:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
selectedId: undefined,
|
||||
selectedRow: undefined,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备点检保养项目表格数据
|
||||
dvsubjectList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
subjectCode: null,
|
||||
subjectName: null,
|
||||
subjectType: this.subjectType,
|
||||
subjectContent: null,
|
||||
subjectStandard: null,
|
||||
enableFlag: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询设备点检保养项目列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDvsubject(this.queryParams).then(response => {
|
||||
this.dvsubjectList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.queryParams = {}
|
||||
this.queryParams.pageNum = 1;
|
||||
this.queryParams.pageSize = 10;
|
||||
this.queryParams.subjectType = this.subjectType
|
||||
this.getList();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.queryParams.pageSize = 10;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
handleCurrent(row){
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
}
|
||||
},
|
||||
//行双击选中
|
||||
handleRowDbClick(row){
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
this.$emit('onSelected',this.selectedRow);
|
||||
this.showFlag = false;
|
||||
}
|
||||
},
|
||||
// 单选选中数据
|
||||
handleRowChange(row) {
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
}
|
||||
},
|
||||
|
||||
//确定选中
|
||||
confirmSelect(){
|
||||
if(this.selectedId == null || this.selectedId == 0){
|
||||
this.$notify({
|
||||
title:'提示',
|
||||
type:'warning',
|
||||
message: '请选择一条数据!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$emit('onSelected',this.selectedRow);
|
||||
this.showFlag = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
252
klp-ui/src/components/machinerySelect/index.vue
Normal file
252
klp-ui/src/components/machinerySelect/index.vue
Normal file
@@ -0,0 +1,252 @@
|
||||
<template>
|
||||
<el-dialog title="设备选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="80%"
|
||||
center
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<!--分类数据-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="machineryTypeName"
|
||||
placeholder="请输入分类名称"
|
||||
clearable
|
||||
size="small"
|
||||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="machineryTypeOptions"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--设备数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备编码" prop="machineryCode">
|
||||
<el-input
|
||||
v-model="queryParams.machineryCode"
|
||||
placeholder="请输入设备编码"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="machineryName">
|
||||
<el-input
|
||||
v-model="queryParams.machineryName"
|
||||
placeholder="请输入设备名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="machineryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="设备编码" width = "120" align="center" key="machineryCode" prop="machineryCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" min-width="120" align="left" key="machineryName" prop="machineryName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="品牌" align="left" key="machineryBrand" prop="machineryBrand" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="规格型号" align="left" key="machinerySpec" prop="machinerySpec" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属车间" align="center" key="machineryTypeName" prop="machineryTypeName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备状态" align="center" key="status" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_machinery_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||
<el-button @click="showFlag=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMachinery, getMachinery, delMachinery, addMachinery, updateMachinery } from "@/api/mes/dv/machinery";
|
||||
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
|
||||
// import { listAllWorkshop } from "@/api/mes/md/workshop";
|
||||
|
||||
import { getToken } from "@/utils/auth";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "MachinerySelect",
|
||||
dicts: ['sys_yes_no','mes_machinery_status'],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
showFlag: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
selectedRows: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物料产品表格数据
|
||||
machineryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 设备类型树选项
|
||||
machineryTypeOptions: [],
|
||||
//车间选项
|
||||
workshopOptions:[],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 设备类型名称
|
||||
machineryTypeName: undefined,
|
||||
//自动生成物料编码标识
|
||||
autoGenFlag: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "machineryTypeName"
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
machineryCode: null,
|
||||
machineryName: null,
|
||||
machineryBrand: null,
|
||||
machinerySpec: null,
|
||||
machineryTypeId: null,
|
||||
machineryTypeCode: null,
|
||||
machineryTypeName: null,
|
||||
workshopId: null,
|
||||
workshopCode: null,
|
||||
workshopName: null,
|
||||
status: null
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据设备分类名称筛选分类树
|
||||
machineryTypeName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getTreeselect();
|
||||
},
|
||||
methods: {
|
||||
/** 查询物料编码列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMachinery(this.queryParams).then(response => {
|
||||
this.machineryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
/*getWorkshops(){
|
||||
listAllWorkshop().then( response => {
|
||||
debugger;
|
||||
this.workshopOptions =response.data;
|
||||
});
|
||||
},*/
|
||||
/** 转换设备类型数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.machineryTypeId,
|
||||
label: node.machineryTypeName,
|
||||
children: node.children
|
||||
};
|
||||
},
|
||||
/** 查询设备类型下拉树结构 */
|
||||
getTreeselect() {
|
||||
listMachinerytype().then(response => {
|
||||
debugger;
|
||||
this.machineryTypeOptions = [];
|
||||
const data = this.handleTree(response.data, "machineryTypeId", "parentTypeId")[0];
|
||||
this.machineryTypeOptions.push(data);
|
||||
});
|
||||
},
|
||||
// 筛选节点
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.machineryTypeName.indexOf(value) !== -1;
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.queryParams.machineryTypeId = data.machineryTypeId;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.machineryId);
|
||||
this.selectedRows = selection;
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
//确定选中
|
||||
confirmSelect(){
|
||||
if(this.ids ==[] || this.ids.length==0){
|
||||
this.$notify({
|
||||
title:'提示',
|
||||
type:'warning',
|
||||
message: '请至少选择一条数据!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$emit('onSelected',this.selectedRows);
|
||||
this.showFlag = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
278
klp-ui/src/components/machinerySelect/single.vue
Normal file
278
klp-ui/src/components/machinerySelect/single.vue
Normal file
@@ -0,0 +1,278 @@
|
||||
<template>
|
||||
<el-dialog title="设备选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="80%"
|
||||
center
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<!--分类数据-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="machineryTypeName"
|
||||
placeholder="请输入分类名称"
|
||||
clearable
|
||||
size="small"
|
||||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="machineryTypeOptions"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--设备数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备编码" prop="machineryCode">
|
||||
<el-input
|
||||
v-model="queryParams.machineryCode"
|
||||
placeholder="请输入设备编码"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="machineryName">
|
||||
<el-input
|
||||
v-model="queryParams.machineryName"
|
||||
placeholder="请输入设备名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属车间" prop="workshopName">
|
||||
<el-input
|
||||
v-model="queryParams.workshopName"
|
||||
placeholder="请输入所属车间"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="machineryList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
|
||||
<el-table-column width="50" align="center" >
|
||||
<template v-slot="scope">
|
||||
<el-radio v-model="selectedMachineryId" :label="scope.row.machineryId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备编码" width = "120" align="center" key="machineryCode" prop="machineryCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" min-width="120" align="left" key="machineryName" prop="machineryName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="品牌" align="left" key="machineryBrand" prop="machineryBrand" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="规格型号" align="left" key="machinerySpec" prop="machinerySpec" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属车间" align="center" key="workshopName" prop="workshopName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备状态" align="center" key="status" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_machinery_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||
<el-button @click="showFlag=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMachinery, getMachinery, delMachinery, addMachinery, updateMachinery } from "@/api/mes/dv/machinery";
|
||||
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
|
||||
// import { listAllWorkshop } from "@/api/mes/md/workshop";
|
||||
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "MachinerySelectSingle",
|
||||
dicts: ['sys_yes_no','mes_machinery_status'],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
showFlag: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
selectedMachineryId: undefined,
|
||||
selectedRows: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物料产品表格数据
|
||||
machineryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 设备类型树选项
|
||||
machineryTypeOptions: [],
|
||||
//车间选项
|
||||
workshopOptions:[],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 设备类型名称
|
||||
machineryTypeName: undefined,
|
||||
//自动生成物料编码标识
|
||||
autoGenFlag: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "machineryTypeName"
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
machineryCode: null,
|
||||
machineryName: null,
|
||||
machineryBrand: null,
|
||||
machinerySpec: null,
|
||||
machineryTypeId: null,
|
||||
machineryTypeCode: null,
|
||||
machineryTypeName: null,
|
||||
workshopId: null,
|
||||
workshopCode: null,
|
||||
workshopName: null,
|
||||
status: null
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据设备分类名称筛选分类树
|
||||
machineryTypeName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getTreeselect();
|
||||
},
|
||||
methods: {
|
||||
handleOpen(id) {
|
||||
this.showFlag = true
|
||||
this.selectedMachineryId = id
|
||||
},
|
||||
/** 查询物料编码列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMachinery(this.queryParams).then(response => {
|
||||
this.machineryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
/*getWorkshops(){
|
||||
listAllWorkshop().then( response => {
|
||||
this.workshopOptions =response.data;
|
||||
});
|
||||
},*/
|
||||
/** 转换设备类型数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.machineryTypeId,
|
||||
label: node.machineryTypeName,
|
||||
children: node.children
|
||||
};
|
||||
},
|
||||
/** 查询设备类型下拉树结构 */
|
||||
getTreeselect() {
|
||||
listMachinerytype().then(response => {
|
||||
this.machineryTypeOptions = [];
|
||||
const data = this.handleTree(response.data, "machineryTypeId", "parentTypeId")[0];
|
||||
this.machineryTypeOptions.push(data);
|
||||
});
|
||||
},
|
||||
// 筛选节点
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.machineryTypeName.indexOf(value) !== -1;
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.queryParams.machineryTypeId = data.machineryTypeId;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleCurrent(row){
|
||||
if(row){
|
||||
this.selectedRows = row;
|
||||
}
|
||||
},
|
||||
//双击选中
|
||||
handleRowDbClick(row){
|
||||
if(row){
|
||||
this.selectedRows = row;
|
||||
this.$emit('onSelected',this.selectedRows);
|
||||
this.showFlag = false;
|
||||
}
|
||||
},
|
||||
// 单选选中数据
|
||||
handleRowChange(row) {
|
||||
if(row){
|
||||
this.selectedRows = row;
|
||||
}
|
||||
},
|
||||
//确定选中
|
||||
confirmSelect(){
|
||||
if(this.selectedMachineryId == null || this.selectedMachineryId == 0){
|
||||
this.$notify({
|
||||
title:'提示',
|
||||
type:'warning',
|
||||
message: '请至少选择一条数据!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$emit('onSelected',this.selectedRows);
|
||||
this.showFlag = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
242
klp-ui/src/components/userSelect/multi.vue
Normal file
242
klp-ui/src/components/userSelect/multi.vue
Normal file
@@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<el-dialog title="人员选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="80%"
|
||||
center
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<!--部门数据-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="deptName"
|
||||
placeholder="请输入部门名称"
|
||||
clearable
|
||||
size="small"
|
||||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="deptOptions"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--用户数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input
|
||||
v-model="queryParams.phonenumber"
|
||||
placeholder="请输入手机号码"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
||||
<!-- <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="scope.row.status"-->
|
||||
<!-- active-value="0"-->
|
||||
<!-- inactive-value="1"-->
|
||||
<!-- @change="handleStatusChange(scope.row)"-->
|
||||
<!-- ></el-switch>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||
<el-button @click="showFlag=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { treeselect } from "@/api/system/dept";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "UserMultiSelect",
|
||||
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
showFlag:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
selectedRows: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 用户表格数据
|
||||
userList: null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 部门树选项
|
||||
deptOptions: undefined,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 部门名称
|
||||
deptName: undefined,
|
||||
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 岗位选项
|
||||
postOptions: [],
|
||||
// 角色选项
|
||||
roleOptions: [],
|
||||
// 表单参数
|
||||
form: {},
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "label"
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: undefined,
|
||||
phonenumber: undefined,
|
||||
status: undefined,
|
||||
deptId: undefined
|
||||
},
|
||||
// 列信息
|
||||
columns: [
|
||||
{ key: 0, label: `用户编号`, visible: true },
|
||||
{ key: 1, label: `用户名称`, visible: true },
|
||||
{ key: 2, label: `用户昵称`, visible: true },
|
||||
{ key: 3, label: `部门`, visible: true },
|
||||
{ key: 4, label: `手机号码`, visible: true },
|
||||
{ key: 5, label: `状态`, visible: true },
|
||||
{ key: 6, label: `创建时间`, visible: true }
|
||||
],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据名称筛选部门树
|
||||
deptName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getTreeselect();
|
||||
},
|
||||
methods: {
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
treeselect().then(response => {
|
||||
debugger;
|
||||
this.deptOptions = response.data;
|
||||
});
|
||||
},
|
||||
// 筛选节点
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.queryParams.deptId = data.id;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.userId);
|
||||
this.selectedRows = selection;
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
//确定选中
|
||||
confirmSelect(){
|
||||
if(this.selectedRows == null || this.selectedRows.size == 0){
|
||||
this.$notify({
|
||||
title:'提示',
|
||||
type:'warning',
|
||||
message: '请至少选择一条数据!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$emit('onSelected',this.selectedRows);
|
||||
this.showFlag = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
258
klp-ui/src/components/userSelect/single.vue
Normal file
258
klp-ui/src/components/userSelect/single.vue
Normal file
@@ -0,0 +1,258 @@
|
||||
<template>
|
||||
<el-dialog title="人员选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="80%"
|
||||
center
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<!--部门数据-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="deptName"
|
||||
placeholder="请输入部门名称"
|
||||
clearable
|
||||
size="small"
|
||||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="deptOptions"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--用户数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input
|
||||
v-model="queryParams.phonenumber"
|
||||
placeholder="请输入手机号码"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="userList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
|
||||
<el-table-column width="55" align="center" >
|
||||
<template v-slot="scope">
|
||||
<el-radio v-model="selectedId" :label="scope.row.userId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
||||
<!-- <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="scope.row.status"-->
|
||||
<!-- active-value="0"-->
|
||||
<!-- inactive-value="1"-->
|
||||
<!-- @change="handleStatusChange(scope.row)"-->
|
||||
<!-- ></el-switch>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||
<el-button @click="showFlag=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { treeselect } from "@/api/system/dept";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "UserSingleSelect",
|
||||
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
showFlag:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
selectedId: null,
|
||||
selectedRow: null,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 用户表格数据
|
||||
userList: null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 部门树选项
|
||||
deptOptions: undefined,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 部门名称
|
||||
deptName: undefined,
|
||||
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 岗位选项
|
||||
postOptions: [],
|
||||
// 角色选项
|
||||
roleOptions: [],
|
||||
// 表单参数
|
||||
form: {},
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "label"
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: undefined,
|
||||
phonenumber: undefined,
|
||||
status: undefined,
|
||||
deptId: undefined
|
||||
},
|
||||
// 列信息
|
||||
columns: [
|
||||
{ key: 0, label: `用户编号`, visible: true },
|
||||
{ key: 1, label: `用户名称`, visible: true },
|
||||
{ key: 2, label: `用户昵称`, visible: true },
|
||||
{ key: 3, label: `部门`, visible: true },
|
||||
{ key: 4, label: `手机号码`, visible: true },
|
||||
{ key: 5, label: `状态`, visible: true },
|
||||
{ key: 6, label: `创建时间`, visible: true }
|
||||
],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据名称筛选部门树
|
||||
deptName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getTreeselect();
|
||||
},
|
||||
methods: {
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
treeselect().then(response => {
|
||||
debugger;
|
||||
this.deptOptions = response.data;
|
||||
});
|
||||
},
|
||||
// 筛选节点
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.queryParams.deptId = data.id;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleCurrent(row){
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
}
|
||||
},
|
||||
//行双击选中
|
||||
handleRowDbClick(row){
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
this.$emit('onSelected',this.selectedRow);
|
||||
this.showFlag = false;
|
||||
}
|
||||
},
|
||||
// 单选选中数据
|
||||
handleRowChange(row) {
|
||||
debugger;
|
||||
if(row){
|
||||
this.selectedRow = row;
|
||||
}
|
||||
},
|
||||
//确定选中
|
||||
confirmSelect(){
|
||||
if(this.selectedId == null || this.selectedId == 0){
|
||||
this.$notify({
|
||||
title:'提示',
|
||||
type:'warning',
|
||||
message: '请至少选择一条数据!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$emit('onSelected',this.selectedRow);
|
||||
this.showFlag = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user