¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!--æ¯æå
¨å±ç¼©æ¾--> |
| | | <a-modal |
| | | :visible='visible' |
| | | :title='title' |
| | | switchFullscreen |
| | | @ok='handleSubmit' |
| | | @cancel='close' |
| | | style='top:50px' |
| | | cancelText='å
³é' |
| | | :width='1450' |
| | | > |
| | | <a-card :bordered='false'> |
| | | <div class='table-page-search-wrapper'> |
| | | <a-form |
| | | layout='inline' |
| | | @keyup.enter.native='searchQuery' |
| | | > |
| | | <a-row :gutter='24'> |
| | | <a-col |
| | | :md='8' |
| | | :sm='6' |
| | | > |
| | | <a-form-item label='å¤ä»¶ç¼ç '> |
| | | <a-input |
| | | placeholder='请è¾å
¥å¤ä»¶ç¼ç ' |
| | | v-model='queryParam.num' |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md='8' |
| | | :sm='6' |
| | | > |
| | | <a-form-item label='å¤ä»¶åç§°'> |
| | | <a-input |
| | | placeholder='请è¾å
¥å¤ä»¶åç§°' |
| | | v-model='queryParam.name' |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md='3'> |
| | | <span |
| | | style='float: left;overflow: hidden;' |
| | | class='table-page-search-submitButtons' |
| | | > |
| | | <a-button |
| | | type='primary' |
| | | @click='searchQuery' |
| | | icon='search' |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | @click='searchReset' |
| | | icon='reload' |
| | | style='margin-left: 10px' |
| | | >éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <a-table |
| | | ref='table' |
| | | :scroll="{ x: 'calc(1400px + 50%)', y: 900 }" |
| | | size='middle' |
| | | rowKey='id' |
| | | bordered |
| | | :columns='columns' |
| | | :dataSource='dataSource' |
| | | :pagination='ipagination' |
| | | :rowSelection='rowSelection' |
| | | :loading='loading' |
| | | @change='handleTableChange' |
| | | > |
| | | |
| | | </a-table> |
| | | </a-card> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { filterObj } from '@/utils/util' |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'JSelectSparePartInventoryModal', |
| | | mixins: [JeecgListMixin], |
| | | components: {}, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | queryParam: {}, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'æ¹æ¬¡å·', |
| | | align: 'center', |
| | | dataIndex: 'batchNum' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'num' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åç§°', |
| | | align: 'center', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | align: 'center', |
| | | dataIndex: 'specification' |
| | | }, |
| | | { |
| | | title: 'åå·', |
| | | align: 'center', |
| | | dataIndex: 'model' |
| | | }, |
| | | { |
| | | title: 'å¶é å', |
| | | align: 'center', |
| | | dataIndex: 'constructorName' |
| | | }, |
| | | { |
| | | title: 'ä»åº', |
| | | align: 'center', |
| | | dataIndex: 'warehouseName' |
| | | }, |
| | | { |
| | | title: 'åºåº', |
| | | align: 'center', |
| | | dataIndex: 'warehouseAreaName' |
| | | }, |
| | | { |
| | | title: 'åºä½', |
| | | align: 'center', |
| | | dataIndex: 'warehouseLocationNum' |
| | | }, |
| | | { |
| | | title: 'åºåºæ¥æ', |
| | | align: 'center', |
| | | dataIndex: 'manufactureDate' |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | align: 'center', |
| | | dataIndex: 'mainUnitName' |
| | | }, |
| | | |
| | | { |
| | | title: 'åºåæ°é', |
| | | align: 'center', |
| | | dataIndex: 'mainQuantity' |
| | | }, |
| | | /* { |
| | | title: 'è¾
åä½', |
| | | align: 'center', |
| | | dataIndex: 'auxiliaryUnitName' |
| | | }, |
| | | { |
| | | title: 'åºåè¾
æ°é', |
| | | align: 'center', |
| | | dataIndex: 'auxiliaryQuantity' |
| | | }, */ |
| | | ], |
| | | selectedRowKeys: [], |
| | | oldSelectRows: [], |
| | | // scrollTrigger: {}, |
| | | dataSource: [], |
| | | selectionRows: [], |
| | | title: '', |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['5', '10', '30', '50', '100'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | isorter: { |
| | | column: 'num', |
| | | order: 'desc' |
| | | }, |
| | | visible: false, |
| | | loading: false, |
| | | url: { |
| | | list: '/spare/SparesPartInventory/findSparePartInventoryList' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.onSelectChange(selectedRows) |
| | | }, |
| | | getCheckboxProps: record => ({ |
| | | props: { |
| | | disabled: record.distable |
| | | } |
| | | }), |
| | | selectedRowKeys: this.selectedRowKeys |
| | | } |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | async loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | let that = this |
| | | this.loading = true |
| | | let params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | await getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.records.length; i++) { |
| | | if (that.oldSelectRows.indexOf(res.result.records[i].id) > -1) { |
| | | res.result.records[i].distable = true |
| | | } else { |
| | | res.result.records[i].distable = false |
| | | } |
| | | } |
| | | this.dataSource = res.result.records |
| | | this.ipagination.total = res.result.total |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | showModals(oldSelectRows, warehouseId) { |
| | | this.oldSelectRows = oldSelectRows |
| | | this.visible = true |
| | | this.queryParam.warehouseId = warehouseId |
| | | this.loadData(1) |
| | | }, |
| | | getQueryParams() { |
| | | let param = Object.assign({}, this.queryParam, this.isorter) |
| | | param.field = this.getQueryField() |
| | | param.pageNo = this.ipagination.current |
| | | param.pageSize = this.ipagination.pageSize |
| | | return filterObj(param) |
| | | }, |
| | | //æ¥è¯¢æ¡ä»¶å¤ç |
| | | getQueryField() { |
| | | let str = 'id,' |
| | | for (let a = 0; a < this.columns.length; a++) { |
| | | str += ',' + this.columns[a].dataIndex |
| | | } |
| | | return str |
| | | }, |
| | | searchReset(num) { |
| | | let that = this |
| | | this.queryParam = [] |
| | | if (num !== 0) { |
| | | that.loadData(1) |
| | | } |
| | | that.selectborrowIds = [] |
| | | }, |
| | | close() { |
| | | this.searchReset(0) |
| | | this.selectedRowKeys = [] |
| | | this.visible = false |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | //TODO çé |
| | | |
| | | if (Object.keys(sorter).length > 0) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc' |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | handleSubmit() { |
| | | this.$bus.$emit('selectionRows', this.selectionRows) |
| | | this.searchReset(0) |
| | | this.close() |
| | | }, |
| | | onSelectChange(selectionRows) { |
| | | this.selectionRows = selectionRows |
| | | }, |
| | | searchQuery() { |
| | | this.loadData(1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-table-tbody .ant-table-row td { |
| | | padding-top: 10px; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | #components-layout-demo-custom-trigger .trigger { |
| | | font-size: 18px; |
| | | line-height: 64px; |
| | | padding: 0 24px; |
| | | cursor: pointer; |
| | | transition: color 0.3s; |
| | | } |
| | | </style> |