| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // é弿º¯æºè®¡å å¯¼åº |
| | | export function exportOfValueTraceabilityPlan(query) { |
| | | return request({ |
| | | url: "/feCalibrationSchedule/exportOfValueTraceabilityPlan", |
| | | method: "get", |
| | | params: query, |
| | | responseType: "blob", |
| | | }); |
| | | } |
| | | |
| | | //é弿º¯æºè®¡åæ¥è¯¢ |
| | | export function getPageCalibrationSchedule(query) { |
| | | return request({ |
| | | url: "/feCalibrationSchedule/getPageCalibrationSchedule", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å é¤é弿º¯æºè®¡å |
| | | export function removeCalibrationSchedule(query) { |
| | | return request({ |
| | | url: "/feCalibrationSchedule/removeCalibrationSchedule", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // é弿º¯æºè®¡åæ°å¢ç¼è¾ |
| | | export function addCalibrationSchedule(data) { |
| | | return request({ |
| | | url: "/feCalibrationSchedule/addCalibrationSchedule", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | |
| | | width: 100%; |
| | | position: relative; |
| | | overflow: hidden; |
| | | background: rgb(245, 247, 251); |
| | | // background: rgb(245, 247, 251); |
| | | } |
| | | |
| | | .fixed-header + .app-main { |
| | | .fixed-header+.app-main { |
| | | padding-top: 50px; |
| | | } |
| | | |
| | |
| | | min-height: calc(100vh - 94px); |
| | | } |
| | | |
| | | .fixed-header + .app-main { |
| | | .fixed-header+.app-main { |
| | | padding-top: 84px; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-loading="diaLoading" :close-on-click-modal="false" :close-on-press-escape="false" |
| | | :visible.sync="formDia" title="é弿º¯æºè®¡å" width="80%" @close="closeFormDia"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="仪å¨åç§°" prop="instrumentName"> |
| | | <el-input v-model="form.instrumentName" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·" prop="model"> |
| | | <el-input v-model="form.model" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管çç¼å·" prop="managementNumber"> |
| | | <el-input v-model="form.managementNumber" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ææ¯ææ " prop="technicalIndicators"> |
| | | <el-input v-model="form.technicalIndicators" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£å®å¨æ" prop="verificationCyde"> |
| | | <el-input v-model="form.verificationCyde" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£å®åä½" prop="verificationUnit"> |
| | | <el-input v-model="form.verificationUnit" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æè¿æ£å®æ¥æ" prop="recentlyTime"> |
| | | <el-date-picker v-model="form.recentlyTime" clearable format="yyyy-MM-dd HH:mm:ss" placeholder="éæ©æ¥æ" |
| | | size="small" style="width: 100%" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="计å䏿¬¡æ£å®æ¥æ" prop="nextTime"> |
| | | <el-date-picker v-model="form.nextTime" clearable format="yyyy-MM-dd HH:mm:ss" placeholder="éæ©æ¥æ" |
| | | size="small" style="width: 100%" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="closeFormDia">å æ¶</el-button> |
| | | <el-button :loading="loading" type="primary" @click="handleEdit">æ 交</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | addCalibrationSchedule, |
| | | } from '@/api/cnas/resourceDemand/quantityTraceabilityPlan.js' |
| | | export default { |
| | | name: "formDia", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | formDia: false, |
| | | diaLoading: false, |
| | | loading: false, |
| | | form: { |
| | | instrumentName: '', |
| | | model: '', |
| | | managementNumber: '', |
| | | technicalIndicators: '', |
| | | verificationCyde: '', |
| | | verificationUnit: '', |
| | | recentlyTime: '', |
| | | nextTime: '', |
| | | remark: '', |
| | | id: '', |
| | | }, |
| | | rules: { |
| | | instrumentName: [{ required: true, message: '请填å仪å¨åç§°', trigger: 'blur' }], |
| | | model: [{ required: true, message: '请填åè§æ ¼åå·', trigger: 'blur' }], |
| | | managementNumber: [{ required: true, message: '请填å管çç¼å·', trigger: 'blur' }], |
| | | technicalIndicators: [{ required: true, message: 'è¯·å¡«åææ¯ææ ', trigger: 'blur' }], |
| | | verificationCyde: [{ required: true, message: 'è¯·å¡«åæ£å®å¨æ', trigger: 'blur' }], |
| | | verificationUnit: [{ required: true, message: 'è¯·å¡«åæ£å®åä½', trigger: 'blur' }], |
| | | recentlyTime: [{ required: true, message: 'è¯·éæ©æè¿æ£å®æ¥æ', trigger: 'change' }], |
| | | nextTime: [{ required: true, message: 'è¯·éæ©è®¡å䏿¬¡æ£å®æ¥æ', trigger: 'change' }], |
| | | }, |
| | | operationType: '', |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // æå¼å¼¹æ¡ |
| | | openDia(type, row) { |
| | | this.formDia = true |
| | | this.operationType = type |
| | | if (type !== 'add') { |
| | | this.form = row |
| | | } |
| | | }, |
| | | // æäº¤å¼¹æ¡æ°æ® |
| | | handleEdit() { |
| | | this.$refs['form'].validate((valid) => { |
| | | if (valid) { |
| | | this.loading = true |
| | | const internalReport = this.HaveJson(this.form) |
| | | addCalibrationSchedule(internalReport).then(res => { |
| | | this.loading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('æä½æå') |
| | | this.closeFormDia() |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | this.loading = false |
| | | }) |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | closeFormDia() { |
| | | this.$refs.form.resetFields(); |
| | | this.formDia = false |
| | | this.$emit('closeFormDia') |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped></style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div> |
| | | <div class="search-background"> |
| | | <span class="search-group"> |
| | | <span style="width: 120px">仪å¨åç§°ï¼</span> |
| | | <el-input v-model="searchForm.instrumentName" clearable size="small"></el-input> |
| | | </span> |
| | | <span class="search-group"> |
| | | <span style="width: 120px">管çç¼å·ï¼</span> |
| | | <el-input v-model="searchForm.managementNumber" clearable size="small"></el-input> |
| | | </span> |
| | | <span class="search-group"> |
| | | <el-button size="medium" @click="resetSearchForm">é ç½®</el-button> |
| | | <el-button size="medium" type="primary" @click="searchList">æ¥ è¯¢</el-button> |
| | | </span> |
| | | <div class="btn"> |
| | | <el-button size="medium" @click="exportFun">导 åº</el-button> |
| | | <el-button size="medium" @click="uploadDia = true">导 å
¥</el-button> |
| | | <el-button size="medium" type="primary" @click="openFormDia('add')">æ° å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <div> |
| | | <TableCard :showForm="false" :showTitle="false"> |
| | | <template v-slot:table> |
| | | <limsTable :column="tableColumn" :height="'calc(100vh - 17em)'" :table-data="tableData" |
| | | :table-loading="tableLoading" style="padding: 0 15px;margin-bottom: 16px" :page="page" |
| | | @pagination="pagination"> |
| | | </limsTable> |
| | | </template> |
| | | </TableCard> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <form-dia v-if="formDia" ref="formDia" @closeFormDia="closeFormDia"></form-dia> |
| | | <el-dialog :visible.sync="uploadDia" title="æ°æ®å¯¼å
¥" width="500px"> |
| | | <div style="margin: 0 auto;"> |
| | | <el-upload ref="upload" :action="javaApi + '/feCalibrationSchedule/importOfValueTraceabilityPlan'" |
| | | :auto-upload="false" :before-upload="beforeUpload" :file-list="fileList" :headers="uploadHeader" :limit="1" |
| | | :on-error="onError" :on-success="onSuccess" accept=".xlsx" drag name="file"> |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text">å°æä»¶æå°æ¤å¤ï¼æ<em>ç¹å»ä¸ä¼ </em></div> |
| | | </el-upload> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="uploadDia = false">å æ¶</el-button> |
| | | <el-button :loading="uploading" type="primary" @click="submitUpload()">ä¸ ä¼ </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import TableCard from '@/components/TableCard/index.vue'; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import FormDia from './components/formDia.vue'; |
| | | import { |
| | | exportOfValueTraceabilityPlan, |
| | | getPageCalibrationSchedule, |
| | | removeCalibrationSchedule, |
| | | } from '@/api/cnas/resourceDemand/quantityTraceabilityPlan.js' |
| | | |
| | | export default { |
| | | name: 'a6-quantity-value-traceability-plan', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { FormDia, limsTable, TableCard }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | outLoading: false, |
| | | searchForm: { |
| | | instrumentName: '', |
| | | managementNumber: '', |
| | | }, |
| | | tableColumn: [ |
| | | { |
| | | label: '仪å¨åç§°', |
| | | prop: 'instrumentName', |
| | | minWidth: '120' |
| | | }, |
| | | { |
| | | label: 'è§æ ¼åå·', |
| | | prop: 'model', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: '管çç¼å·', |
| | | prop: 'managementNumber', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'ææ¯ææ ', |
| | | prop: 'technicalIndicators', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'æ£å®å¨æ', |
| | | prop: 'verificationCyde', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'æ£å®åä½', |
| | | prop: 'verificationUnit', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'æè¿æ£å®æ¥æ', |
| | | prop: 'recentlyTime', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: '计å䏿¬¡æ£å®æ¥æ', |
| | | prop: 'nextTime', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: 'remark', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | | minWidth: '180', |
| | | label: 'æä½', |
| | | operation: [ |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openFormDia('edit', row); |
| | | }, |
| | | }, |
| | | { |
| | | name: 'å é¤', |
| | | type: 'text', |
| | | color: '#f56c6c', |
| | | clickFun: (row) => { |
| | | this.delPlan(row) |
| | | }, |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | tableData: [], |
| | | tableLoading: false, |
| | | uploadDia: false, |
| | | uploading: false, |
| | | page: { |
| | | size: 20, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | formDia: false, |
| | | fileList: [], |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.searchList() |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | beforeUpload(file, fileList) { |
| | | if (file.type != 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') { |
| | | this.$message.error('ä¸ä¼ æä»¶æ ¼å¼ä¸æ£ç¡®'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } |
| | | }, |
| | | submitUpload() { |
| | | if (this.$refs.upload.uploadFiles.length == 0) { |
| | | this.$message.error('æªéæ©æä»¶') |
| | | return |
| | | } |
| | | this.uploading = true |
| | | this.$refs.upload.submit(); |
| | | this.uploading = false |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | this.uploading = false |
| | | }, |
| | | onSuccess(response, file, fileList) { |
| | | this.$refs.upload.clearFiles() |
| | | this.uploadDia = false |
| | | this.uploading = false |
| | | if (response.code == 201) { |
| | | this.$message.error(response.message) |
| | | return |
| | | } |
| | | this.$message.success('ä¸ä¼ æå') |
| | | this.standardList = [] |
| | | this.productList = [] |
| | | this.searchList() |
| | | }, |
| | | // å¯¼åº |
| | | exportFun() { |
| | | this.outLoading = true |
| | | exportOfValueTraceabilityPlan({ |
| | | instrumentName: this.searchForm.instrumentName, |
| | | managementNumber: this.searchForm.managementNumber, |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'é弿º¯æºè®¡å.xlsx') |
| | | }).finally(() => { |
| | | this.outLoading = false |
| | | }) |
| | | }, |
| | | // æ¥è¯¢å表 |
| | | searchList() { |
| | | this.tableLoading = true |
| | | getPageCalibrationSchedule({ |
| | | ...this.searchForm, |
| | | ...this.page |
| | | }).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 201) return |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | | delPlan(row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableLoading = true |
| | | removeCalibrationSchedule({ id: row.id }).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('å 餿å') |
| | | this.searchList() |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // éç½®æ¥è¯¢æ¡ä»¶ |
| | | resetSearchForm() { |
| | | this.searchForm.instrumentName = ''; |
| | | this.searchForm.managementNumber = ''; |
| | | this.searchList() |
| | | }, |
| | | // æ°å¢ï¼ç¼è¾ï¼æ¹åå¼¹æ¡ |
| | | openFormDia(type, row) { |
| | | this.formDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.formDia.openDia(type, row) |
| | | }) |
| | | }, |
| | | closeFormDia() { |
| | | this.formDia = false |
| | | this.searchList() |
| | | }, |
| | | // å页 |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.searchList(); |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .search-background { |
| | | width: 100%; |
| | | height: 80px; |
| | | line-height: 80px; |
| | | background-color: #ffffff; |
| | | display: flex; |
| | | position: relative; |
| | | } |
| | | |
| | | .search-group { |
| | | display: flex; |
| | | align-items: center; |
| | | margin: 0 20px; |
| | | } |
| | | |
| | | .table { |
| | | background-color: #ffffff; |
| | | } |
| | | |
| | | .btn { |
| | | position: absolute; |
| | | right: 20px; |
| | | top: 16px; |
| | | } |
| | | </style> |