接口调试配件管理
This commit is contained in:
parent
d8430e9dc4
commit
2ab516141f
|
|
@ -0,0 +1,3 @@
|
||||||
|
# 对接后端
|
||||||
|
> 韩遨宇 退料
|
||||||
|
> 刘川 基础管理 仓储管理
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -168,6 +168,14 @@ export function addPartType(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//配件管理--新增
|
||||||
|
export function addMaPartType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/maPartType',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 配件管理--修改
|
// 配件管理--修改
|
||||||
export function updatePartType(data) {
|
export function updatePartType(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|
@ -176,6 +184,14 @@ export function updatePartType(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 配件管理--修改
|
||||||
|
export function updatePartTypeById(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/maPartType/updateById',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
//配件管理--删除
|
//配件管理--删除
|
||||||
export function delPartType(maIds) {
|
export function delPartType(maIds) {
|
||||||
return request({
|
return request({
|
||||||
|
|
@ -183,6 +199,13 @@ export function delPartType(maIds) {
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//配件管理--查询
|
||||||
|
export function getPartType(maIds) {
|
||||||
|
return request({
|
||||||
|
url: '/base/maPartType/' + maIds,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -269,13 +292,6 @@ export function delRepairer(data) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,3 +50,17 @@ export function delDept(deptId) {
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 上级获取
|
||||||
|
export function apiGetPartTree() {
|
||||||
|
return request({
|
||||||
|
url: '/system/select/getPartTree',
|
||||||
|
method: 'post',
|
||||||
|
data:{}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,87 +1,33 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
||||||
:model="queryParams"
|
|
||||||
ref="queryForm"
|
|
||||||
size="small"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
>
|
|
||||||
<el-form-item label="关键字" prop="paName">
|
<el-form-item label="关键字" prop="paName">
|
||||||
<el-input
|
<el-input v-model="queryParams.paName" placeholder="请输入关键字" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.paName"
|
|
||||||
placeholder="请输入关键字"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||||
type="primary"
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||||
type="primary"
|
v-hasPermi="['system:dept:add']">新增</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['system:dept:add']"
|
|
||||||
>新增</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
|
||||||
type="info"
|
|
||||||
plain
|
|
||||||
icon="el-icon-sort"
|
|
||||||
size="mini"
|
|
||||||
@click="toggleExpandAll"
|
|
||||||
>展开/折叠</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
:showSearch.sync="showSearch"
|
|
||||||
@queryTable="getList"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
<el-table v-if="refreshTable" v-loading="loading" :data="deptList" row-key="paId" :default-expand-all="isExpandAll"
|
||||||
v-if="refreshTable"
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||||
v-loading="loading"
|
<el-table-column prop="paName" label="名称" min-width="260"></el-table-column>
|
||||||
:data="deptList"
|
<el-table-column prop="unitId" label="计量单位" min-width="260"></el-table-column>
|
||||||
row-key="paId"
|
<el-table-column prop="buyPrice" label="购置价格" min-width="260"></el-table-column>
|
||||||
:default-expand-all="isExpandAll"
|
<el-table-column prop="num" label="数量" min-width="200"></el-table-column>
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
<el-table-column prop="remark" label="备注信息" min-width="200"></el-table-column>
|
||||||
>
|
|
||||||
<el-table-column prop="paName" label="名称" width="260"></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="unitName"
|
|
||||||
label="计量单位"
|
|
||||||
width="260"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="buyPrice"
|
|
||||||
label="购置价格"
|
|
||||||
width="260"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column prop="num" label="数量" width="200"></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="remark"
|
|
||||||
label="备注信息"
|
|
||||||
width="200"
|
|
||||||
></el-table-column>
|
|
||||||
<!-- <el-table-column prop="status" label="状态" width="100">-->
|
<!-- <el-table-column prop="status" label="状态" width="100">-->
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
|
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
|
||||||
|
|
@ -92,20 +38,10 @@
|
||||||
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<el-table-column
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160px">
|
||||||
label="操作"
|
|
||||||
align="center"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||||
size="mini"
|
v-hasPermi="['system:dept:edit']">修改</el-button>
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['system:dept:edit']"
|
|
||||||
>修改</el-button
|
|
||||||
>
|
|
||||||
<!-- <el-button-->
|
<!-- <el-button-->
|
||||||
<!-- size="mini"-->
|
<!-- size="mini"-->
|
||||||
<!-- type="text"-->
|
<!-- type="text"-->
|
||||||
|
|
@ -113,31 +49,21 @@
|
||||||
<!-- @click="handleAdd(scope.row)"-->
|
<!-- @click="handleAdd(scope.row)"-->
|
||||||
<!-- v-hasPermi="['system:dept:add']"-->
|
<!-- v-hasPermi="['system:dept:add']"-->
|
||||||
<!-- >新增</el-button>-->
|
<!-- >新增</el-button>-->
|
||||||
<el-button
|
<el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete"
|
||||||
v-if="scope.row.parentId != 0"
|
@click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']">删除</el-button>
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['system:dept:remove']"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 添加或修改部门对话框 -->
|
<!-- 添加或修改部门对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24" v-if="form.parentId !== 0">
|
<el-col :span="24">
|
||||||
<el-form-item label="上级" prop="parentId">
|
<el-form-item label="上级" prop="currentId">
|
||||||
<treeselect
|
<el-cascader v-model="form.currentId" :options="deptOptions"
|
||||||
v-model="form.parentId"
|
:props="{ expandTrigger: 'hover', label: 'label', value: 'id', checkStrictly: true }"
|
||||||
:options="deptOptions"
|
@change="handleNodeClick"> </el-cascader>
|
||||||
:normalizer="normalizer"
|
|
||||||
placeholder="选择上级"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -148,8 +74,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="计量单位" prop="unitName">
|
<el-form-item label="计量单位" prop="unitId">
|
||||||
<el-input v-model="form.unitName" placeholder="请输入计量单位" />
|
<el-input v-model="form.unitId" placeholder="请输入计量单位" />
|
||||||
<!-- <el-input-number v-model="form.unitId" controls-position="right" :min="0" /> -->
|
<!-- <el-input-number v-model="form.unitId" controls-position="right" :min="0" /> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -157,31 +83,19 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="购置价格" prop="buyPrice">
|
<el-form-item label="购置价格" prop="buyPrice">
|
||||||
<el-input
|
<el-input v-model="form.buyPrice" placeholder="请输入购置价格" maxlength="20" />
|
||||||
v-model="form.buyPrice"
|
|
||||||
placeholder="请输入购置价格"
|
|
||||||
maxlength="20"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="数量" prop="num">
|
<el-form-item label="数量" prop="num">
|
||||||
<el-input
|
<el-input v-model="form.num" placeholder="请输入数量" maxlength="20" />
|
||||||
v-model="form.num"
|
|
||||||
placeholder="请输入数量"
|
|
||||||
maxlength="20"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="备注信息" prop="remark">
|
<el-form-item label="备注信息" prop="remark">
|
||||||
<el-input
|
<el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" />
|
||||||
v-model="form.remark"
|
|
||||||
placeholder="请输入备注"
|
|
||||||
maxlength="50"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -195,12 +109,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
|
import { apiGetPartTree } from "@/api/system/dept";
|
||||||
import { listPartType, addPartType, updatePartType, delPartType } from "@/api/store/tools";
|
import { listPartType, addMaPartType, getPartType, updatePartTypeById, delPartType } from "@/api/store/tools";
|
||||||
|
|
||||||
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";
|
||||||
|
// level 层级 +1
|
||||||
export default {
|
export default {
|
||||||
name: "Dept",
|
name: "Dept",
|
||||||
dicts: ['sys_normal_disable'],
|
dicts: ['sys_normal_disable'],
|
||||||
|
|
@ -226,7 +140,7 @@ export default {
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
paName: undefined,
|
paName: undefined,
|
||||||
status: undefined
|
status: undefined,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
|
@ -255,20 +169,28 @@ export default {
|
||||||
trigger: "blur"
|
trigger: "blur"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
// this.initApiGetPartTree()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询部门列表 */
|
/** 查询部门列表 */
|
||||||
getList() {
|
getList() {
|
||||||
// this.loading = true;
|
// this.loading = true;
|
||||||
listPartType(this.queryParams).then(response => {
|
listPartType(this.queryParams).then(response => {
|
||||||
this.deptList = this.handleTree(response.rows, "paId");
|
console.log("response", response)
|
||||||
|
this.deptList = this.handleTree(response.data, "paId");
|
||||||
|
// this.deptList = response.data
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
}).catch(err => {
|
||||||
|
console.log("err", err)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 转换部门数据结构 */
|
/** 转换部门数据结构 */
|
||||||
normalizer(node) {
|
normalizer(node) {
|
||||||
|
|
@ -289,7 +211,8 @@ export default {
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
paId: undefined,
|
currentId: '',
|
||||||
|
level: undefined,
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
paName: undefined,
|
paName: undefined,
|
||||||
orderNum: undefined,
|
orderNum: undefined,
|
||||||
|
|
@ -310,21 +233,21 @@ export default {
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd(row) {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
if (row != undefined) {
|
// if (row != undefined) {
|
||||||
this.form.parentId = row.paId;
|
// this.form.currentId = row.paId;
|
||||||
}
|
// }
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加";
|
this.title = "添加";
|
||||||
listPartType().then(response => {
|
this.initApiGetPartTree()
|
||||||
this.deptOptions = this.handleTree(response.rows, "paId");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
toggleExpandAll() {
|
toggleExpandAll() {
|
||||||
this.refreshTable = false;
|
this.refreshTable = false;
|
||||||
this.isExpandAll = !this.isExpandAll;
|
this.isExpandAll = !this.isExpandAll;
|
||||||
|
console.log("isExpandAll", this.isExpandAll)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.refreshTable = true;
|
this.refreshTable = true;
|
||||||
});
|
});
|
||||||
|
|
@ -333,33 +256,53 @@ export default {
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
// getDept(row.paId).then(response => {
|
// getDept(row.paId).then(response => {
|
||||||
this.form = row;
|
// this.form = row;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改部门";
|
this.title = "修改部门";
|
||||||
// });
|
this.initGetPartType(row)
|
||||||
// listDeptExcludeChild(row.paId).then(response => {
|
|
||||||
// this.deptOptions = this.handleTree(response.data, "paId");
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
console.log("ressearchTreeform", this.form)
|
||||||
if (this.form.paId != undefined) {
|
if (this.form.paId != undefined) {
|
||||||
updatePartType(this.form).then(response => {
|
delete this.form.currentId
|
||||||
|
updatePartTypeById(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addPartType(this.form).then(response => {
|
addMaPartType(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
},
|
||||||
|
async initApiGetPartTree() {
|
||||||
|
try {
|
||||||
|
const res = await apiGetPartTree()
|
||||||
|
console.log("res--apiGetPartTree", res)
|
||||||
|
this.deptOptions = res.data
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleNodeClick(ev) {
|
||||||
|
console.log("scurrentIdcurrentIdcurrentId", ev)
|
||||||
|
const res = this.searchTree(this.deptOptions,this.form.currentId&&this.form.currentId.length > 0 ? this.form.currentId.slice(-1)[0] : {})
|
||||||
|
console.log("ressearchTreeres", res)
|
||||||
|
if(res){
|
||||||
|
this.form.parentId = res.id
|
||||||
|
this.form.level = Number(res.level) + 1
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
|
@ -369,6 +312,55 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
|
},
|
||||||
|
searchTree(tree, id) {
|
||||||
|
let res = null
|
||||||
|
let state = false
|
||||||
|
function readTree(tree, id) {
|
||||||
|
if (state) return
|
||||||
|
for (let i = 0; i < tree.length; i++) {
|
||||||
|
if (tree[i].id == id) {
|
||||||
|
state = true
|
||||||
|
res = tree[i]
|
||||||
|
} else {
|
||||||
|
if (tree[i].children != null) {
|
||||||
|
readTree(tree[i].children, id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readTree(tree, id)
|
||||||
|
return res
|
||||||
|
},
|
||||||
|
getAllParentArr(list, id, name, child) {
|
||||||
|
for (let i in list) {
|
||||||
|
if (list[i][name] == id) {
|
||||||
|
return [list[i]]
|
||||||
|
}
|
||||||
|
if (list[i][child]) {
|
||||||
|
let node = this.getAllParentArr(list[i][child], id, name, child)
|
||||||
|
if (!!node) {
|
||||||
|
return node.concat(list[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleRowClick(ev) {
|
||||||
|
console.log("handleRowClick", ev)
|
||||||
|
this.form.currentId = row.parentId;
|
||||||
|
}
|
||||||
|
,
|
||||||
|
async initGetPartType(row) {
|
||||||
|
console.log("rowgetPartType",row)
|
||||||
|
// const res = await getPartType(row.paId)
|
||||||
|
const currentItem = this.getAllParentArr(this.deptList, row.parentId, 'parentId', 'children')
|
||||||
|
console.log("currcurrentItemetn", currentItem)
|
||||||
|
this.form = JSON.parse(JSON.stringify(row))
|
||||||
|
this.form.currentId = currentItem && currentItem.reverse().map(ele => ele.paId)
|
||||||
|
console.log
|
||||||
|
// this.form = res.data
|
||||||
|
|
||||||
|
this.initApiGetPartTree()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,12 @@ module.exports = {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
//192.168.0.14:28080
|
//192.168.0.14:28080
|
||||||
target: `http://192.168.0.14:21624`,//线上环境
|
// target: `http://192.168.0.14:21624`,//线上环境
|
||||||
// target: `http://10.40.92.140:8080`,//丁/
|
// target: `http://10.40.92.140:8080`,//丁/
|
||||||
// target: `http://10.40.92.126:8080`,//高
|
// target: `http://10.40.92.126:8080`,//高
|
||||||
// target: `http://10.40.92.111:8080`,//亮
|
// target: `http://10.40.92.111:8080`,//亮
|
||||||
|
target: `http://10.40.92.209:8080`,//亮
|
||||||
|
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue