You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LiaoNingDangAn/src/views/productsMsg/components/health.vue

376 lines
9.4 KiB

2 years ago
<template>
2 years ago
<div class="container">
2 years ago
<div class="tabs">
<div class="headerText">
<div class="searchP">查询条件</div>
</div>
2 years ago
<el-form ref="form1" :model="form1" label-width="150px">
2 years ago
<div style="margin-top: 10px">
<el-row>
2 years ago
<el-col :span="7">
<el-form-item label="产品名称">
2 years ago
<el-input
v-model="form1.cpmc"
placeholder="请输入产品名称"
></el-input>
2 years ago
</el-form-item>
</el-col>
2 years ago
<el-col :span="7">
<el-form-item label="产品类别">
2 years ago
<el-select v-model="form1.cplb" placeholder="请选择产品类别">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.label"
2 years ago
>
2 years ago
</el-option>
</el-select>
</el-form-item>
</el-col>
2 years ago
<el-col :span="7">
<el-form-item label="生产企业">
2 years ago
<el-input
v-model="form1.scqy"
placeholder="请输入生产企业"
></el-input>
2 years ago
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="7">
<el-form-item label="注册证编号或备案编号">
2 years ago
<el-input
v-model="form1.zczh"
placeholder="请输入注册证编号或备案编号"
></el-input>
2 years ago
</el-form-item>
</el-col>
2 years ago
</el-row>
2 years ago
</div>
2 years ago
</el-form>
<div class="footBox">
<el-button icon="el-icon-refresh-left" @click="reset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="searchList"
>查询</el-button
>
</div>
</div>
<div class="tabsBottom">
<div class="foot-main">
<div class="headerText">
<div class="searchP">产品列表</div>
</div>
<div class="exportBtn">
2 years ago
<el-button
type="primary"
icon="el-icon-edit-outline"
@click="exportList()"
>导出</el-button
>
2 years ago
</div>
<section class="table-box">
<div class="table-item">
<el-table
v-loading="loading"
:data="tableData"
border
2 years ago
height="43vh"
align="center"
>
<el-table-column type="selection" width="35" align="center" />
<el-table-column
type="index"
label="序号"
align="center"
width="50"
/>
<el-table-column label="产品名称" prop="cpmc" align="center">
</el-table-column>
<el-table-column
label="产品类型"
prop="cplx"
align="center"
width="100"
></el-table-column>
<el-table-column
label="生产企业"
prop="zcsqr"
align="center"
></el-table-column>
2 years ago
<el-table-column
label="产品管理类别"
prop="cplb"
align="center"
width="100"
2 years ago
></el-table-column>
<el-table-column
label="注册证编号/备案编号"
prop="zczh"
align="center"
width="200"
>
2 years ago
</el-table-column>
2 years ago
<el-table-column
label="操作"
class-name="small-padding fixed-width"
width="120"
align="center"
2 years ago
>
<template slot-scope="scope">
<el-button
size="mini"
plain
type="primary"
@click="toDetail(scope.row)"
>详情</el-button
>
<!-- <el-button size="mini" plain type="warning">编辑</el-button> -->
2 years ago
</template>
</el-table-column>
</el-table>
</div>
</section>
<pagination
:total="total"
:page="form.current"
:limit="form.size"
2 years ago
@pagination="getPagination"
:current-page.sync="form.current"
2 years ago
></pagination>
2 years ago
</div>
2 years ago
</div>
2 years ago
<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>
2 years ago
</div>
</template>
2 years ago
<script>
2 years ago
import { download, dcylqx } from "../../../api/archives/updata";
import { Notification, MessageBox, Message, Loading } from "element-ui";
2 years ago
export default {
components: {},
data() {
return {
2 years ago
//===========
loading: false,
tableData: [],
2 years ago
total: 0,
2 years ago
options: [
2 years ago
{
2 years ago
value: 1,
label: "第一类",
2 years ago
},
{
2 years ago
value: 2,
label: "第二类",
2 years ago
},
],
2 years ago
form1: {
cplb: "",
2 years ago
cpmc: "",
scqy: "",
zczh: "",
2 years ago
size: 10,
current: 1,
2 years ago
},
form: {
size: 10,
current: 1,
},
jieliuShow: true,
2 years ago
loadA: null,
showCK: false,
src: "",
2 years ago
};
},
2 years ago
mounted() {},
created() {
this.chinaCosmetics();
2 years ago
},
methods: {
2 years ago
openDC() {
this.showCK = false;
this.loadA = Loading.service({
text: "正在下载数据,请稍候",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
dcylqx(this.form1).then((res) => {
const blob = new Blob([res],{type:res.type});
const link = document.createElement("a");
link.style.display = 'none'
link.href = window.URL.createObjectURL(blob);
link.download = "医疗器械"+ '.xlsx';
link.click();
this.loadA.close();
this.$message({
type: "success",
message: "导出成功",
});
});
},
closeDC() {
this.showCK = false;
this.$message({
type: "info",
message: "已取消导出",
});
},
exportList() {
this.src = `确定导出${
this.form1.cpmc ? `产品名称为${this.form1.cpmc}` : ""
}${this.form1.cplb ? `产品类别为${this.form1.cplb}` : ""}${
this.form1.scqy ? `生产企业为${this.form1.scqy}` : ""
}${
this.form1.zczh ? `注册证编号或备案编号为${this.form1.zczh}` : ""
}数据吗?`;
this.showCK = true;
},
jieliuFunc() {
if (this.jieliuShow) {
this.chinaCosmetics();
this.jieliuShow = false;
setTimeout(() => {
this.jieliuShow = true;
}, 3000);
} else {
this.$message("点击过快");
}
},
2 years ago
//去内嵌页面
toDetail(e) {
2 years ago
this.$router.push({
path: `/cosmeticsDetail`,
query: { type: "3", data: e.zczh },
2 years ago
});
2 years ago
},
2 years ago
//搜索
searchList() {
this.form.current = 1;
for (let i in this.form1) {
this.form[i] = this.form1[i];
}
this.jieliuFunc();
2 years ago
},
getPagination(e) {
this.form.current = e.page;
this.form.size = e.limit;
2 years ago
this.chinaCosmetics();
},
//重置
reset() {
this.form1 = {
cplb: "",
2 years ago
cpmc: "",
scqy: "",
zczh: "",
2 years ago
size: 10,
current: 1,
};
this.form = {
size: 10,
current: 1,
};
this.jieliuFunc();
2 years ago
},
async chinaCosmetics() {
this.loading = true;
let msg1 = await this.$api.apparatus.apparatusList(this.form);
2 years ago
this.tableData = msg1.data.records;
this.total = msg1.data.total;
this.form.size = msg1.data.size;
this.form.current = msg1.data.current;
2 years ago
this.loading = false;
2 years ago
},
},
};
</script>
2 years ago
<style lang="scss" scoped>
2 years ago
::v-deep .el-dialog:not(.is-fullscreen) {
margin-top: 30vh !important;
}
::v-deep .el-dialog__body {
padding: 15px;
}
2 years ago
::v-deep .el-select {
width: 100% !important;
}
2 years ago
.container {
height: 100%;
2 years ago
// overflow: auto;
2 years ago
background: #f2f2f2;
2 years ago
.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;
}
}
2 years ago
}
2 years ago
.tabs {
width: 100%;
2 years ago
height: 30%;
2 years ago
background: #fff;
2 years ago
}
2 years ago
}
//===================
::v-deep .el-button--medium {
padding: 8px;
}
.footBox {
width: 100%;
text-align: center;
}
.tabsBottom {
2 years ago
height: 70%;
2 years ago
padding-top: 10px;
.foot-main {
2 years ago
height: 100%;
2 years ago
// min-height: 600px;
width: 100%;
background: white;
2 years ago
}
2 years ago
}
.exportBtn {
padding: 10px 20px;
}
.table-box {
padding: 0 20px;
.table-item {
2 years ago
}
}
2 years ago
.pagination {
display: flex;
justify-content: space-between;
padding: 15px 20px;
}
::v-deep.el-table--medium .el-table__cell {
2 years ago
padding: 5.3px 0;
}
::v-deep .el-table {
overflow: auto;
}
</style>