¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="capacity-scope"> |
| | | <div class="search"> |
| | | <div> |
| | | <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> |
| | | </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> |
| | | </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-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> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination" |
| | | :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> |
| | | <return-dia v-if="returnDia" ref="returnDia" @closeYearDia="closeReturnDia"></return-dia> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | // import FormDia from '../do/a6-standard-material-list/formDia.vue'; |
| | | // import BorrowDia from '../do/a6-standard-material-list/borrowDia.vue'; |
| | | // import ReturnDia from '../do/a6-standard-material-list/returnDia.vue'; |
| | | import limsTable from '@/components/Table/lims-table.vue' |
| | | import { |
| | | getPageStandardSubstance, |
| | | removeStandardSubstance, |
| | | exportOfStandardSubstanceList |
| | | } from '@/api/cnas/resourceDemand/standardMaterial/standardMaterial' |
| | | import FormDia from '../standardMaterial/component/formDia.vue'; |
| | | import BorrowDia from '../standardMaterial/component/borrowDia.vue'; |
| | | import ReturnDia from '../standardMaterial/component/returnDia.vue'; |
| | | export default { |
| | | components: { |
| | | limsTable, |
| | | FormDia, |
| | | BorrowDia, |
| | | ReturnDia |
| | | }, |
| | | data() { |
| | | return { |
| | | searchForm: { |
| | | name: '', |
| | | factoryManufacturer: '', |
| | | }, |
| | | tableColumn: [ |
| | | { |
| | | label: 'æ åç©è´¨åç§°', |
| | | prop: 'name', |
| | | minWidth: '120' |
| | | }, |
| | | { |
| | | label: 'è§æ ¼åå·', |
| | | prop: 'model', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'ç产åå®¶', |
| | | prop: 'factoryManufacturer', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'åºåç¼å·', |
| | | prop: 'factoryNum', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: '管çç¼å·', |
| | | prop: 'manageNum', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'ä¸ç¡®å®åº¦', |
| | | prop: 'uncertainty', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'æ°é', |
| | | prop: 'quantity', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'è´ç½®æ¥æ', |
| | | prop: 'acquisitionDate', |
| | | minWidth: '150' |
| | | }, |
| | | { |
| | | label: 'æææ', |
| | | prop: 'effectiveDate', |
| | | minWidth: '150' |
| | | }, |
| | | { |
| | | label: 'æ¡£æ¡ç¼å·', |
| | | prop: 'fileNum', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'åæ¾ä½ç½®', |
| | | prop: 'position', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | | prop: 'remark', |
| | | minWidth: '100' |
| | | }, |
| | | // { |
| | | // label: 'å建人', |
| | | // prop: 'createUser', |
| | | // minWidth: '100' |
| | | // }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | minWidth: '150' |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | | minWidth: '180', |
| | | label: 'æä½', |
| | | operation: [ |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openFormDia('edit', row); |
| | | }, |
| | | }, |
| | | { |
| | | name: 'åç¨', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.borrow(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: 'å½è¿', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.return(row); |
| | | } |
| | | }, |
| | | { |
| | | name: 'å é¤', |
| | | type: 'text', |
| | | color: '#f56c6c', |
| | | clickFun: (row) => { |
| | | this.delPlan(row) |
| | | }, |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | tableData: [], |
| | | tableLoading: false, |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 1 |
| | | }, |
| | | total: 0, |
| | | formDia: false, |
| | | borrowDia: false, |
| | | returnDia: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.searchList() |
| | | }, |
| | | methods :{ |
| | | exportFun() { |
| | | this.outLoading = true |
| | | exportOfStandardSubstanceList(this.searchForm).then(res =>{ |
| | | this.outLoading = false |
| | | const blob = new Blob([res], {type: 'application/octet-stream'},false); |
| | | this.$download.saveAs(blob, 'æ åç©è´¨æ¸
å.xlsx') |
| | | this.$message.success('å¯¼åºæå') |
| | | }) |
| | | }, |
| | | // æ¥è¯¢å表 |
| | | searchList () { |
| | | this.tableLoading = true |
| | | getPageStandardSubstance({ |
| | | ...this.page, |
| | | ...this.searchForm |
| | | }).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200){ |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | } |
| | | }) |
| | | }, |
| | | // å é¤ |
| | | delPlan (row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableLoading = true |
| | | removeStandardSubstance({id:row.id}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200) { |
| | | this.$message.success('å 餿å') |
| | | this.searchList() |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | // æ°å¢ï¼ç¼è¾ï¼æ¹åå¼¹æ¡ |
| | | openFormDia (type, row) { |
| | | this.formDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.formDia.openDia(type, row) |
| | | }) |
| | | }, |
| | | closeYearDia () { |
| | | this.formDia = false |
| | | this.searchList() |
| | | }, |
| | | // åç¨ |
| | | borrow (row) { |
| | | this.borrowDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.borrowDia.openDia(row) |
| | | }) |
| | | }, |
| | | closeBorrowDia () { |
| | | this.borrowDia = false |
| | | this.searchList() |
| | | }, |
| | | // å½è¿ |
| | | return (row) { |
| | | this.returnDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.returnDia.openDia(row) |
| | | }) |
| | | }, |
| | | closeReturnDia () { |
| | | this.returnDia = false |
| | | this.searchList() |
| | | }, |
| | | // éç½®æ¥è¯¢æ¡ä»¶ |
| | | resetSearchForm () { |
| | | this.searchForm.name = ''; |
| | | this.searchForm.factoryManufacturer = ''; |
| | | this.searchList() |
| | | }, |
| | | // å页忢 |
| | | pagination(page) { |
| | | this.page.size = page.limit |
| | | this.searchList(); |
| | | }, |
| | | // å页 |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .search { |
| | | height: 46px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | </style> |