| | |
| | | <el-form :model="searchForm" ref="searchForm" size="small" :inline="true"> |
| | | <el-form-item label="标准物质名称" prop="name"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="searchForm.name" |
| | | @keyup.enter.native="searchList"></el-input> |
| | | @keyup.enter.native="searchList"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="生产厂家" prop="factoryManufacturer"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="searchForm.factoryManufacturer" |
| | | @keyup.enter.native="searchList"></el-input> |
| | | @keyup.enter.native="searchList"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="searchList">查 询</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">重 置</el-button> |
| | | <el-button type="primary" size="mini" @click="searchList">查询</el-button> |
| | | <el-button size="mini" @click="resetSearchForm">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-button size="medium" @click="exportFun">导 出</el-button> |
| | | <el-button size="medium" type="primary" @click="openFormDia('add')">新 增</el-button> |
| | | <el-button size="small" @click="exportFun">导 出</el-button> |
| | | <el-button size="small" type="primary" @click="openFormDia('add')">新 增</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <form-dia v-if="formDia" ref="formDia" @closeYearDia="closeYearDia"></form-dia> |
| | | <borrow-dia v-if="borrowDia" ref="borrowDia" @closeYearDia="closeBorrowDia"></borrow-dia> |
| | |
| | | import BorrowDia from '../standardMaterial/component/borrowDia.vue'; |
| | | import ReturnDia from '../standardMaterial/component/returnDia.vue'; |
| | | export default { |
| | | name: 'StandardMaterial', |
| | | components: { |
| | | limsTable, |
| | | FormDia, |
| | |
| | | mounted() { |
| | | this.searchList() |
| | | }, |
| | | methods :{ |
| | | methods: { |
| | | exportFun() { |
| | | this.outLoading = true |
| | | exportOfStandardSubstanceList(this.searchForm).then(res =>{ |
| | | exportOfStandardSubstanceList(this.searchForm).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], {type: 'application/octet-stream'},false); |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }, false); |
| | | this.$download.saveAs(blob, '标准物质清单.xlsx') |
| | | this.$message.success('导出成功') |
| | | }) |
| | | }, |
| | | // 查询列表 |
| | | searchList () { |
| | | searchList() { |
| | | this.tableLoading = true |
| | | getPageStandardSubstance({ |
| | | ...this.page, |
| | | ...this.searchForm |
| | | }).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200){ |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | } |
| | | }) |
| | | }, |
| | | // 删除 |
| | | delPlan (row) { |
| | | delPlan(row) { |
| | | this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableLoading = true |
| | | removeStandardSubstance({id:row.id}).then(res => { |
| | | removeStandardSubstance({ id: row.id }).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200) { |
| | | this.$message.success('删除成功') |
| | |
| | | }); |
| | | }, |
| | | // 新增,编辑,批准弹框 |
| | | openFormDia (type, row) { |
| | | openFormDia(type, row) { |
| | | this.formDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.formDia.openDia(type, row) |
| | | }) |
| | | }, |
| | | closeYearDia () { |
| | | closeYearDia() { |
| | | this.formDia = false |
| | | this.searchList() |
| | | }, |
| | | // 借用 |
| | | borrow (row) { |
| | | borrow(row) { |
| | | this.borrowDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.borrowDia.openDia(row) |
| | | }) |
| | | }, |
| | | closeBorrowDia () { |
| | | closeBorrowDia() { |
| | | this.borrowDia = false |
| | | this.searchList() |
| | | }, |
| | | // 归还 |
| | | return (row) { |
| | | return(row) { |
| | | this.returnDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.returnDia.openDia(row) |
| | | }) |
| | | }, |
| | | closeReturnDia () { |
| | | closeReturnDia() { |
| | | this.returnDia = false |
| | | this.searchList() |
| | | }, |
| | | // 重置查询条件 |
| | | resetSearchForm () { |
| | | resetSearchForm() { |
| | | this.searchForm.name = ''; |
| | | this.searchForm.factoryManufacturer = ''; |
| | | this.searchList() |