¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction, postAction } from '@/api/manage' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import JEllipsis from "@/components/jeecg/JEllipsis"; |
| | | |
| | | export default { |
| | | name: "EquipmentList", |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | JInput, |
| | | Tooltip, |
| | | JEllipsis, |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'éé
设å¤', |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: 'æ¹æ¬¡å·', |
| | | align: "center", |
| | | dataIndex: 'batchNum', |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | align: "center", |
| | | dataIndex: 'mainUnitName', |
| | | }, |
| | | { |
| | | title: 'æ°é', |
| | | align: "center", |
| | | dataIndex: 'mainQuantity', |
| | | }, |
| | | /* { |
| | | title: 'è¾
åä½', |
| | | align: "center", |
| | | dataIndex: 'auxiliaryUnitName', |
| | | }, |
| | | { |
| | | title: 'è¾
æ°é', |
| | | align: "center", |
| | | dataIndex: 'auxiliaryQuantity', |
| | | }, */ |
| | | { |
| | | title: 'ä»åº', |
| | | align: "center", |
| | | dataIndex: 'warehouseName', |
| | | }, |
| | | { |
| | | title: 'åºåº', |
| | | align: "center", |
| | | dataIndex: 'warehouseAreaName', |
| | | }, |
| | | { |
| | | title: 'åºä½', |
| | | align: "center", |
| | | dataIndex: 'warehouseLocationNum', |
| | | }, |
| | | { |
| | | title: 'åºåæ¥æ', |
| | | align: "center", |
| | | dataIndex: 'manufactureDate', |
| | | customRender: function (text) { |
| | | return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'ä¾åºå', |
| | | align: "center", |
| | | dataIndex: 'supplierName', |
| | | }, |
| | | { |
| | | title: 'æææ', |
| | | align: "center", |
| | | dataIndex: 'validityPeriod', |
| | | }, |
| | | { |
| | | title: '失æé¢è¦æ¥', |
| | | align: "center", |
| | | dataIndex: 'validityForecast', |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/spare/SparesPartInventory/getSparePartInventoryList", |
| | | }, |
| | | sparePartId: '-1', |
| | | } |
| | | }, |
| | | watch: { |
| | | sparePartId() { |
| | | this.queryParam = {}; |
| | | this.queryParam.sparePartId = this.sparePartId; |
| | | this.loadData(1); |
| | | }, |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | if (this.sparePartId == '-1') { |
| | | params.sparePartId = '-1'; |
| | | } |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records || res.result; |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total; |
| | | } else { |
| | | this.ipagination.total = 0; |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | @import '~@assets/less/common.less'; |
| | | /deep/ .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | .success { |
| | | color: green; |
| | | } |
| | | .error { |
| | | color: red; |
| | | } |
| | | .fontweight { |
| | | font-weight: bold; |
| | | } |
| | | .fontweightGreen { |
| | | font-weight: bold; |
| | | color: green; |
| | | } |
| | | .ant-card { |
| | | margin-left: -30px; |
| | | margin-right: -30px; |
| | | } |
| | | </style> |