| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢èµè´¨æç»å表 |
| | | export function getCertificationDetail(query) { |
| | | return request({ |
| | | url: "/certification/getCertificationDetail", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ·»å èµè´¨æç»å表 |
| | | export function addCertificationDetail(query) { |
| | | return request({ |
| | | url: "/certification/addCertificationDetail", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤èµè´¨æç»å表 |
| | | export function delCertificationDetail(query) { |
| | | return request({ |
| | | url: "/certification/delCertificationDetail", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // è·åå®éªå®¤åç§° |
| | | export function obtainItemParameterList() { |
| | | return request({ |
| | | url: "/laboratoryScope/obtainItemParameterList", |
| | | method: "get", |
| | | }); |
| | | } |
| | | // æ¥è¯¢å®éªå®¤ç®¡çå表 |
| | | export function selectItemParameter(query) { |
| | | return request({ |
| | | url: "/laboratoryScope/selectItemParameter", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ·»å å®éªå®¤åæ° |
| | | export function addParameter(query) { |
| | | return request({ |
| | | url: "/laboratoryScope/addParameter", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // ä¿®æ¹å®éªå®¤åæ° |
| | | export function upParameter(query) { |
| | | return request({ |
| | | url: "/laboratoryScope/upParameter", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤å®éªå®¤åæ° |
| | | export function delParameter(query) { |
| | | return request({ |
| | | url: "/laboratoryScope/delParameter", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢å°ç« å表 |
| | | export function selectSeal(query) { |
| | | return request({ |
| | | url: "/sealScope/selectSeal", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢å°ç« å表 |
| | | export function addSeal(query) { |
| | | return request({ |
| | | url: "/sealScope/addSeal", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢èµè´¨æç»å表 |
| | | export function getCertificationDetail(query) { |
| | | return request({ |
| | | url: "/certification/getCertificationDetail", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | |
| | | // base color |
| | | $blue:#324157; |
| | | $light-blue:#3A71A8; |
| | | $red:#C03639; |
| | | $pink: #E65D6E; |
| | | $green: #30B08F; |
| | | $tiffany: #4AB7BD; |
| | | $yellow:#FEC171; |
| | | $panGreen: #30B08F; |
| | | $light-blue: #3a71a8; |
| | | $red: #c03639; |
| | | $pink: #e65d6e; |
| | | $green: #30b08f; |
| | | $tiffany: #4ab7bd; |
| | | $yellow: #fec171; |
| | | $panGreen: #30b08f; |
| | | |
| | | // é»è®¤èå主é¢é£æ ¼ |
| | | $base-menu-color:#bfcbd9; |
| | | $base-menu-color-active:#ffffff; |
| | | $base-menu-background:#1890FF; |
| | | $base-menu-background: #3a7bfa; |
| | | $base-logo-title-color: #ffffff; |
| | | |
| | | $base-menu-light-color:#ffffff; |
| | | $base-menu-light-background:#1890FF; |
| | | $base-menu-light-background: #3a7bfa; |
| | | $base-logo-light-title-color: #606266; |
| | | |
| | | $base-sub-menu-background:#ffffff; |
| | |
| | | subMenuHover: $base-sub-menu-hover; |
| | | sideBarWidth: $base-sidebar-width; |
| | | logoTitleColor: $base-logo-title-color; |
| | | logoLightTitleColor: $base-logo-light-title-color |
| | | logoLightTitleColor: $base-logo-light-title-color; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="capacity-scope"> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | | <el-form-item label="èµè´¨åç§°" prop="name"> |
| | | <el-select v-model="queryParams.name" placeholder="éæ©èµè´¨åç§°" size="small" @change="refreshTable(), list = []"> |
| | | <el-option v-for="dict in dict.type.cnas_method_qualification" :key="dict.value" :label="dict.label" |
| | | :value="dict.value"> |
| | | {{ dict.label }} |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">æ¥ è¯¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="refresh">é ç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="text-align: left"> |
| | | <el-radio-group v-model="radio" @input="selectorSwitch" size="medium" fill="#409EFF"> |
| | | <el-radio-button :label="0">èµè´¨æç»</el-radio-button> |
| | | <el-radio-button :label="1">èµè´¨æ»è§</el-radio-button> |
| | | </el-radio-group> |
| | | </el-col> |
| | | <el-col :span="12" style="text-align: right" v-if="radio === 0"> |
| | | <el-button size="small" type="primary" @click="openAdd">èµè´¨æ´æ°</el-button> |
| | | <el-button size="small" icon="el-icon-delete" @click="handleDel">å é¤</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-if="radio === 0"> |
| | | <lims-table :tableData="tableData" :column="column" :isSelection="true" |
| | | :handleSelectionChange="handleSelectionChange" @pagination="pagination" :height="'calc(100vh - 300px)'" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <div class="table" v-if="radio === 1" v-loading="pageLoading" @scroll="scrollFn"> |
| | | <el-row :gutter="16"> |
| | | <el-col :span="8" v-for="(m, i) in list" :key="i" :xs="24" :sm="12" :md="8" :lg="8" :xl="6" |
| | | style="margin-bottom: 16px"> |
| | | <div class="table-item"> |
| | | <el-image style=" |
| | | width: 102px; |
| | | height: 102px; |
| | | margin-right: 20px; |
| | | border-radius: 16px; |
| | | " :src="javaApi + '/img/' + m.imageUrl"> |
| | | <div slot="error" class="image-error" style=" |
| | | width: 100px; |
| | | height: 100px; |
| | | border-radius: 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid #eeeeee; |
| | | "> |
| | | <i class="el-icon-picture-outline" style="font-size: 30px; color: #666666"></i> |
| | | </div> |
| | | </el-image> |
| | | <div class="table-item-right" style="flex: 1; font-size: 12px; color: #666666"> |
| | | <p style="line-height: 26px"> |
| | | èµè´¨åç§°ï¼<span style="color: #3a7bfa">{{ m.name }}</span> |
| | | </p> |
| | | <p style="line-height: 26px">é¢åæ¶é´ï¼{{ m.recentlyTime }}</p> |
| | | <p style="line-height: 26px">å°ææ¶é´ï¼{{ m.expireTime }}</p> |
| | | <p> |
| | | <span>ç¶æï¼</span> |
| | | <el-tag :type="m.state === 0 ? 'danger' : 'success'" size="small">{{ m.state === 0 ? "失æ" : "ææ" |
| | | }}</el-tag> |
| | | </p> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div v-if="list.length < 1 && !pageLoading && !isLoding" style=" |
| | | color: #909399; |
| | | font-size: 14px; |
| | | text-align: center; |
| | | margin-top: 200px; |
| | | "> |
| | | ææ æ°æ® |
| | | </div> |
| | | <div v-if="list.length > 0"> |
| | | <el-button v-if="isLoding" type="text" style="display: flex; margin: 0 auto; color: #909399"> |
| | | <i class="el-icon-loading" style="font-size: 20px"></i> |
| | | </el-button> |
| | | <el-button type="text" v-if="finishLoding" |
| | | style="display: flex; margin: 0 auto; color: #909399">å·²ç»æ²¡ææ´å¤å¦~</el-button> |
| | | </div> |
| | | </div> |
| | | <el-dialog title="èµè´¨æ´æ°" :visible.sync="qualificationsConnectVisible" width="400px"> |
| | | <el-form ref="formDataRef" :model="formData" label-position="right" :rules="formDataRules" label-width="78px"> |
| | | <el-form-item label="èµè´¨åç§°" prop="name"> |
| | | <el-select v-model="formData.name" placeholder="è¯·éæ©" style="width: 100%" size="small" clearable> |
| | | <el-option v-for="dict in dict.type.cnas_method_qualification" :key="dict.value" :label="dict.label" |
| | | :value="dict.value"> |
| | | {{ dict.label }} |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨ç¼ç " prop="code"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="formData.code"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é¢åæºæ" prop="organization"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="formData.organization"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨è¯´æ" prop="explanation"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="formData.explanation"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é¢åæ¶é´" prop="dateOfIssuance"> |
| | | <el-date-picker style="width: 100%" v-model="formData.dateOfIssuance" type="datetime" size="small" |
| | | format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="å°ææ¶é´" prop="expireTime"> |
| | | <el-date-picker style="width: 100%" v-model="formData.expireTime" type="datetime" size="small" |
| | | format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨å¾ç"> |
| | | <el-upload ref="upload" :action="uploadAction" :on-success="(m) => handleSuccessUpImg(m, 'imageUrl')" |
| | | accept="image/jpg,image/jpeg,image/png" :multiple="false" :limit="1" :headers="headers" |
| | | :on-change="beforeUpload" :on-error="onError"> |
| | | <el-button slot="trigger" size="small" type="primary">éåå¾ç</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨éä»¶"> |
| | | <el-upload ref="upload1" :action="uploadAction" :on-success="(m) => handleSuccessUpImg(m, 'fileUrl')" |
| | | accept="image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx" :headers="headers" :multiple="false" |
| | | :limit="1" :on-change="beforeUpload1" :on-error="onError1"> |
| | | <el-button slot="trigger" size="small" type="primary">éåæä»¶</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="qualificationsConnectVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="confirmQualifications" :loading="loading">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | addCertificationDetail, |
| | | delCertificationDetail, |
| | | getCertificationDetail, |
| | | } from "@/api/structural/laboratory"; |
| | | import { getToken } from "@/utils/auth"; |
| | | |
| | | export default { |
| | | components: { |
| | | limsTable, |
| | | }, |
| | | dicts: ["cnas_method_qualification"], |
| | | data() { |
| | | return { |
| | | radio: 0, |
| | | queryParams: { |
| | | name: "", |
| | | }, |
| | | tableData: [], |
| | | selection: [], |
| | | column: [ |
| | | { label: "èµè´¨åç§°", prop: "name" }, |
| | | { label: "èµè´¨ç¼ç ", prop: "code" }, |
| | | { label: "é¢åæºæ", prop: "organization" }, |
| | | { label: "èµè´¨è¯´æ", prop: "explanation" }, |
| | | { label: "馿¬¡é¢åæ¶é´", prop: "firstIssuanceDate" }, |
| | | { label: "æè¿é¢åæ¶é´", prop: "latestIssuanceDate" }, |
| | | { label: "å°æé¢åæ¶é´", prop: "expireTime" }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "éä»¶ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDownLoad(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 1, |
| | | }, |
| | | tableLoading: false, |
| | | qualificationsList: [], |
| | | qualificationsConnectVisible: false, |
| | | formData: {}, |
| | | formDataRules: { |
| | | name: [ |
| | | { required: true, message: "请填åèµè´¨åç§°", trigger: "change" }, |
| | | ], |
| | | code: [{ required: true, message: "请填åèµè´¨ç¼ç ", trigger: "blur" }], |
| | | organization: [ |
| | | { required: true, message: "请填åé¢åæºæ", trigger: "blur" }, |
| | | ], |
| | | dateOfIssuance: [ |
| | | { required: true, message: "è¯·éæ©é¢åæ¶é´", trigger: "change" }, |
| | | ], |
| | | expireTime: [ |
| | | { required: true, message: "请填åå°ææ¶é´", trigger: "change" }, |
| | | ], |
| | | }, |
| | | loading: false, |
| | | pageLoading: false, |
| | | isLoding: false, // å è½½ä¸ï¼loading徿 ,é»è®¤ä¸ºtrue |
| | | finishLoding: false, // å è½½å®æï¼æ¾ç¤ºå·²ç»æ²¡ææ´å¤äº |
| | | currentPage: 1, // å½å页 |
| | | pageSize: 16, // ä¸é¡µ16æ¡ |
| | | total: "", |
| | | list: [], |
| | | uploadAction: process.env.VUE_APP_BASE_API + "/deviceScope/uploadFile", |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.refreshTable(); |
| | | }, |
| | | methods: { |
| | | selectorSwitch(radio) { |
| | | if (radio === 1) { |
| | | this.list = []; |
| | | this.refreshTable(); |
| | | } |
| | | }, |
| | | refreshTable() { |
| | | if (this.radio === 0) { |
| | | this.tableLoading = true; |
| | | getCertificationDetail({ ...this.page, ...this.queryParams }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | } else { |
| | | if (this.currentPage > 1) { |
| | | this.isLoding = true; |
| | | } else { |
| | | this.pageLoading = true; |
| | | } |
| | | if (this.list.length === 0) { |
| | | window.addEventListener( |
| | | "scroll", |
| | | this.throttle(this.scrollFn, 20000) |
| | | ); |
| | | } |
| | | getCertificationDetail({ |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | ...this.queryParams, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.total = res.data.total; |
| | | let list = res.data.records; |
| | | if (list.length === 0) { |
| | | this.finishLoding = true; |
| | | } else { |
| | | if (list.length < this.pageSize) { |
| | | this.finishLoding = true; |
| | | } |
| | | this.list = this.list.concat(list); |
| | | if (this.total === this.list.length) { |
| | | this.finishLoding = true; |
| | | } |
| | | } |
| | | } |
| | | this.pageLoading = false; |
| | | this.isLoding = false; |
| | | }) |
| | | .catch((err) => { |
| | | this.pageLoading = false; |
| | | this.isLoding = false; |
| | | }); |
| | | } |
| | | }, |
| | | // éç½® |
| | | refresh() { |
| | | if (this.radio === 0) { |
| | | this.queryParams.name = ""; |
| | | this.page.size = 10; |
| | | this.page.current = 1; |
| | | this.refreshTable(); |
| | | } else { |
| | | this.finishLoding = false; |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.refreshTable(); |
| | | } |
| | | }, |
| | | // è¡¨æ ¼å¤é |
| | | handleSelectionChange(selection) { |
| | | this.selection = selection; |
| | | }, |
| | | pagination(page) { |
| | | this.page.size = page.limit; |
| | | this.refreshTable(); |
| | | }, |
| | | // èµè´¨æç»æ¹éå é¤ |
| | | handleDel() { |
| | | if (this.selection.length === 0) { |
| | | this.$message.warning("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return; |
| | | } |
| | | const delIds = []; |
| | | this.selection.forEach((item) => { |
| | | delIds.push(item.id); |
| | | }); |
| | | delCertificationDetail({ ids: delIds.join(',') }).then((res) => { |
| | | if (res.code !== 200) return; |
| | | this.refreshTable(); |
| | | this.$message.success("å 餿å"); |
| | | }); |
| | | }, |
| | | // èµè´¨æç»éä»¶ä¸è½½ |
| | | handleDownLoad(row) { |
| | | const url = process.env.VUE_APP_BASE_API + "/img/" + row.fileUrl; |
| | | this.$download.saveAs(url, row.fileUrl); |
| | | }, |
| | | openAdd() { |
| | | this.qualificationsConnectVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.upload.clearFiles(); |
| | | this.$refs.upload1.clearFiles(); |
| | | }); |
| | | this.formData = {}; |
| | | }, |
| | | handleSuccessUpImg(response, name) { |
| | | if (response.code === 200) { |
| | | this.formData[name] = response.data.url; |
| | | } |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error("ä¸ä¼ æä»¶ä¸è¶
è¿10M"); |
| | | this.$refs.upload.clearFiles(); |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error("ä¸ä¼ 失败"); |
| | | this.$refs.upload.clearFiles(); |
| | | }, |
| | | beforeUpload1(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error("ä¸ä¼ æä»¶ä¸è¶
è¿10M"); |
| | | this.$refs.upload1.clearFiles(); |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | onError1(err, file, fileList) { |
| | | this.$message.error("ä¸ä¼ 失败"); |
| | | this.$refs.upload1.clearFiles(); |
| | | }, |
| | | confirmQualifications() { |
| | | this.$refs["formDataRef"].validate((valid) => { |
| | | if (valid) { |
| | | this.loading = true; |
| | | addCertificationDetail({ ...this.formData }) |
| | | .then((res) => { |
| | | this.loading = false; |
| | | if (res.code === 201) return; |
| | | this.$message.success("å·²æäº¤"); |
| | | this.refreshTable(); |
| | | this.resetForm("formDataRef"); |
| | | this.qualificationsConnectVisible = false; |
| | | }) |
| | | .catch((err) => { |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | // æ»å¨è§¦åºå è½½ |
| | | scrollFn() { |
| | | let clientHeight = document.documentElement.clientHeight - 18; //å¯è§åºå |
| | | let scrollHeight = document.body.scrollHeight; // æ»å¨ææ¡£é«åº¦ |
| | | let scrollTop = parseInt(document.documentElement.scrollTop); // å·²æ»å¨çé«åº¦ |
| | | let height = 300; |
| | | if ( |
| | | scrollTop + clientHeight >= scrollHeight - height && |
| | | scrollHeight !== 0 |
| | | ) { |
| | | if ( |
| | | !this.finishLoding && |
| | | this.currentPage * this.pageSize < this.total |
| | | ) { |
| | | this.currentPage = this.currentPage + 1; |
| | | this.refreshTable(); |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | throttle(fn, wait) { |
| | | // å°è£
彿°è¿è¡èæµ |
| | | var timer = null; |
| | | return function () { |
| | | var context = this; |
| | | var args = arguments; |
| | | if (!timer) { |
| | | timer = setTimeout(function () { |
| | | fn.apply(context, args); |
| | | timer = null; |
| | | }, wait); |
| | | } |
| | | }; |
| | | }, |
| | | }, |
| | | destroyed() { |
| | | window.removeEventListener("scroll", this.throttle(), false); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .capacity-scope { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .title { |
| | | height: 40px; |
| | | line-height: 40px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .table-item { |
| | | border-radius: 8px 8px 8px 8px; |
| | | box-shadow: 4px 4px 8px 0px rgba(51, 51, 51, 0.04); |
| | | border: 1px solid #eeeeee; |
| | | box-sizing: border-box; |
| | | padding: 14px 12px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="capacity-scope"> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | | <el-form-item label="å®éªå®¤åç§°" prop="laboratoryName"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="queryParams.laboratoryName" |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å®éªå®¤ç¼ç " prop="laboratoryNumber"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="queryParams.laboratoryNumber" |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">æ¥ è¯¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="refresh">é ç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="openAdd('add')" icon="el-icon-plus">æ°å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="column" :height="'calc(100vh - 250px)'" @pagination="pagination" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <!-- æ°å¢å®éªå®¤--> |
| | | <el-dialog :title="formTitle" :visible.sync="addDia" width="450px"> |
| | | <el-form ref="laboratoryForm" :model="laboratoryForm" :rules="userRules" label-position="right" |
| | | label-width="100px"> |
| | | <el-form-item label="å®éªå®¤åç§°" prop="laboratoryName"> |
| | | <el-input v-model="laboratoryForm.laboratoryName" size="small" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åºæç¼ç " prop="laboratoryNumber"> |
| | | <el-input v-model="laboratoryForm.laboratoryNumber" size="small" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å®éªå®¤ä»£å·" prop="laboratoryCode"> |
| | | <el-input v-model="laboratoryForm.laboratoryCode" size="small" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è´è´£äºº" prop="head"> |
| | | <el-input v-model="laboratoryForm.head" size="small" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è´è´£äººçµè¯" prop="phoneNumber"> |
| | | <el-input v-model="laboratoryForm.phoneNumber" size="small" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å°å" prop="address"> |
| | | <el-input v-model="laboratoryForm.address" size="small" clearable></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="reset">å æ¶</el-button> |
| | | <el-button type="primary" @click="customAdd" :loading="loading">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="å°ç« 管ç" :visible.sync="fileVisible" width="60vw"> |
| | | <div class="btns"> |
| | | <el-button size="medium" type="primary" @click="openUpload">æ´æ°å°ç« </el-button> |
| | | </div> |
| | | <lims-table :tableData="fileComponentData" :column="fileComponentDataColumn" @pagination="fileComponentPagination" |
| | | height="500px" :page="fileComponentPage" :tableLoading="fileComponentTableLoading"></lims-table> |
| | | </el-dialog> |
| | | <el-dialog title="æ´æ°å°ç« " :visible.sync="upFileVisible" width="400px"> |
| | | <el-form ref="dataForm" :model="dataForm" :rules="dataFormRules" label-position="right" label-width="80px"> |
| | | <el-form-item label="å°ç« ç±»å" prop="type"> |
| | | <el-cascader v-model="dataForm.type" :options="options" :show-all-levels="false" :props="props" |
| | | placeholder="è¯·éæ©" size="small" style="width:100%" collapse-tags clearable></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="å°ç« å¾ç" prop="address"> |
| | | <el-upload class="avatar-uploader" :action="action" :headers="uploadHeader" |
| | | accept='image/jpg,image/jpeg,image/png' :show-file-list="false" :on-success="handleSuccess" |
| | | :on-change="beforeUpload" ref="upload" :on-error="onError"> |
| | | <img v-if="dataForm.address" :src="javaApi + '/img/' + dataForm.address" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="upFileVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="confirmConnect" :loading="loading">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | addParameter, |
| | | addSeal, |
| | | delParameter, |
| | | selectItemParameter, |
| | | selectSeal, |
| | | upParameter |
| | | } from "@/api/structural/laboratoryScope"; |
| | | import { getCertificationDetail } from "@/api/structural/laboratory"; |
| | | export default { |
| | | components: { |
| | | limsTable |
| | | |
| | | }, |
| | | computed: { |
| | | action() { |
| | | return this.javaApi + '/deviceScope/uploadFile' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | queryParams: { |
| | | laboratoryName: '', |
| | | laboratoryNumber: '', |
| | | }, |
| | | tableData: [], |
| | | tableLoading: false, |
| | | column: [ |
| | | { label: 'å®éªå®¤åç§°', prop: 'laboratoryName' }, |
| | | { label: 'åºæç¼ç ', prop: 'laboratoryNumber' }, |
| | | { label: 'å®éªå®¤ä»£å·', prop: 'laboratoryCode' }, |
| | | { label: 'è´è´£äºº', prop: 'head' }, |
| | | { label: 'è´è´£äººçµè¯', prop: 'phoneNumber' }, |
| | | { label: 'å°å', prop: 'address' }, |
| | | { label: 'å建人', prop: 'createUserName' }, |
| | | { label: 'å建æ¶é´', prop: 'createTime' }, |
| | | { |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | | label: 'æä½', |
| | | width: '180px', |
| | | operation: [ |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openAdd('edit', row); |
| | | }, |
| | | }, |
| | | { |
| | | name: 'å é¤', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.delete(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: 'å°ç« 管ç', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.fileManagement(row); |
| | | }, |
| | | }, |
| | | ] |
| | | } |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 1 |
| | | }, |
| | | addDia: false, |
| | | formTitle: '', |
| | | laboratoryForm: { |
| | | |
| | | }, |
| | | operationType: '', |
| | | userRules: { |
| | | laboratoryName: [{ required: true, message: '请è¾å
¥å®éªå®¤åç§°', trigger: 'blur' }], |
| | | laboratoryNumber: [{ required: true, message: '请è¾å
¥åºæç¼ç ', trigger: 'blur' }], |
| | | head: [{ required: true, message: '请è¾å
¥è´è´£äºº', trigger: 'blur' }], |
| | | phoneNumber: [{ required: true, message: '请è¾å
¥è´è´£äººçµè¯', trigger: 'blur' }], |
| | | }, |
| | | currentRow: {}, |
| | | fileComponentTableLoading: false, |
| | | fileComponentData: [], |
| | | fileComponentDataColumn: [ |
| | | { label: 'å®éªå®¤åç§°', prop: 'laboratoryName' }, |
| | | { label: 'å°ç« å¾ç', prop: 'address', dataType: 'image' }, |
| | | { label: 'å°ç« ç±»å', prop: 'type' }, |
| | | ], |
| | | fileComponentPage: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 1, |
| | | layout: 'total, prev, pager, next' |
| | | }, |
| | | fileVisible: false, |
| | | upFileVisible: false, |
| | | loading: false, |
| | | dataForm: { |
| | | type: '', |
| | | address: '', |
| | | }, |
| | | dataFormRules: { |
| | | type: [{ required: true, message: 'è¯·éæ©å°ç« ç±»å', trigger: 'change' }], |
| | | address: [{ required: false, message: '请ä¸ä¼ å¾ç', trigger: 'change' }], |
| | | }, |
| | | props: { multiple: false, emitPath: false, }, |
| | | options: [ |
| | | { |
| | | value: 'å®éªå®¤èµè´¨', |
| | | label: 'å®éªå®¤èµè´¨', |
| | | children: [] |
| | | }, |
| | | { |
| | | value: 'å§ææ¥å', |
| | | label: 'å§ææ¥å', |
| | | children: null |
| | | }, |
| | | { |
| | | value: 'è¿åæ¥å', |
| | | label: 'è¿åæ¥å', |
| | | children: null |
| | | }, |
| | | ], |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.refreshTable() |
| | | }, |
| | | methods: { |
| | | refreshTable() { |
| | | this.tableLoading = true |
| | | selectItemParameter({ ...this.page, ...this.queryParams }).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // éç½® |
| | | refresh() { |
| | | this.resetForm('queryForm') |
| | | this.refreshTable() |
| | | }, |
| | | // å页忢 |
| | | pagination(page) { |
| | | this.page.size = page.limit |
| | | this.refreshTable() |
| | | }, |
| | | openAdd(type, row) { |
| | | this.formTitle = type === 'add' ? 'æ°å¢å®éªå®¤' : 'ç¼è¾å®éªå®¤' |
| | | this.operationType = type |
| | | if (type === 'edit') { |
| | | this.laboratoryForm = this.HaveJson(row) |
| | | } |
| | | this.addDia = true |
| | | }, |
| | | // æäº¤æ°å¢ãç¼è¾å®éªå®¤è¡¨å |
| | | customAdd() { |
| | | this.$refs['laboratoryForm'].validate((valid) => { |
| | | if (valid) { |
| | | this.loading = true |
| | | if (this.operationType === 'add') { |
| | | addParameter(this.laboratoryForm).then(res => { |
| | | this.loading = false |
| | | if (res.code !== 200) return |
| | | this.$message.success('æ°å¢æå') |
| | | this.refreshTable() |
| | | this.reset() |
| | | }).catch(err => { |
| | | this.loading = false |
| | | }) |
| | | } else { |
| | | upParameter(this.laboratoryForm).then(res => { |
| | | this.loading = false |
| | | if (res.code !== 200) return |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.refreshTable() |
| | | this.reset() |
| | | }).catch(err => { |
| | | this.loading = false |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | reset() { |
| | | this.resetForm('laboratoryForm') |
| | | this.addDia = false |
| | | }, |
| | | // å é¤å®éªå®¤ |
| | | delete(row) { |
| | | this.$confirm('æ¯å¦å é¤å½åæ°æ®?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(() => { |
| | | delParameter({ id: row.id }).then(res => { |
| | | this.$message.success('å 餿å') |
| | | this.refreshTable() |
| | | }).catch(e => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => { }) |
| | | }, |
| | | // æå¼å°ç« 管çå¼¹æ¡ |
| | | fileManagement(row) { |
| | | this.fileVisible = true; |
| | | this.fileComponentTableLoading = true |
| | | this.currentRow = row |
| | | this.getFileComponentList() |
| | | }, |
| | | getFileComponentList() { |
| | | selectSeal({ id: this.currentRow.id, ...this.fileComponentPage }).then(res => { |
| | | this.fileComponentTableLoading = false |
| | | if (res.code === 200) { |
| | | this.fileComponentData = res.data.records |
| | | this.fileComponentPage.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | this.fileComponentTableLoading = false |
| | | }) |
| | | }, |
| | | fileComponentPagination(page) { |
| | | this.fileComponentPage.size = page.limit |
| | | this.getFileComponentList() |
| | | }, |
| | | // æå¼æ´æ°å°ç« å¼¹æ¡ |
| | | openUpload() { |
| | | this.dataForm.type = ''; |
| | | this.dataForm.address = ''; |
| | | this.upFileVisible = true; |
| | | this.getCertificationOperation() |
| | | }, |
| | | // æ¥è¯¢å°ç« ç±»å |
| | | getCertificationOperation() { |
| | | const params = { |
| | | current: -1, |
| | | size: -1, |
| | | } |
| | | getCertificationDetail(params).then(res => { |
| | | this.options[0].children = res.data.records.map(m => { |
| | | m.value = m.name; |
| | | m.label = m.name; |
| | | return m |
| | | }); |
| | | }) |
| | | }, |
| | | // æäº¤æ´æ°å°ç« |
| | | confirmConnect() { |
| | | this.$refs['dataForm'].validate((valid) => { |
| | | if (valid) { |
| | | this.loading = true; |
| | | addSeal({ labId: this.currentRow.id, ...this.dataForm }).then(res => { |
| | | this.loading = false; |
| | | this.getFileComponentList() |
| | | this.upFileVisible = false; |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleSuccess(response,) { |
| | | if (response.code === 200) { |
| | | this.dataForm.address = response.data.url |
| | | } |
| | | }, |
| | | beforeUpload(file, type) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList, type) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .capacity-scope { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .search { |
| | | height: 46px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .btns { |
| | | text-align: right; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__body { |
| | | padding-top: 8px !important; |
| | | } |
| | | |
| | | .avatar-uploader ::v-deep .el-upload { |
| | | border: 1px dashed #666666; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader ::v-deep .el-upload:hover { |
| | | border-color: #409EFF; |
| | | } |
| | | |
| | | .avatar-uploader-icon { |
| | | font-size: 20px; |
| | | color: #8c939d; |
| | | width: 90px; |
| | | height: 90px; |
| | | line-height: 90px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .avatar { |
| | | width: 90px; |
| | | height: 90px; |
| | | display: block; |
| | | } |
| | | </style> |