Merge branch 'material-ui' of http://192.168.0.56:3000/bonus/bonus-ui into material-ui
This commit is contained in:
commit
72505a72f0
|
|
@ -1,9 +1,9 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
//机具类型管理列表信息
|
//机具类型管理列表信息
|
||||||
export function getListAccessory(query) {
|
export function getListByPartType(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/material/ma_part_type/list',
|
url: '/material/ma_part_type/getListByPartType',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -35,3 +35,12 @@ export function noBindKeeper(data) {
|
||||||
data: data,
|
data: data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取库管员树的角色数组
|
||||||
|
export function getKeeperIds(itemName) {
|
||||||
|
return request({
|
||||||
|
url: '/material/bm_config/list/',
|
||||||
|
method: 'get',
|
||||||
|
params:{"itemName":itemName},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -35,3 +35,12 @@ export function noBindKeeper(data) {
|
||||||
data: data,
|
data: data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取维修员树的角色数组
|
||||||
|
export function getRepairIds(itemName) {
|
||||||
|
return request({
|
||||||
|
url: '/material/bm_config/list/',
|
||||||
|
method: 'get',
|
||||||
|
params:{"itemName":itemName},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
<template>
|
||||||
|
<el-tabs v-model="activeName" @tab-click="handleClick" class="app-container">
|
||||||
|
<el-tab-pane label="物资配置" name="first" onclick="handleQuery">
|
||||||
|
<div>
|
||||||
|
<div class="app-container">
|
||||||
|
<h4 class="form-header h4">库管员配置</h4>
|
||||||
|
<el-main>
|
||||||
|
<el-checkbox-group v-model="selectedValues">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:checked="item.check">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>保存库管员配置</el-button
|
||||||
|
>
|
||||||
|
</el-main>
|
||||||
|
</div>
|
||||||
|
<div class="app-container">
|
||||||
|
<h4 class="form-header h4">维修员配置</h4>
|
||||||
|
<el-main>
|
||||||
|
<el-checkbox-group v-model="selectedValues">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:checked="item.check">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>保存维修员配置</el-button
|
||||||
|
>
|
||||||
|
</el-main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="新购配置" name="second" >
|
||||||
|
<div>
|
||||||
|
<div class="app-container">
|
||||||
|
<h4 class="form-header h4">库管员配置</h4>
|
||||||
|
<el-main>
|
||||||
|
<el-checkbox-group v-model="selectedValues">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:checked="item.check">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>保存库管员2配置</el-button
|
||||||
|
>
|
||||||
|
</el-main>
|
||||||
|
</div>
|
||||||
|
<div class="app-container">
|
||||||
|
<h4 class="form-header h4">维修员配置</h4>
|
||||||
|
<el-main>
|
||||||
|
<el-checkbox-group v-model="selectedValues">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:checked="item.check">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>保存维修员配置2</el-button
|
||||||
|
>
|
||||||
|
</el-main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'siteConfig',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: 'first',
|
||||||
|
// 模拟后端返回的对象数组
|
||||||
|
options: [
|
||||||
|
{ id: 1, name: 'Option 1', check: true },
|
||||||
|
{ id: 2, name: 'Option 2', check: false },
|
||||||
|
{ id: 3, name: 'Option 3', check: true }
|
||||||
|
],
|
||||||
|
// 记录选中的 id
|
||||||
|
selectedValues: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听选中的值变化,更新后端数据
|
||||||
|
selectedValues(newValues) {
|
||||||
|
// 你可以根据需要将 newValues 更新到后端
|
||||||
|
console.log('选中的ID:', newValues);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 初始化选中的值,如果需要的话
|
||||||
|
this.selectedValues = this.options
|
||||||
|
.filter(item => item.check) // 过滤出 check 为 true 的选项
|
||||||
|
.map(item => item.id); // 提取选中的 id
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick(tab, event) {
|
||||||
|
if(tab.name == 'first'){
|
||||||
|
// this.resetForm("queryFormOne");
|
||||||
|
// this.getList();
|
||||||
|
}else if(tab.name == 'second'){
|
||||||
|
// this.resetForm("queryForm");
|
||||||
|
// this.getboxList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* .section {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
} */
|
||||||
|
/* .el-header, .el-footer {
|
||||||
|
background-color: #e1ebf8;
|
||||||
|
color: #333;
|
||||||
|
text-align: left;
|
||||||
|
line-height: 60px;
|
||||||
|
} */
|
||||||
|
.el-main {
|
||||||
|
background-color: white;
|
||||||
|
color: #333;
|
||||||
|
text-align: left;
|
||||||
|
line-height: 120px;
|
||||||
|
}
|
||||||
|
/* 这里可以写自定义样式 */
|
||||||
|
</style>
|
||||||
|
|
@ -114,6 +114,16 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
|
|
@ -133,10 +143,6 @@
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="typeList"
|
:data="typeList"
|
||||||
ref="multipleTable"
|
|
||||||
row-key="id"
|
|
||||||
default-expand-all
|
|
||||||
:tree-props="{ children: 'children' }"
|
|
||||||
border
|
border
|
||||||
>
|
>
|
||||||
<el-table-column label="序号" align="center" width="80" type="index">
|
<el-table-column label="序号" align="center" width="80" type="index">
|
||||||
|
|
@ -149,9 +155,21 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="名称"
|
label="配件类型"
|
||||||
align="center"
|
align="center"
|
||||||
prop="label"
|
prop="label1"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="配件名称"
|
||||||
|
align="center"
|
||||||
|
prop="label2"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="规格型号"
|
||||||
|
align="center"
|
||||||
|
prop="paName"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -188,7 +206,6 @@
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['machinery:type:edit']"
|
v-hasPermi="['machinery:type:edit']"
|
||||||
v-if="scope.row.level==3 || scope.row.level==2"
|
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -198,7 +215,6 @@
|
||||||
icon="el-icon-delete-solid"
|
icon="el-icon-delete-solid"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['machinery:type:edit']"
|
v-hasPermi="['machinery:type:edit']"
|
||||||
v-if="(!scope.row.children)"
|
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -216,49 +232,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item prop="keyWord">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.keyWord"
|
|
||||||
placeholder="请输入关键词"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
maxlength="20"
|
|
||||||
/>
|
|
||||||
</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-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['machinery:type:add']"
|
|
||||||
>新增</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
>导出
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar
|
|
||||||
:showSearch.sync="showSearch"
|
|
||||||
@queryTable="getList"
|
|
||||||
></right-toolbar>
|
|
||||||
<
|
|
||||||
|
|
||||||
<!-- <pagination
|
<!-- <pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
|
|
@ -283,7 +257,7 @@
|
||||||
:disable-branch-nodes="false"
|
:disable-branch-nodes="false"
|
||||||
placeholder="选择上级菜单"
|
placeholder="选择上级菜单"
|
||||||
@select="onSelect"
|
@select="onSelect"
|
||||||
disabled
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -339,11 +313,60 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 左侧树新增弹框 -->
|
||||||
|
<el-dialog
|
||||||
|
:title="addTitle"
|
||||||
|
:visible.sync="addTitleVisible"
|
||||||
|
v-if="addTitleVisible"
|
||||||
|
width="50%"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
label-width="80px"
|
||||||
|
:model="addFormParams"
|
||||||
|
:rules="addFormParamsRules"
|
||||||
|
ref="addFormParamsRef"
|
||||||
|
>
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="12" v-if="addTitle === '新增'">
|
||||||
|
<el-form-item label="所属上级">
|
||||||
|
<el-input
|
||||||
|
style="width: 100%"
|
||||||
|
disabled
|
||||||
|
v-model="addFormParams.label"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="名称" prop="typeName">
|
||||||
|
<el-input
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="addFormParams.typeName"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row style="text-align: right">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button size="small" type="primary" @click="onSubmit"
|
||||||
|
>确 定</el-button
|
||||||
|
>
|
||||||
|
<el-button size="small" @click="onCancel"
|
||||||
|
>取 消</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getListAccessory,getListTree,getAccessoryDetail,addAccessory,editAccessory,delAccessory, } from "@/api/ma/partType";
|
import { getListByPartType,getListTree,getAccessoryDetail,addAccessory,editAccessory,delAccessory, } from "@/api/ma/partType";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
import IconSelect from "@/components/IconSelect";
|
import IconSelect from "@/components/IconSelect";
|
||||||
|
|
@ -378,9 +401,7 @@
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
showHouse: false,
|
showHouse: false,
|
||||||
|
|
||||||
//列表数据
|
|
||||||
typeList: undefined,
|
typeList: undefined,
|
||||||
|
|
||||||
treeList:[],
|
treeList:[],
|
||||||
flagTemp:1,
|
flagTemp:1,
|
||||||
// 总条数
|
// 总条数
|
||||||
|
|
@ -401,7 +422,19 @@
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
keyWord:undefined
|
keyWord:undefined,
|
||||||
|
level:1,
|
||||||
|
id:undefined,
|
||||||
|
},
|
||||||
|
companyId: undefined,
|
||||||
|
parentId:undefined,
|
||||||
|
isMousemoveId: null,
|
||||||
|
addTitleVisible: false,
|
||||||
|
addTitle: '', // 新增弹框标题
|
||||||
|
addFormParams: {
|
||||||
|
label: '',
|
||||||
|
typeName: '',
|
||||||
|
companyId: 101,
|
||||||
},
|
},
|
||||||
treeOptions:undefined,
|
treeOptions:undefined,
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
|
|
@ -424,7 +457,7 @@
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 根据名称筛选配件类型树
|
// 根据名称筛选配件类型树
|
||||||
|
|
@ -439,11 +472,20 @@
|
||||||
return data.label.indexOf(value) !== -1
|
return data.label.indexOf(value) !== -1
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 节点单击事件 - 左侧树
|
||||||
|
async handleNodeClick(data,node) {
|
||||||
|
this.queryParams.id = data.id
|
||||||
|
this.queryParams.level = data.level
|
||||||
|
this.handleQuery()
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/** 查询配件类型列表 */
|
/** 查询配件类型列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getListAccessory(this.queryParams).then(response => {
|
getListByPartType(this.queryParams).then(response => {
|
||||||
this.typeList = response.data;
|
this.typeList = response.data.rows;
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
|
@ -462,8 +504,13 @@
|
||||||
getTreeselect(){
|
getTreeselect(){
|
||||||
getListTree().then(response=>{
|
getListTree().then(response=>{
|
||||||
this.treeOptions = response.data;
|
this.treeOptions = response.data;
|
||||||
|
if(this.treeOptions.length>0){
|
||||||
});
|
const firstNode = this.treeOptions[0];
|
||||||
|
this.queryParams.id = firstNode.id
|
||||||
|
this.queryParams.level = 1
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 转换菜单数据结构 */
|
/** 转换菜单数据结构 */
|
||||||
|
|
@ -515,8 +562,6 @@
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else if(this.flagTemp==1){
|
} else if(this.flagTemp==1){
|
||||||
console.log('新增')
|
|
||||||
console.log('this.form')
|
|
||||||
addAccessory(this.form).then(response => {
|
addAccessory(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.showHouse = false;
|
this.showHouse = false;
|
||||||
|
|
@ -564,31 +609,198 @@
|
||||||
console.log('eeeee',e)
|
console.log('eeeee',e)
|
||||||
this.form.id = e.id;
|
this.form.id = e.id;
|
||||||
this.form.level = e.level
|
this.form.level = e.level
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 树节点增加 */
|
||||||
|
appendTreeNode(data) {
|
||||||
|
this.levelTemp = data.level;
|
||||||
|
this.idTemp = data.id;
|
||||||
|
console.log('dataAdd',data)
|
||||||
|
console.log('idTemp',data)
|
||||||
|
if (data.level === 3) {
|
||||||
|
this.reset()
|
||||||
|
Object.assign(this.form, data)
|
||||||
|
this.treeTemp=this.treeOptions[0].children,
|
||||||
|
this.treeTemp.forEach(item=>{
|
||||||
|
item.children.forEach(itemTemp=>{
|
||||||
|
if(itemTemp.level==2 && itemTemp.id==data.parentId){
|
||||||
|
this.level2Temp=itemTemp.id
|
||||||
|
this.level2TempName=itemTemp.label
|
||||||
|
this.level1Temp=itemTemp.parentId
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// console.log('treeTemp',this.treeTemp)
|
||||||
|
this.treeTemp.forEach(item=>{
|
||||||
|
if(item.level==1 && item.id==this.level1Temp){
|
||||||
|
this.level1TempName=item.label
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.treeTemp.forEach(item=>{
|
||||||
|
if(item.level==0 && item.id==data.houseId){
|
||||||
|
this.level0TempName=item.label
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.isLevel1Disabled=true
|
||||||
|
this.isLevel2Disabled=true
|
||||||
|
this.isLevel3Disabled=true
|
||||||
|
this.isLevel4Disabled=true
|
||||||
|
this.form.parentId = data.id
|
||||||
|
this.form.houseName = this.level0TempName
|
||||||
|
this.form.itemType = this.level1TempName
|
||||||
|
this.form.materialType = this.level2TempName
|
||||||
|
this.form.materialName = data.label
|
||||||
|
this.open = true
|
||||||
|
this.title = '新增'
|
||||||
|
} else {
|
||||||
|
Object.assign(this.addFormParams, data)
|
||||||
|
this.addFormParams.typeName = ''
|
||||||
|
this.addTitle = '新增'
|
||||||
|
this.addTitleVisible = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* 树节点删除 */
|
||||||
|
removeTreeNode(data) {
|
||||||
|
// this.$message.success('删除--')
|
||||||
|
console.log(data, '删除时的数据源--')
|
||||||
|
const typeId = data.id
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认删除数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delMaType(typeId)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
this.getTreeData()
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
},
|
||||||
|
/* 树节点修改 */
|
||||||
|
editTreeNode(data) {
|
||||||
|
this.levelTemp = data.level;
|
||||||
|
this.idTemp = data.id;
|
||||||
|
this.parentId = data.parentId;
|
||||||
|
console.log('data',data)
|
||||||
|
Object.assign(this.addFormParams, data)
|
||||||
|
this.addTitle = '修改'
|
||||||
|
this.addFormParams.typeName = data.label
|
||||||
|
this.addTitleVisible = true
|
||||||
|
},
|
||||||
|
/* 确定 */
|
||||||
|
onSubmit() {
|
||||||
|
const { id, typeName } = this.addFormParams
|
||||||
|
const addParams = {
|
||||||
|
parentId: this.levelTemp==0 ? 0:this.idTemp,
|
||||||
|
typeName,
|
||||||
|
level:this.levelTemp,
|
||||||
|
houseId:this.levelTemp==0 ? id:null,
|
||||||
|
}
|
||||||
|
|
||||||
|
const editParams = {
|
||||||
|
houseId: id,
|
||||||
|
typeName,
|
||||||
|
level:this.levelTemp,
|
||||||
|
parentId: this.parentId,
|
||||||
|
typeId: id,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.$refs['addFormParamsRef'].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.addTitle === '新增') {
|
||||||
|
const res = await addMaType(addParams)
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success('新增成功!')
|
||||||
|
this.addTitleVisible = false
|
||||||
|
this.getList()
|
||||||
|
this.getTreeData()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const res = await updateMaType(editParams)
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success('修改成功!')
|
||||||
|
this.addTitleVisible = false
|
||||||
|
this.getList()
|
||||||
|
this.getTreeData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/* 取消 */
|
||||||
|
onCancel() {
|
||||||
|
this.addTitleVisible = false
|
||||||
|
},
|
||||||
|
getParentName(list, id) {
|
||||||
|
try {
|
||||||
|
list.forEach((e) => {
|
||||||
|
if (e.id == id) {
|
||||||
|
this.form.label = e.label
|
||||||
|
throw new Error()
|
||||||
|
} else {
|
||||||
|
if (e.children && e.children.length > 0) {
|
||||||
|
this.getParentName(e.children, id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
|
||||||
|
onMousemove(data) {
|
||||||
|
this.isMousemoveId = data.id
|
||||||
|
},
|
||||||
|
onMouseleave() {
|
||||||
|
this.isMousemoveId = null
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.uploadImg {
|
::v-deep.el-table .fixed-width .el-button--mini {
|
||||||
padding-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.deviceCode {
|
|
||||||
margin-top: 10px;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
::v-deep.el-table .fixed-width .el-button--mini {
|
|
||||||
width: 60px !important;
|
width: 60px !important;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .btn-items .el-button + .el-button {
|
||||||
|
margin-left: 6px;
|
||||||
|
}
|
||||||
|
.btn-items {
|
||||||
|
margin-left: 4px;
|
||||||
|
.el-button--text {
|
||||||
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
//隐藏图片上传框的css
|
}
|
||||||
::v-deep.disabled {
|
::v-deep .el-tree .el-tree-node__expand-icon.expanded {
|
||||||
.el-upload--picture-card {
|
-webkit-transform: rotate(0deg);
|
||||||
display: none;
|
transform: rotate(0deg);
|
||||||
}
|
}
|
||||||
}
|
::v-deep .el-tree .el-icon-caret-right:before {
|
||||||
</style>
|
content: '\e783';
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
::v-deep
|
||||||
|
.el-tree
|
||||||
|
.el-tree-node__expand-icon.expanded.el-icon-caret-right:before {
|
||||||
|
content: '\e781';
|
||||||
|
font-size: 16px;
|
||||||
|
color: #1890ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-tree-node__content > .el-tree-node__expand-icon {
|
||||||
|
color: #1890ff !important;
|
||||||
|
}
|
||||||
|
::v-deep .el-tree-node__expand-icon.is-leaf {
|
||||||
|
color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep
|
||||||
|
.el-tree--highlight-current
|
||||||
|
.el-tree-node.is-current
|
||||||
|
> .el-tree-node__content {
|
||||||
|
background-color: #8decf1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -246,10 +246,9 @@ import {
|
||||||
getListByMaType,
|
getListByMaType,
|
||||||
} from "@/api/ma/base";
|
} from "@/api/ma/base";
|
||||||
import {
|
import {
|
||||||
getMatConfigList,
|
|
||||||
getListByMatConfig,
|
|
||||||
bindKeeper,
|
bindKeeper,
|
||||||
noBindKeeper
|
noBindKeeper,
|
||||||
|
getKeeperIds
|
||||||
} from "@/api/ma/typeConfigKeeper";
|
} from "@/api/ma/typeConfigKeeper";
|
||||||
import { getUserList } from "@/api/basic/basic";
|
import { getUserList } from "@/api/basic/basic";
|
||||||
import { getInfo } from "@/api/login";
|
import { getInfo } from "@/api/login";
|
||||||
|
|
@ -319,6 +318,7 @@ export default {
|
||||||
children: "children",
|
children: "children",
|
||||||
label: "label",
|
label: "label",
|
||||||
},
|
},
|
||||||
|
roleIdsTemp:[],
|
||||||
userList:[],
|
userList:[],
|
||||||
userNoList:[],
|
userNoList:[],
|
||||||
userIdTemp: -1,
|
userIdTemp: -1,
|
||||||
|
|
@ -369,8 +369,6 @@ export default {
|
||||||
// this.getList();
|
// this.getList();
|
||||||
// },200)
|
// },200)
|
||||||
|
|
||||||
// this.getUserList()
|
|
||||||
// this.getPropData()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// getInfo() {
|
// getInfo() {
|
||||||
|
|
@ -446,12 +444,13 @@ export default {
|
||||||
this.form.keeperDataPro = this.keeperProRange.value;
|
this.form.keeperDataPro = this.keeperProRange.value;
|
||||||
},
|
},
|
||||||
/** 查询新增页面-上级类型下拉树结构 */
|
/** 查询新增页面-上级类型下拉树结构 */
|
||||||
async getTreeData() {
|
async getTreeData() {;
|
||||||
// getMatConfigList().then((response) => {
|
const itemName = 'ku_guan_role_ids'
|
||||||
// this.treeOptions = response.data;
|
await getKeeperIds(itemName).then((response) =>{
|
||||||
// });
|
const roleIds = response.rows[0].itemValue.split(',').map(item => Number(item))
|
||||||
const roleIds = [7,14];
|
this.roleIdsTemp = roleIds
|
||||||
getUserList({ roleIds: roleIds}).then(response => {
|
})
|
||||||
|
await getUserList({ roleIds: this.roleIdsTemp}).then(response => {
|
||||||
this.treeOptions = response.data
|
this.treeOptions = response.data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -246,10 +246,9 @@ import {
|
||||||
getListByMaType,
|
getListByMaType,
|
||||||
} from "@/api/ma/base";
|
} from "@/api/ma/base";
|
||||||
import {
|
import {
|
||||||
getMatConfigList,
|
|
||||||
getListByMatConfig,
|
|
||||||
bindKeeper,
|
bindKeeper,
|
||||||
noBindKeeper
|
noBindKeeper,
|
||||||
|
getRepairIds
|
||||||
} from "@/api/ma/typeConfigRepair";
|
} from "@/api/ma/typeConfigRepair";
|
||||||
import { getUserList } from "@/api/basic/basic";
|
import { getUserList } from "@/api/basic/basic";
|
||||||
import { getInfo } from "@/api/login";
|
import { getInfo } from "@/api/login";
|
||||||
|
|
@ -280,6 +279,7 @@ export default {
|
||||||
keeperProRange: [],
|
keeperProRange: [],
|
||||||
keeperMatRange: [],
|
keeperMatRange: [],
|
||||||
keeperNameRange: [],
|
keeperNameRange: [],
|
||||||
|
roleIdsTemp:[],
|
||||||
//维修员用户数据
|
//维修员用户数据
|
||||||
repairUserList: null,
|
repairUserList: null,
|
||||||
//资产类型数据
|
//资产类型数据
|
||||||
|
|
@ -399,11 +399,12 @@ export default {
|
||||||
|
|
||||||
/** 查询新增页面-上级类型下拉树结构 */
|
/** 查询新增页面-上级类型下拉树结构 */
|
||||||
async getTreeData() {
|
async getTreeData() {
|
||||||
// getMatConfigList().then((response) => {
|
const itemName = 'wei_xiu_role_ids'
|
||||||
// this.treeOptions = response.data;
|
await getRepairIds(itemName).then((response) =>{
|
||||||
// });
|
const roleIds = response.rows[0].itemValue.split(',').map(item => Number(item))
|
||||||
const roleIds = [8,9,15,16];
|
this.roleIdsTemp = roleIds
|
||||||
getUserList({ roleIds: roleIds}).then(response => {
|
})
|
||||||
|
await getUserList({ roleIds: this.roleIdsTemp}).then(response => {
|
||||||
this.treeOptions = response.data
|
this.treeOptions = response.data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -425,7 +426,6 @@ export default {
|
||||||
async getList() {
|
async getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.queryParams.displayBindRelationship="true";
|
this.queryParams.displayBindRelationship="true";
|
||||||
console.log('queryParams1',this.queryParams)
|
|
||||||
await getListByMaType(this.queryParams).then((response) => {
|
await getListByMaType(this.queryParams).then((response) => {
|
||||||
this.typeList = response.data.rows
|
this.typeList = response.data.rows
|
||||||
this.total = response.data.total
|
this.total = response.data.total
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue