院内分类代码提交(需同步)

prod
郑明梁 2 years ago
parent acf4a1b05d
commit a51046509d

@ -18,6 +18,15 @@ export function getListMenu(query) {
}); });
} }
export function menuAllList(query) {
return axios({
url: "/udiwms/basic/hosp/type/menuAllList",
method: "post",
data: query
});
}
export function getOneName(query) { export function getOneName(query) {
return axios({ return axios({
url: "/udiwms/basic/hosp/type/getOneName", url: "/udiwms/basic/hosp/type/getOneName",

@ -31,7 +31,7 @@
<el-table-column prop="remark" label="备注"></el-table-column> <el-table-column prop="remark" label="备注"></el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width"> <el-table-column label="操作" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handleSubForm( scope.row, 'add')">新增</el-button> <el-button type="text" @click="handleSubForm( scope.row, 'add')" :disabled="scope.row.code==10000">新增</el-button>
<el-button type="text" @click.native.stop="handleSubForm( scope.row, 'edit')">编辑</el-button> <el-button type="text" @click.native.stop="handleSubForm( scope.row, 'edit')">编辑</el-button>
<el-button type="text" v-if="scope.row.code!=10000" @click.native.stop="handleDelInv(scope.row)"></el-button> <el-button type="text" v-if="scope.row.code!=10000" @click.native.stop="handleDelInv(scope.row)"></el-button>
<el-button type="text" v-if="scope.row.code!=10000" @click.native.stop="addHospProduct( scope.row)"></el-button> <el-button type="text" v-if="scope.row.code!=10000" @click.native.stop="addHospProduct( scope.row)"></el-button>
@ -134,7 +134,15 @@
<script> <script>
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import {getBasicHospType, getListMenu, saveBasicHospType,uodateBasicHospType,deleteBasicHospType,getOneName} from "@/api/basic/basicHospType"; import {
getBasicHospType,
getListMenu,
saveBasicHospType,
uodateBasicHospType,
deleteBasicHospType,
getOneName,
menuAllList
} from "@/api/basic/basicHospType";
import selectHospProduct from "@/views/basic/product/bindHospProduct"; import selectHospProduct from "@/views/basic/product/bindHospProduct";
import selectUnBindHospProduct from "@/views/basic/product/unbindHospProduct"; import selectUnBindHospProduct from "@/views/basic/product/unbindHospProduct";
@ -224,7 +232,7 @@ export default {
this.subData = JSON.parse(JSON.stringify(data)); this.subData = JSON.parse(JSON.stringify(data));
} else if (formName === "add") { } else if (formName === "add") {
this.subData= { this.subData= {
parentCode:JSON.parse(JSON.stringify(data)).code parentCode:JSON.parse(JSON.stringify(data)).parentCode
}; };
} }
this.getTreeselect(data); this.getTreeselect(data);
@ -292,12 +300,22 @@ export default {
} }
getOneName().then(res =>{ getOneName().then(res =>{
const menu = {id: res.data.id,code:res.data.code, name: res.data.name, children: []}; const menu = {id: res.data.id,code:res.data.code, name: res.data.name, children: []};
getListMenu(data).then(response => { if(this.formName == 'edit'){
this.fromDeptOptions = []; //
menu.children = this.handleTree(response.data,"code", "parentCode"); getListMenu(data).then(response => {
console.log(menu) this.fromDeptOptions = [];
this.fromDeptOptions.push(menu); menu.children = this.handleTree(response.data,"code", "parentCode");
}); this.fromDeptOptions.push(menu);
});
}else {
//
debugger
menuAllList(data).then(response => {
this.fromDeptOptions = [];
menu.children = this.handleTree(response.data,"code", "parentCode");
this.fromDeptOptions.push(menu);
});
}
}) })
}, },
/** 转换菜单数据结构 */ /** 转换菜单数据结构 */

Loading…
Cancel
Save