耗材字典院内分类功能代码提交

prod
郑明梁 2 years ago
parent 711f8cb23d
commit d57f1780b4

@ -0,0 +1,88 @@
import axios from "@/utils/request";
import {saveSubWarehouse} from "@/api/system/invSubWarehouse";
export function getBasicHospType(query) {
return axios({
url: "/udiwms/basic/hosp/type/filter",
method: "get",
params: query
});
}
export function getListMenu(query) {
return axios({
url: "/udiwms/basic/hosp/type/menuList",
method: "get",
params: query
});
}
export function saveBasicHospType(query) {
return axios({
url: "/udiwms/basic/hosp/type/save",
method: "post",
data: query
});
}
export function uodateBasicHospType(query) {
return axios({
url: "/udiwms/basic/hosp/type/update",
method: "post",
data: query
});
}
export function deleteBasicHospType(query) {
return axios({
url: "/udiwms/basic/hosp/type/delect",
method: "get",
params: query
});
}
export function getListTree(query) {
return axios({
url: "/udiwms/basic/hosp/type/getTree",
method: "get",
params: query
});
}
export function bindBasicHospProduct(query) {
return axios({
url: "/udiwms/basic/hosp/type/bindRel",
method: "post",
data: query
});
}
export function getBindList(query) {
return axios({
url: "/udiwms/basic/hosp/type/bindList",
method: "get",
params: query
});
}
export function unbindBasicHospProduct(query) {
return axios({
url: "/udiwms/basic/hosp/type/unbindRel",
method: "post",
data: query
});
}

