LiaoNingDangAn/src/views/productsMsg/drugArchives/yaopinbapz.vue

768 lines
22 KiB

<template>
<div class="container">
<div class="tabs">
<div class="headerText">
<div class="searchP">统计分析</div>
</div>
<div>
<MapCars leafletitle="药品" echartstitle="药品" @arealist="arealist" ref="mapcars" v-if="MapCarsshow" />
</div>
</div>
<div class="tabs">
<div class="headerText">
<div class="searchP">查询条件</div>
</div>
<el-form ref="form1" :model="form1">
<div style="margin-top: 10px">
<!-- <el-row>
<el-col :span="21">
<el-form-item label="查询条件">
<el-input v-model="form1.name" placeholder="请输入产品名称"></el-input>
</el-form-item>
</el-col>
</el-row> -->
</div>
<el-row>
<el-col :span="8">
<el-form-item label="产品名称">
<el-input v-model="form1.yptymc" placeholder="请输入产品名称" clearable @clear="isclear"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="药品分类">
<el-select v-model="form1.ypfl" placeholder="请选择药品分类" clearable @clear="isclear">
<el-option v-for="item in ypType" :key="item" :label="item" :value="item">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="批准文号">
<el-input v-model="form1.yppzwh" placeholder="请输入批准文号" clearable @clear="isclear"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="生产企业">
<el-input v-model="form1.scqy" placeholder="请输入生产企业" clearable @clear="isclear"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="剂型">
<el-select v-model="form1.jx" placeholder="请选择剂型" multiple clearable @clear="isclear">
<el-option v-for="item in jxType" :key="item" :label="item" :value="item">
</el-option>
</el-select>
</el-form-item></el-col>
<el-col :span="8">
<el-form-item label="持有人">
<el-input v-model="form1.ypssxkcyr" placeholder="请输入持有人" clearable @clear="isclear"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="8">
<el-form-item label="药品编码">
<el-input v-model="form1.ypbm" placeholder="请输入药品编码" clearable @clear="isclear"></el-input>
</el-form-item>
</el-col> -->
<el-col :span="8">
<el-form-item label="特殊药品类型">
<el-select v-model="form1.tsypglfl" placeholder="请选择特殊药品类型" clearable @clear="isclear">
<el-option v-for="item in teshu" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="批准日期">
<el-date-picker v-model="pzrqStartTime" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable @change="changeisclear">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="批准文号期限">
<el-date-picker v-model="yppzwhyxqStartTime" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable @change="changeisclear">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="8">
<el-form-item label="药品编码">
<el-input v-model="form1.ypbm" placeholder="请输入药品编码" clearable @clear="isclear"></el-input>
</el-form-item>
</el-col> -->
<dishi :form1="form1" @isclear="isclear"></dishi>
</el-row>
<div class="footBox" v-show="bthshow">
<el-button icon="el-icon-refresh-left" @click="reset">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="searchList">查询</el-button>
<el-button type="success" icon="el-icon-circle-plus-outline" @click="collapsechange(0)">高级查询</el-button>
</div>
<AdvancedSearch :form1="form1" v-show="!bthshow" @reset="reset" @searchList="searchList"
@collapsechange="collapsechange" @isclear="isclear">
</AdvancedSearch>
</el-form>
</div>
<div class="tabsBottom">
<div class="foot-main">
<div class="headerText">
<div class="searchP">药品列表</div>
</div>
<div class="exportBtn">
<div>
<div class="mybuttom" :class="btnShow == item.value ? 'mybuttomshow' : ''" round
v-for="(item, index) in btnArr" @click="xuanzelist(item)">{{
item.label
}}</div>
</div>
<el-button type="primary" icon="el-icon-edit-outline" @click="exportList()">导出excel</el-button>
</div>
<section class="table-box">
<div class="table-item">
<el-table v-loading="loading" :data="tableData" border height="500" style="width: 100%"
@sort-change="mySortChange" ref="tableRef">
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column label="产品名称" min-width="160" align="center">
<template slot-scope="scope">
{{ scope.row.yptymc }}
</template>
</el-table-column>
<el-table-column label="批准文号" min-width="160" align="center">
<template slot-scope="scope">
{{ scope.row.yppzwh }}
</template>
</el-table-column>
<el-table-column label="药品分类" min-width="120" align="center">
<template slot-scope="scope">
{{ scope.row.ypfl }}
</template>
</el-table-column>
<el-table-column label="剂型" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.jx }}
</template>
</el-table-column>
<el-table-column label="规格" min-width="120" align="center">
<template slot-scope="scope">
{{ scope.row.gg }}
</template>
</el-table-column>
<el-table-column label="上市许可持有人" min-width="190" align="center">
<template slot-scope="scope">
{{ scope.row.ypssxkcyr }}
</template>
</el-table-column>
<el-table-column label="生产企业" min-width="170" align="center">
<template slot-scope="scope">
{{ scope.row.scqy }}
</template>
</el-table-column>
<el-table-column label="批准日期" min-width="140" align="center" :sortable="sortableshow">
<template slot-scope="scope">
{{ scope.row.pzrq }}
</template>
</el-table-column>
<el-table-column label="批准文号期限" min-width="170" align="center" :sortable="sortableshow">
<template slot-scope="scope">
{{ scope.row.yppzwhyxq }}
</template>
</el-table-column>
<el-table-column label="生产地址" min-width="170" align="center">
<template slot-scope="scope">
<div class="norepet">{{ scope.row.scdz }}</div>
</template>
</el-table-column>
<el-table-column label="操作" width="180" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="primary" @click="toDetail(scope.row, 1)">详情</el-button>
<el-button type="primary" @click="mygotohuaxiang(scope.row, 1)">产品画像</el-button>
</template>
</el-table-column>
</el-table>
</div>
</section>
<pagination :total="total" :page="form.current" :limit="form.size" @pagination="getPagination"
:current-page.sync="form.current" :page-sizes="[5, 10, 20]"></pagination>
</div>
</div>
<el-dialog title="提示" :visible.sync="showCK" width="30%">
<span>{{ src }}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDC()"> </el-button>
<el-button type="primary" @click="openDC()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { download, dcyp } from "../../../api/archives/updata";
import { Notification, MessageBox, Message, Loading, TabPane } from "element-ui";
import MapCars from "@/views/components/MapCars.vue";
import AdvancedSearch from "@/views/components/AdvancedSearch";
import dishi from "@/views/components/AdvancedSearch/dishi.vue";
export default {
components: {
MapCars,
AdvancedSearch,
dishi
},
data() {
return {
sortableshow: true,
dishi: ["沈阳市",
"大连市",
"鞍山市",
"抚顺市",
"本溪市",
"丹东市",
"锦州市",
"营口市",
"阜新市",
"辽阳市",
"盘锦市",
"铁岭市",
"朝阳市",
"葫芦岛市",
"沈抚示范区",],
options1: [
{
value: 0,
label: "一般",
},
{
value: 1,
label: "严重",
},
],
teshu: [
{
value: "麻醉药品",
label: "麻醉药品",
}, {
value: "第一类精神药品",
label: "第一类精神药品",
}, {
value: "第二类精神药品",
label: "第二类精神药品",
}, {
value: "医疗用毒性药品",
label: "医疗用毒性药品",
}, {
value: "药品类易制毒化学品",
label: "药品类易制毒化学品",
}, {
value: "其他",
label: "其他",
}, {
value: "生物制品(其他)",
label: "生物制品(其他)",
}, {
value: "疫苗",
label: "疫苗",
}, {
value: "集中采集药品",
label: "集中采集药品",
}, {
value: "血液制品",
label: "血液制品",
},
],
MapCarsshow: true,
bthshow: false,
//===========
loading: false,
tableData: [],
total: 0,
pzrqStartTime: null,
yppzwhyxqStartTime: null,
form1: {
yptymc: "", //产品名称
jx: "", //剂型
yppzwh: "", //批准文号
scqy: "",//生产单位
ypfl: "", //药品分类
name: "",
ypssxkcyr: "", // 持有人
ypbm: "", //药品编码
blfymc: "", //是否有不良反应
// 统一查询
cjxm: "", // 检验项目
jyslbh: "", //检验受理编号
cybh: "", //抽样编号
cyjb: "", // 抽样级别
cyrq: "", // 抽样日期
blfybgbh: "", // 不良反应报告编号
bglx: "", // 不良反应类型
fsnf: "", // 发生年份
zzjyjl: "",//结论
tsypglfl: "",
area: this.$store.getters.usersort,
myEntrust: "全部",
type: ""
},
form: {
size: 20,
current: 1,
area: this.$store.getters.usersort,
myEntrust: "全部",
type: ""
},
//药品分类
ypType: ["中药", "生物制品", "化学药品"],
//剂型
jxType: [
"散剂",
"片剂",
"颗粒剂",
"胶囊剂",
"溶液剂",
"乳剂",
"混悬剂",
"注射剂",
"喷雾剂",
"气雾剂",
"原料药"
],
shif: ["是", "否"],
btnArr: [{
label: '全部',
iscss: "warning",
value: "全部"
}, {
label: '自行生产',
iscss: "success",
value: '自产'
}, {
label: '委托生产',
iscss: "primary",
value: '委受托'
}],
btnShow: "全部",
jieliuShow: true,
loadA: null,
showCK: false,
src: "",
};
},
mounted() {
console.log(123, this.$store.state.tags.myquery);
if (JSON.stringify(this.$store.state.tags.myquery) != '{}') {
for (let i in this.form1) {
this.form1[i] = this.$store.state.tags.myquery[i] || "";
}
this.$store.commit('ADD_QUERY', {})
}
console.log(this.form1);
this.searchList();
},
created() {
},
methods: {
mySortChange(e) {
this.form1.pzrqSort = ""
this.form1.yppzwhyxqSort = ""
if (e.column.label == "批准日期") {
this.form1.pzrqSort = e.order == "ascending" ? 1 : 2
}
if (e.column.label == "批准文号期限") {
this.form1.yppzwhyxqSort = e.order == "ascending" ? 1 : 2
}
this.searchList()
},
// 全部 自产 委受托
xuanzelist(item) {
this.btnShow = item.value
if (item.label == '全部') {
this.form1.myEntrust = '全部';
this.form1.type = "";
} else {
this.form1.myEntrust = ''
this.form1.type = item.value;
}
this.searchList();
// if(item == '全部') {}
// if(item == '自产') {}
// if(item == '委托') {}
},
// 点击input上的x号
changeisclear(e) {
if (e == null) {
this.isclear()
}
},
isclear() {
this.searchList()
},
// 展开收起按钮
collapsechange(e) {
if (e == 0) {
this.bthshow = false
} else {
this.bthshow = true
}
},
// echarts lefet 回调函数
arealist(area) {
this.form.area = area
this.form1.area = area
this.chinaCosmetics()
},
// 确定导出
openDC() {
this.showCK = false;
this.loadA = Loading.service({
text: "正在下载数据,请稍候",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
dcyp(this.form1).then((res) => {
const blob = new Blob([res], { type: res.type });
const link = document.createElement("a");
link.href = window.URL.createObjectURL(blob);
link.style.display = "none";
link.download = "注册备案品种" + ".xlsx";
link.click();
this.loadA.close();
this.$message({
type: "success",
message: "导出成功",
}).catch((err) => {
this.$message({
type: "info",
message: "导出失败",
});
});
});
},
// 取消导出
closeDC() {
this.showCK = false;
this.$message({
type: "info",
message: "已取消导出",
});
},
// 导出按钮
exportList() {
this.src = `确定导出${this.form1.yptymc ? `产品名称为${this.form1.yptymc}` : ""
}${this.form1.ypfl ? `药品分类为${this.form1.ypfl}` : ""}${this.form1.yppzwh ? `批准文号为${this.form1.yppzwh}` : ""
}${this.form1.scqy ? `生产单位为${this.form1.scqy}` : ""}${this.form1.jx ? `剂型为${this.form1.jx}` : ""
}数据吗?`;
this.showCK = true;
},
// 查询按钮
jieliuFunc() {
if (this.jieliuShow) {
this.chinaCosmetics();
this.jieliuShow = false;
setTimeout(() => {
this.jieliuShow = true;
}, 500);
} else {
this.$message("点击过快");
}
},
//去内嵌页面 code=国药准字H20234319&name=阿加曲班注射液&type=1
toDetail(e, type) {
if (type == 1) {
setTimeout(() => {
this.$router.push({
path: `/cosmeticsDetail`,
query: { type: "2", data: e.yppzwh },
});
}, 1000);
} else {
}
},
//搜索
searchList() {
if (this.pzrqStartTime) {
this.form1.pzrqStartTime = this.pzrqStartTime[0]
this.form1.pzrqEndTime = this.pzrqStartTime[1]
} else {
this.form1.pzrqStartTime = ""
this.form1.pzrqEndTime = ""
}
if (this.yppzwhyxqStartTime) {
this.form1.yppzwhyxqStartTime = this.yppzwhyxqStartTime[0]
this.form1.yppzwhyxqEndTime = this.yppzwhyxqStartTime[1]
} else {
this.form1.yppzwhyxqStartTime = ""
this.form1.yppzwhyxqEndTime = ""
}
this.form.current = 1;
for (let i in this.form1) {
this.form[i] = this.form1[i];
}
this.jieliuFunc();
},
// 分页
getPagination(e) {
this.form.current = e.page;
this.form.size = e.limit;
this.chinaCosmetics(1);
},
//重置
reset(type) {
this.pzrqStartTime = ""
this.yppzwhyxqStartTime = ""
this.$refs.tableRef.clearSort(); // 清除排序
this.btnShow = '全部'
this.form1 = {
//产品名称
yptymc: "",
//剂型
jx: "",
//批准文号
yppzwh: "",
//生产单位
scqy: "",
//药品分类
ypfl: "",
// 统一查询
name: "",
// 是否抽检
ypssxkcyr: "",
ypbm: "",
//是否有不良反应
blfymc: "",
// 统一查询
cjxm: "",
jyslbh: "",
cybh: "",
cyjb: "",
cyrq: "",
blfybgbh: "",
bglx: "",
fsnf: "",
myEntrust: "全部",
type: "",
zzjyjl: "",//结论
tsypglfl: "",
area: this.$store.getters.usersort
};
this.form = {
size: 20,
current: 1,
area: this.$store.getters.usersort,
myEntrust: "全部",
type: ""
};
if (type != 1) {
this.$refs["mapcars"].showinitCityLayer()
}
this.jieliuFunc();
},
// 药品
async chinaCosmetics() {
this.loading = true;
let msg1 = await this.$api.cosmetics.vRdgYpwhGxwz(this.form);
this.tableData = msg1.data.records;
this.total = msg1.data.total;
this.form.size = msg1.data.size;
this.form.current = msg1.data.current;
this.loading = false;
},
},
beforeRouteLeave(to, from, next) {
if (to.path != '/cosmeticsDetail') {
this.reset(1)
this.MapCarsshow = false
}
next()
},
activated(to, from, next) {
this.bthshow = false
this.MapCarsshow = true
}
};
</script>
<style lang="scss" scoped>
::v-deep .el-dialog:not(.is-fullscreen) {
margin-top: 30vh !important;
}
::v-deep .el-dialog__body {
padding: 15px;
}
::v-deep .el-select {
width: 100% !important;
}
.container {
height: 100%;
// overflow: auto;
background: #f2f2f2;
.headerText {
width: 100%;
padding: 10px 20px;
border-bottom: 1px solid #f2f3f5;
color: #323233;
font-size: 20px;
font-weight: bold;
.searchP {
position: relative;
cursor: pointer;
&::before {
content: "";
width: 78px;
height: 3px;
background: #1349c5;
position: absolute;
bottom: -10px;
}
}
}
.tabs {
width: 100%;
background: #fff;
margin-bottom: 10px;
}
}
//===================
::v-deep .el-button--medium {
padding: 8px;
}
.footBox {
width: 97.5%;
text-align: center;
padding-bottom: 10px;
}
.tabsBottom {
// height: 70%;
.foot-main {
height: 100%;
// min-height: 600px;
width: 100%;
background: white;
}
}
.exportBtn {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 20px;
}
.table-box {
overflow-y: auto;
padding: 0 20px;
.table-item {}
}
.pagination {
display: flex;
justify-content: space-between;
padding: 15px 20px;
}
::v-deep .el-table {
overflow: auto;
}
::v-deep .logformitem {
.el-form-item__label {
line-height: 20px;
}
}
.title-box {
position: relative;
padding-left: 30px;
font-size: 16px;
font-weight: 600;
margin: 10px 0;
color: #1349c5;
}
.mybuttom {
margin: 0 10px;
display: inline-block;
padding: 5px 20px;
background-color: rgba(30, 128, 235, 0.1);
border-radius: 8px;
border: 1px solid #1e80eb;
font-size: 14px;
color: #1e80eb;
font-family: Source Han Sans CN;
cursor: pointer;
&:hover {
background-color: #1e80eb;
color: #ffffff;
border: 1px solid #1e80eb;
}
}
.mybuttomshow {
background-color: #1e80eb;
color: #ffffff;
border: 1px solid #1e80eb;
}
::v-deep .el-date-editor--daterange.el-input,
.el-date-editor--daterange.el-input__inner,
.el-date-editor--timerange.el-input,
.el-date-editor--timerange.el-input__inner {
width: 100%;
}
::v-deep.el-date-editor .el-range__close-icon {
color: #555555;
&:hover {
font-size: 18px;
color: #000;
}
}
</style>