You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-spms-vue/src/views/basic/product/UdiInfoSelectRel.vue

677 lines
19 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div>
<div style="display: flex; width: 100%;">
<span class="checkitemTag"></span>
<el-button
style="margin-right: 20px;margin-top:-15px;float: right"
type="primary"
size="mini"
icon="el-icon-bottom-left"
@click="combine"
>关联选入
</el-button
>
</div>
<el-card class="el-card" v-if="checked">
<div>
<el-form :model="erpQuery" size="mini" label-width="125px" v-show="showThrSearch">
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="产品编码:">
<el-input
v-model="erpQuery.code"
placeholder="产品编码/商品条码/医保编码"
clearable="true"
@keyup.enter.native="keyupErp_submit($event)"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="产品名称:">
<el-input v-model="erpQuery.name"
clearable="true"
placeholder="产品名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="注册/备案凭证号:">
<el-input v-model="erpQuery.registerNo"
clearable="true"
placeholder="注册/备案凭证号"></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="erpQuery.manufactory"
clearable="true"
placeholder="生产厂家"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="规格型号:">
<el-input
v-model="erpQuery.spec"
clearable="true"
placeholder="规格型号"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="第三方系统:">
<el-select v-model="thirdSysFk" placeholder="请选择第三方系统" disabled="true" style="width: 100%">
<el-option
v-for="item in thirdSys"
:key="item.value"
:label="item.thirdName"
:value="item.thirdId">
<span style="float: left">{{ item.thirdName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.thirdId }}</span>
</el-option>
</el-select>
</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="hideThrSearch">显示/隐藏搜索栏</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="searchErpList">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="getSuperSeaech" size="mini"
>国家同步库查询
</el-button
>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table
:data="erpList"
border
style="width: 100%"
highlight-current-row="true"
v-loading="erpLloading"
@current-change="handleErpChange"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品编码" prop="code"></el-table-column>
<el-table-column label="产品名称" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="计量单位" prop="measname" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip></el-table-column>
<el-table-column label="注册/备案凭证号" prop="registerNo" show-overflow-tooltip></el-table-column>
<el-table-column label="生产厂家" prop="manufactory" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="pageTotal>0"
:total="pageTotal"
:page.sync="erpQuery.page"
:limit.sync="erpQuery.limit"
@pagination="getErpList"
/>
</div>
</el-card>
<el-card class="el-card">
<div>
<el-form :model="unionQuery" size="mini" label-width="125px" v-show="showDiSearch">
<el-row>
<el-col :span="6">
<el-form-item class="query-form-item" label="DI编码:">
<el-input
v-model="unionQuery.nameCode"
size="mini"
placeholder="请输入完整DI"
clearable="true"
@keyup.enter.native="keyup_submit($event)"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="医疗器械注册人:">
<el-select
v-model="unionQuery.ylqxzcrbarmc"
filterable
remote
clearable="true"
style="width: 100%"
reserve-keyword
placeholder="医疗器械注册人"
:remote-method="findMethod"
:loading="loading"
>
<el-option
v-for="item in fromOptions"
:key="item.ylqxzcrbarmc"
:label="item.ylqxzcrbarmc"
:value="item.ylqxzcrbarmc"
>
<span style="float: left">{{ item.ylqxzcrbarmc }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="器械通用名称:">
<el-input
:disabled="unionQuery.ylqxzcrbarmc==null || unionQuery.ylqxzcrbarmc==''"
v-model="unionQuery.cpmctymc"
size="mini"
clearable="true"
placeholder="器械通用名称"
></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="unionQuery.ggxh"
placeholder="规格型号"
clearable="true"
size="mini"
:disabled="(unionQuery.cpmctymc=='' && unionQuery.nameCode=='' && (unionQuery.ylqxzcrbarmc==null || unionQuery.ylqxzcrbarmc==''))"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="query-form-item" label="注册/备案凭证号:">
<el-input
v-model="unionQuery.zczbhhzbapzbh"
clearable="true"
:disabled="(unionQuery.cpmctymc=='' && unionQuery.nameCode=='' && (unionQuery.ylqxzcrbarmc==null || unionQuery.ylqxzcrbarmc==''))"
placeholder="注册/备案凭证号"
size="mini"
></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="hideDiSearch">显示/隐藏搜索栏</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onDiReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="serchList">查询</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table
:data="udidlList"
style="width: 100%"
@row-click="intentDetail"
border
v-loading="loading"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionUdiChange"
>
<el-table-column
type="selection"
width="55"
:selectable="checkSelectable"
></el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="产品标识"
prop="nameCode"
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="ylqxzcrbarmc"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="注册证编号"
prop="zczbhhzbapzbh"
show-overflow-tooltip
></el-table-column>
<el-table-column label="操作" >
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="diDetail(scope.row)"
>详情
</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="unionQuery.page"
:limit.sync="unionQuery.limit"
@pagination="getList"
/>
</div>
</el-card>
<el-dialog
title="器械信息详情"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="selectDialog"
width="65%"
append-to-body
v-if="selectDialog"
>
<selectDiDetail :editQuery="diDetails"
></selectDiDetail>
</el-dialog>
-
</div>
</template>
<script>
import {getUdiInfos, filterCompany} from "@/api/basic/product/udiInfo";
import {superSearch} from "@/api/basic/udiInfo";
import {combineUdi} from "@/api/basic/product/udiRelevance";
import {getBasicThirdSys} from "@/api/thrsys/basicThirdSys";
import {getInvbasdoc} from "@/api/basic/product/getErps";
import selectDiDetail from "@/views/basic/product/SelectDIDetailDialog";
export default {
name: "closeDialog",
props: {
closeDialog: {
type: Function,
required: true,
},
},
data() {
return {
//第三方产品信息:
showThrSearch: true,
erpQuery: {
code: null,
name: "",
thirdSys: null,
spec: null,
manufactory: null,
registerNo: null,
page: 1,
limit: 10,
},
thirdSys: [],
thirdSysFk: null,
fromOptions: [],
checked: true,
udidlList: [],
erpList: [],
pageTotal: 0,
total: 0,
currentRow: null,
loading: false,
erpLloading: false,
multipleUdiSelection: [],
//DI器械信息
showDiSearch: true,
unionQuery: {
page: 1,
limit: 20,
nameCode: "",
cpmctymc: "",
ylqxzcrbarmc: null,
ggxh: "",
zczbhhzbapzbh: "",
isCheck: 1
},
diDetails: null,
selectDialog: false,
//关联选入
combineQuery: {
thirdId: "",
keys: [],
thirdSys: null,
manufactory: null,
price: null,
erpName: null,
measname: null,
},
};
},
methods: {
//第三方产品信息:
hideThrSearch() {
this.showThrSearch = !this.showThrSearch;
},
onReset() {
this.$router.push({
path: "",
});
this.erpQuery = {
code: null,
name: "",
thirdSys: null,
spec: null,
manufactory: null,
registerNo: null,
page: 1,
limit: 10,
};
this.getErpList();
},
searchErpList() {
this.erpQuery.page = 1;
this.getErpList();
},
handleErpPageChange(val) {
this.erpQuery.page = val;
this.getErpList();
},
getErpList() {
this.erplLoading = true;
this.erpQuery.thirdSys = this.thirdSysFk;
getInvbasdoc(this.erpQuery)
.then((response) => {
this.erplLoading = false;
if (response.code == 20000) {
this.erpList = response.data.list || [];
this.pageTotal = response.data.total || 0;
} else {
this.$message.error(response.message);
this.erpList = [];
this.pageTotal = 0;
}
})
.catch(() => {
this.erplLoading = false;
this.erpList = [];
this.pageTotal = 0;
});
},
keyupErp_submit(event) {
this.erpQuery.page = 1;
this.getErpList();
event.target.select();
},
//DI器械信息
hideDiSearch() {
this.showDiSearch = !this.showDiSearch;
},
onDiReset() {
this.$router.push({
path: "",
});
this.unionQuery = {
page: 1,
limit: 20,
nameCode: "",
cpmctymc: "",
ylqxzcrbarmc: null,
ggxh: "",
zczbhhzbapzbh: "",
isCheck: 1
};
this.getErpList();
},
serchList() {
this.unionQuery.page = 1;
this.getList();
},
getSuperSeaech() {
this.$confirm("此操作将访问国家库查询DI数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
if (this.unionQuery.nameCode == "") {
this.$message.warning("请输入完成DI信息进行查询");
return;
}
this.loading = true;
superSearch(this.unionQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.udidlList = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.udidlList = [];
this.total = 0;
});
})
.catch(() => {
});
},
getList() {
if (
this.unionQuery.nameCode == "" &&
this.unionQuery.cpmctymc == "" &&
this.unionQuery.ylqxzcrbarmc == "" &&
this.unionQuery.ggxh == ""
) {
this.$message.warning("请输入查询条件");
return;
}
this.loading = true;
getUdiInfos(this.unionQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.udidlList = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.udidlList = [];
this.total = 0;
});
},
checkSelectable(row) {
return !row.check;
},
handleCurrentChange(val) {
this.unionQuery.page = val;
this.getList();
},
tableRowClassName({row}) {
if (row.checked) return "warning-row";
return "";
},
handleErpChange(val) {
console.log(val);
this.currentRow = val;
},
diDetail(row) {
this.diDetails = row;
this.selectDialog = true;
},
intentBack() {
this.$router.go(-1);
},
confirmCombine(ids) {
this.combineQuery.keys = ids;
this.combineQuery.thirdSys = this.thirdSysFk;
if (this.checked) {
this.combineQuery.thirdId = this.currentRow.code;
this.combineQuery.erpName = this.currentRow.name;
} else {
this.combineQuery.thirdId = "";
}
this.combineQuery.manufactory = this.currentRow.manufactory;
this.combineQuery.price = this.currentRow.price;
this.combineQuery.measname = this.currentRow.measname;
combineUdi(this.combineQuery)
.then((response) => {
if (response.code == 20000) {
this.$emit("closeUdi", true);
} else {
// this.$emit("closeUdi", false);
this.$message.warning(response.message);
}
})
.catch(() => {
this.$emit("closeUdi", false);
});
},
combine() {
let selectData = this.multipleUdiSelection;
var ids = [];
selectData.forEach((obj) => {
ids.push(obj.uuid);
});
if (this.currentRow == null) {
this.$message.warning("未选择第三方产品信息");
return;
}
if (ids.length == 0) {
this.$message.warning("未选择医疗器械产品信息");
return;
}
console.log("this.currentRow.checked =" + this.currentRow.checked);
if (this.currentRow != null && this.currentRow.checked) {
this.$confirm("产品编码:" + this.currentRow.code + "已被添加是否继续添加", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.confirmCombine(ids);
})
.catch(() => {
});
return;
} else {
this.confirmCombine(ids);
}
},
intentDetail(row) {
this.$emit("productInfo", row);
this.closeDialog();
},
handleSelectionUdiChange(val) {
this.multipleUdiSelection = val;
},
keyup_submit(event) {
this.unionQuery.page = 1;
this.getList();
event.target.select();
},
getBasicThirdSys() {
let query = {
enabled: true,
mainSys: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.thirdSysFk = this.thirdSys[0].thirdId;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
findMethod(query) {
console.log(query);
let cQuery = {
ylqxzcrbarmc: query,
page: 1,
limit: 10,
};
filterCompany(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data || [];
})
.catch(() => {
this.loading = false;
this.options = [];
});
},
},
created() {
this.getBasicThirdSys();
},
components: {
selectDiDetail,
},
};
</script>
<style scoped>
.checkitemTag {
float: left;
text-align: left;
margin-top: 5px;
width: 100%;
}
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
div /deep/ .el-table .warning-row {
background: #bebebe;
}
div /deep/ .el-table .success-row {
background: #ffffff;
}
</style>