@ -155,6 +155,7 @@ export function mergeRecursive(source, target) {
* @param {*} children 孩子节点字段 默认 'children'
*/
export function handleTree(data, id, parentId, children) {
let config = {
id: id || 'id',
parentId: parentId || 'parentId',

@ -0,0 +1,280 @@
<template>
<div>
<el-card>
<el-form :model="filterQuery" size="mini" label-width="100px" v-show="showSearch">
<el-row>
<el-col :span="18">
<el-form-item class="query-form-item" label="UDI码:">
<el-input v-model="filterQuery.udiCode"
style="width: 97%"
placeholder="请扫描或输入UDI码"
clearable="true"
@keyup.enter.native="keyup_submit($event)"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="产品编码:">
<el-input v-model="filterQuery.unionCode" placeholder="DI/医保编码/商品条码"
style="width: 90%"
clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="产品通用名:">
<el-input v-model="filterQuery.cpmctymc" placeholder="产品通用名" clearable="true"
style="width: 90%"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="规格型号:">
<el-input v-model="filterQuery.ggxh" placeholder="规格型号" clearable="true"
style="width: 90%"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="对照条件:">
<el-select v-model="filterQuery.filterType" placeholder="请选择过滤对照条件"
style="width: 90%">
<el-option
v-for="item in filterList"
:key="item.filterType"
:label="item.sysName"
:value="item.filterType">
<span style="float: left">{{ item.sysName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="注册备案人:">
<el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产企业/注册备案人"
style="width: 90%"
clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="外部产品编码:">
<el-input v-model="filterQuery.thrPiId" placeholder="第三方产品编码"
style="width: 90%"
clearable="true"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="submit"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="instentProduct"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%;" @selection-change="handleSelectionChange" border key="1">
<el-table-column type="selection" width="55" :selectable="selectable"></el-table-column>
<el-table-column label="最小销售产品标识" prop="nameCode" width="140" show-overflow-tooltip></el-table-column>
<el-table-column label="主系统产品编码" prop="mainId" show-overflow-tooltip></el-table-column>
<el-table-column label="生产企业" prop="ylqxzcrbarmc" show-overflow-tooltip></el-table-column>
<el-table-column label="产品通用名" prop="cpmctymc" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip></el-table-column>
<el-table-column label="注册/备案凭证" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
<el-table-column label="器械类别" prop="qxlb" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="handleCurrentChange"
></pagination>
</el-card>
</div>
</template>
<script>
import {getUdiInfos, thirdSysDetail,} from "@/api/basic/product/udiRelevance";
import {filterByUuid} from "@/api/basic/product/udiInfo";
import {bindBasicHospProduct, saveBasicHospType,getBindList} from "@/api/basic/basicHospType";
export default {
props: {
rId: {
type: Object,
required: true,
},
closeDialog: {
type: Function,
required: true,
},
},
data() {
return {
filterQuery: {
page: 1,
limit: 20,
addType: 1,
thrPiId: null,
filterType: null,
diType: 1
},
productList: [],
loading: false,
showSearch: true,
productType: null,
editQuery: null,
editFormat: {},
pId: 0,
productRemarkSet: {},
list: [],
detailList: [],
sysList: [],
filterList: [],
total: 0,
thirdNo: "",
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
lockStatus: null,
unionCode: null,
udiCode: null,
ylqxzcrbarmc: "",
cpmctymc: "", thrPiId: null,
nameCode: "",
ggxh: null,
page: 1,
limit: 20,
addType: 1,
diType: 1
};
this.getList();
},
submit() {
this.loading = true;
this.filterQuery.page = 1;
this.getList();
},
getList() {
getBindList(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
selectable(row,index){
if(row.bindCheck==true){
return false;
}else{
return true;
}
},
hideSearch() {
this.showSearch = !this.showSearch;
},
handleSelectionChange(val) {
this.productList = val;
},
handleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getList();
},
instentProduct(){
if(this.productList.length<=0){
this.$message.error("请先选择解绑产品!");
return;
}
var ids=this.productList.map((item)=> item.id)
var data={code:this.rId,ids:ids}
bindBasicHospProduct(data).then((response) => {
if (response.code == 20000) {
this.$message.success("绑定成功");
this.closeDialog();
} else {
this.$message.error(response.message);
}
}).catch(() => {
});
},
},
mounted() {
},
components: {
},
created() {
this.filterQuery.bindId=this.rId
this.getList();
},
};
</script>
<style scoped>
.itemTag {
float: left;
text-align: right;
margin-top: 5px;
padding-right: 10px;
width: 35%;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
.edit-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 0px;
}
.el-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 6px;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
.el-table .cell.el-tooltip {
white-space: pre-wrap;
}
.form-title {
font-size: 16px;
font-family: Noto Sans SC;
font-weight: bold;
color: #303133;
padding-bottom: 17px;
padding-top: 17px;
}
</style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,316 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-form-item class="query-form-item" label="名称:">
<el-input
v-model="query.name"
clearable
placeholder="请输入名称"
></el-input>
</el-form-item>
<el-form-item>
<el-button-group style="margin-left: 10px;display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleSubForm( null, 'add')">新增</el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table
:data="list"
border
highlight-current-row
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column label="序号" type="index" ref="dataForm"></el-table-column>
<el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="code" label="编码"></el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="text" @click.native.stop="handleSubForm( scope.row, 'edit')">编辑</el-button>
<el-button type="text" @click.native.stop="handleDelInv(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
:title="formMap[formName]"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="subFormVisible"
width="60%"
top="5vh"
>
<el-form :model="subData" ref="dataForm" :rules="formRules" label-width="80px">
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="12" class="el-col">
<el-form-item label="上级菜单" prop="parentCode">
<treeselect
v-model="subData.parentCode"
:options="fromDeptOptions"
:normalizer="normalizer"
:show-count="true"
placeholder="选择上级菜单"
/>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="名称" prop="name" class="query-form-item">
<el-input
v-model="subData.name" style="width: 80%"
placeholder="请输入名称"
auto-complete="off"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row class="el-row" type="flex">
<el-col class="el-col">
<el-form-item label="备注" prop="remark" class="query-form-item">
<el-input
v-model="subData.remark"
type="textarea"
style="width: 90%"
auto-complete="off"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
<el-button
type="primary"
@click.native="forInvSubmit()"
>提交
</el-button
>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect";
import {getBasicHospType, getListMenu, saveBasicHospType,uodateBasicHospType,deleteBasicHospType} from "@/api/basic/basicHospType";
export default {
data() {
return {
//----------------------------------
query: {
name: null,
code: null,
status: "1",
// page: 1,
// limit: 10,
},
isShow: null,
loading: true,
list: [],
isExpandAll: true,
total: 0,
formMap: {
add: "新增",
edit: "编辑"
},
formName: null,
configParms: {},
currentCode: null,
currentRow: {name: "仓库"},
mutiInvMode: true,
subFormVisible: false,
subData: {},
fromDeptOptions: [],
thirdSubQuery: {
parentId: null,
name: null,
page: 1,
limit: 10,
thirdSysFk: "thirdId",
},
thrSubWareHouseVisible: false,
thrSubWarehouseData: [],
checkSubThrWarehouseRow: null,
subTotal: 0,
sysList: [],
sysSubList: [],
};
},
methods: {
//---------------------------------
onReset() { //
this.$router.push({
path: "",
});
this.query = {
name: "",
status: "",
};
this.getList();
},
onSubmit() { //
this.getList();
},
getList() {
this.loading = true;
getBasicHospType(this.query)
.then((response) => {
this.loading = false;
let invlist = response.data.list || [];
this.list = this.handleTree(invlist, "code", "parentCode");
})
.catch(() => {
this.loading = false;
this.total = 0;
this.list = [];
});
},
handleSubForm(data, formName) { //
this.formName = formName;
if (formName === "edit") {
this.subData = JSON.parse(JSON.stringify(data));
} else if (formName === "add") {
this.subData = {advanceType: false,};
}
this.getTreeselect();
this.subFormVisible = true;
},
hideForm() { // ---
this.formVisible = false;
this.subFormVisible = false;
this.resetForm();
return true;
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
forInvSubmit() { // ---
this.$refs["dataForm"].validate(valid => {
if (valid) {
if(this.subData.id!=null){
uodateBasicHospType(this.subData).then((response) => {
if (response.code == 20000) {
this.subFormVisible = false;
this.getList();
} else {
this.$message.error(response.message);
this.subFormVisible = false;
}
}).catch(() => {
this.subFormVisible = false;
});
}else{
saveBasicHospType(this.subData).then((response) => {
if (response.code == 20000) {
this.subFormVisible = false;
this.getList();
} else {
this.$message.error(response.message);
this.subFormVisible = false;
}
}).catch(() => {
this.subFormVisible = false;
});
}
}
});
this.getList();
},
/** 查询菜单下拉树结构 */
getTreeselect() {
getListMenu().then(response => {
this.fromDeptOptions = [];
const menu = {id: 0, name: '主类目', children: []};
menu.children = this.handleTree(response.data,"code", "parentCode");
this.fromDeptOptions.push(menu);
});
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.code,
label: node.name,
children: node.children
};
},
handleDelInv(row) {
if (row.id) {
this.$confirm("确认删除该节点吗?", "提示", {
type: "warning",
})
.then(() => {
this.deleteLoading = true;
let para = {id: row.id,code:row.code};
deleteBasicHospType(para)
.then((response) => {
this.deleteLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.getList();
this.$message.success("删除成功");
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
},
},
mounted() {
},
components: {
Treeselect
},
created() {
this.getList();
}
};
</script>
<style scoped>
.vue-treeselect >>> .vue-treeselect__placeholder {
font-size: 12px;
}
.vue-treeselect >>> .vue-treeselect__value-container {
font-size: 12px;
height: 30px;
}
.vue-treeselect >>> .vue-treeselect__control {
height: 20px;
}
</style>

@ -0,0 +1,271 @@
<template>
<div>
<el-card>
<el-form :model="filterQuery" size="mini" label-width="100px" v-show="showSearch">
<el-row>
<el-col :span="18">
<el-form-item class="query-form-item" label="UDI码:">
<el-input v-model="filterQuery.udiCode"
style="width: 97%"
placeholder="请扫描或输入UDI码"
clearable="true"
@keyup.enter.native="keyup_submit($event)"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="产品编码:">
<el-input v-model="filterQuery.unionCode" placeholder="DI/医保编码/商品条码"
style="width: 90%"
clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="产品通用名:">
<el-input v-model="filterQuery.cpmctymc" placeholder="产品通用名" clearable="true"
style="width: 90%"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="规格型号:">
<el-input v-model="filterQuery.ggxh" placeholder="规格型号" clearable="true"
style="width: 90%"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="对照条件:">
<el-select v-model="filterQuery.filterType" placeholder="请选择过滤对照条件"
style="width: 90%">
<el-option
v-for="item in filterList"
:key="item.filterType"
:label="item.sysName"
:value="item.filterType">
<span style="float: left">{{ item.sysName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="注册备案人:">
<el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产企业/注册备案人"
style="width: 90%"
clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="外部产品编码:">
<el-input v-model="filterQuery.thrPiId" placeholder="第三方产品编码"
style="width: 90%"
clearable="true"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="submit"></el-button>
<el-button type="primary" icon="el-icon-delect" @click="unBindProduct"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%;" @selection-change="handleSelectionChange" border key="1">
<el-table-column type="selection" width="55" ></el-table-column>
<el-table-column label="最小销售产品标识" prop="nameCode" width="140" show-overflow-tooltip></el-table-column>
<el-table-column label="主系统产品编码" prop="mainId" show-overflow-tooltip></el-table-column>
<el-table-column label="生产企业" prop="ylqxzcrbarmc" show-overflow-tooltip></el-table-column>
<el-table-column label="产品通用名" prop="cpmctymc" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip></el-table-column>
<el-table-column label="注册/备案凭证" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
<el-table-column label="器械类别" prop="qxlb" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="handleCurrentChange"
></pagination>
</el-card>
</div>
</template>
<script>
import {bindBasicHospProduct, saveBasicHospType,unbindBasicHospProduct,getBindList} from "@/api/basic/basicHospType";
export default {
props: {
rId: {
type: Object,
required: true,
},
closeDialog: {
type: Function,
required: true,
},
},
data() {
return {
filterQuery: {
page: 1,
limit: 20,
addType: 1,
thrPiId: null,
filterType: null,
diType: 1
},
productList: [],
loading: false,
showSearch: true,
productType: null,
editQuery: null,
editFormat: {},
pId: 0,
productRemarkSet: {},
list: [],
detailList: [],
sysList: [],
filterList: [],
total: 0,
thirdNo: "",
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
lockStatus: null,
unionCode: null,
udiCode: null,
ylqxzcrbarmc: "",
cpmctymc: "", thrPiId: null,
nameCode: "",
ggxh: null,
page: 1,
limit: 20,
addType: 1,
diType: 1
};
this.getList();
},
submit() {
this.loading = true;
this.filterQuery.page = 1;
this.getList();
},
getList() {
getBindList(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
hideSearch() {
this.showSearch = !this.showSearch;
},
handleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getList();
},
handleSelectionChange(val) {
this.productList = val;
},
unBindProduct(){
if(this.productList.length<=0){
this.$message.error("请先选择解绑产品!");
return;
}
var ids=this.productList.map((item)=> item.id)
var data={code:this.rId,ids:ids}
unbindBasicHospProduct(data).then((response) => {
if (response.code == 20000) {
this.$message.success("解绑成功");
this.closeDialog();
} else {
this.$message.error(response.message);
}
}).catch(() => {
});
},
},
mounted() {
},
components: {
},
created() {
this.filterQuery.bindCode=this.rId
this.getList();
},
};
</script>
<style scoped>
.itemTag {
float: left;
text-align: right;
margin-top: 5px;
padding-right: 10px;
width: 35%;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
.edit-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 0px;
}
.el-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 6px;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
.el-table .cell.el-tooltip {
white-space: pre-wrap;
}
.form-title {
font-size: 16px;
font-family: Noto Sans SC;
font-weight: bold;
color: #303133;
padding-bottom: 17px;
padding-top: 17px;
}
</style>
Loading…
Cancel
Save