| | |
| | | </div> |
| | | </template> |
| | | <template v-slot:table> |
| | | <limsTable |
| | | :column="columns" |
| | | :currentChange="rowClick" |
| | | :height="'25vh'" |
| | | :highlightCurrentRow="true" |
| | | :isSelection="false" |
| | | :rowStyle="tableRowStyle" |
| | | :table-data="tableData" |
| | | rowKey="id" |
| | | style="margin-top: 18px; padding: 0 15px;" |
| | | > |
| | | <template v-slot:consumablesTypeSlot="{row}"> |
| | | <limsTable :column="columns" :currentChange="rowClick" :height="'25vh'" :highlightCurrentRow="true" |
| | | :isSelection="false" :rowStyle="tableRowStyle" :table-data="tableData" rowKey="id" |
| | | style="margin-top: 18px; padding: 0 15px;"> |
| | | <template v-slot:consumablesTypeSlot="{ row }"> |
| | | {{ findType(row.consumablesType) }} |
| | | </template> |
| | | <template v-slot:operation="scope"> |
| | |
| | | </limsTable> |
| | | <div class="pagination"> |
| | | <div></div> |
| | | <el-pagination |
| | | :page-size="pagination.pageSize" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :total="pagination.total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | @current-change="handleCurrent" |
| | | @size-change="handleSize" |
| | | > |
| | | <el-pagination :page-size="pagination.pageSize" :page-sizes="[10, 20, 30, 40]" :total="pagination.total" |
| | | layout="total, sizes, prev, pager, next, jumper" @current-change="handleCurrent" @size-change="handleSize"> |
| | | </el-pagination> |
| | | </div> |
| | | </template> |
| | |
| | | <div> |
| | | <ConsumableProject ref="consumableProject"></ConsumableProject> |
| | | </div> |
| | | <Edit ref="editRef" :contentsId="contentsId" @submit="fetchData"/> |
| | | <Edit ref="editRef" :contentsId="contentsId" @submit="fetchData" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | export default { |
| | | dicts: ["consumables_type"], |
| | | components: { |
| | | TableCard, limsTable,Edit, ConsumableProject |
| | | TableCard, limsTable, Edit, ConsumableProject |
| | | }, |
| | | props: { |
| | | contentsId: { |
| | |
| | | }, |
| | | methods: { |
| | | async fetchData() { |
| | | procurementSuppliesList({ contentId: this.contentsId}).then(res => { |
| | | procurementSuppliesList({ contentId: this.contentsId }).then(res => { |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records |
| | | if (this.tableData.length > 0) { |
| | |
| | | this.$nextTick() |
| | | let res |
| | | const e = this.options.find(item => item.value == val) |
| | | if(e) { |
| | | if (e) { |
| | | res = e.label |
| | | } else { |
| | | res = '-' |
| | |
| | | this.$refs.editRef.openDialog(row); |
| | | }, |
| | | async exportExcel() { |
| | | exportProcurementSuppliesList({parentId:this.contentsId}).then(res => { |
| | | const blob = new Blob([res], {type: 'application/octet-stream'}); |
| | | exportProcurementSuppliesList({ parentId: this.contentsId }).then(res => { |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '耗材列表.xlsx') |
| | | this.$message.success('导出成功') |
| | | }) |
| | | }, |
| | | handleCurrent() { |
| | |
| | | handleSize() { |
| | | }, |
| | | handleDelete(row) { |
| | | deleteProcurementSuppliesList({ id:row.id }).then(res => { |
| | | deleteProcurementSuppliesList({ id: row.id }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('删除成功') |
| | | this.fetchData() |
| | |
| | | rowClick(row) { |
| | | this.$refs.consumableProject.fetchListId(row) |
| | | }, |
| | | tableRowStyle({row}) { |
| | | if(row.currentAmount <= row.lowerLimit) { |
| | | tableRowStyle({ row }) { |
| | | if (row.currentAmount <= row.lowerLimit) { |
| | | return { background: '#ffcaca' } |
| | | } else { |
| | | return {} |