¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered='false' |
| | | :class="'cust-erp-sub-tab'" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class='table-page-search-wrapper'> |
| | | |
| | | </div> |
| | | |
| | | <div> |
| | | |
| | | <a-table |
| | | ref='table' |
| | | size='middle' |
| | | bordered |
| | | rowKey='id' |
| | | :scroll="{ x: 'calc(1400px + 50%)', y: 900 }" |
| | | :columns='columns' |
| | | :dataSource='dataSource' |
| | | :pagination='ipagination' |
| | | :loading='loading' |
| | | @change='handleTableChange' |
| | | > |
| | | <template slot="scrapReason" slot-scope="text" > |
| | | <a-tooltip placement="top" :title="text" trigger="hover"> |
| | | <div> |
| | | <template slot="title"> </template> |
| | | <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p> |
| | | </div> |
| | | </a-tooltip> |
| | | </template> |
| | | <template |
| | | slot='htmlSlot' |
| | | slot-scope='text' |
| | | > |
| | | <div v-html='text'></div> |
| | | </template> |
| | | <template |
| | | slot='imgSlot' |
| | | slot-scope='text,record' |
| | | > |
| | | <span |
| | | v-if='!text' |
| | | style='font-size: 12px;font-style: italic;' |
| | | >æ å¾ç</span> |
| | | <img |
| | | v-else |
| | | :src='getImgView(text)' |
| | | :preview='record.id' |
| | | height='25px' |
| | | alt='' |
| | | style='max-width:80px;font-size: 12px;font-style: italic;' |
| | | /> |
| | | </template> |
| | | <template |
| | | slot='takingInfo' |
| | | slot-scope='text' |
| | | > |
| | | <span |
| | | v-if='!text' |
| | | style='font-size: 12px;font-style: italic;color: #126ee7;' |
| | | >/</span> |
| | | <span |
| | | v-if='text' |
| | | style='font-size: 12px;font-style: italic;' |
| | | >{{ text }}</span> |
| | | </template> |
| | | <template |
| | | slot='fileSlot' |
| | | slot-scope='text'> |
| | | <span |
| | | v-if='!text' |
| | | style='font-size: 12px;font-style: italic;'>æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost='true' |
| | | type='primary' |
| | | icon='download' |
| | | size='small' |
| | | @click='downloadFile(text)'> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span |
| | | slot='action' |
| | | slot-scope='text, record'> |
| | | <a @click='handleEdit(record)'>ç¼è¾</a> |
| | | <a-divider type='vertical' /> |
| | | |
| | | <a-popconfirm |
| | | title='ç¡®å®å é¤å?' |
| | | @confirm='() => handleDelete(record.id)'> |
| | | <a v-if="record.uda1 == 'ä¸éè¿'">å é¤</a> |
| | | </a-popconfirm> |
| | | |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction } from '@api/manage' |
| | | |
| | | function Tooltip(props) { |
| | | return null |
| | | } |
| | | |
| | | export default { |
| | | name: 'SparePartScrapDetailList', |
| | | mixins: [JeecgListMixin], |
| | | |
| | | props: { |
| | | mainId: { |
| | | type: String, |
| | | default: '', |
| | | required: false |
| | | } |
| | | }, |
| | | watch: { |
| | | mainId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | if (!this.mainId) { |
| | | this.clearList() |
| | | } else { |
| | | this.queryParam['sparePartScrapId'] = val |
| | | this.loadData(1) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | description: 'å¤ä»¶æ¥åºç®¡ç页é¢', |
| | | disableMixinCreated: true, |
| | | // 表头 |
| | | columns: [ |
| | | |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'spareNum', |
| | | |
| | | }, |
| | | |
| | | { |
| | | title: 'å¤ä»¶åç§°', |
| | | align: 'center', |
| | | dataIndex: 'spareName', |
| | | |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | align: 'center', |
| | | dataIndex: 'specification', |
| | | |
| | | }, |
| | | { |
| | | title: 'åå·', |
| | | align: 'center', |
| | | dataIndex: 'model', |
| | | ellipsis: true |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | align: 'center', |
| | | dataIndex: 'mainUnitIdName', |
| | | |
| | | }, |
| | | { |
| | | title: 'åºåæ°é', |
| | | align: 'center', |
| | | dataIndex: 'mainQuantity', |
| | | |
| | | }, |
| | | /* { |
| | | title: 'è¾
åä½', |
| | | align: 'center', |
| | | dataIndex: 'auxiliaryUnitIdName', |
| | | |
| | | ellipsis: true |
| | | }, */ |
| | | /* { |
| | | title: 'åºåè¾
æ°é', |
| | | align: 'center', |
| | | dataIndex: 'auxiliaryQuantity', |
| | | |
| | | }, */ |
| | | |
| | | { |
| | | title: 'æ¥åºæ°é', |
| | | align: 'center', |
| | | dataIndex: 'scrapMainQuantity', |
| | | |
| | | }, |
| | | |
| | | /* { |
| | | title: 'æ¥åºè¾
æ°é', |
| | | align: 'center', |
| | | dataIndex: 'scrapAuxiliaryQuantity', |
| | | |
| | | }, */ |
| | | { |
| | | title: 'æ¥åºåå ', |
| | | align: 'center', |
| | | dataIndex: 'scrapReason', |
| | | scopedSlots: { customRender: 'scrapReason' }, //å¿
å |
| | | ellipsis: true, |
| | | |
| | | }, |
| | | { |
| | | title: 'åºåº', |
| | | align: 'center', |
| | | dataIndex: 'warehouseAreaIdName', |
| | | |
| | | }, |
| | | { |
| | | title: 'åºä½', |
| | | align: 'center', |
| | | dataIndex: 'warehouseLocationIdName', |
| | | |
| | | }, |
| | | |
| | | |
| | | ], |
| | | url: { |
| | | list: '/spare/sparePartScrap/listSparePartScrapDetailByMainId' |
| | | }, |
| | | dictOptions: { |
| | | type: [], |
| | | inventoryStatus: [] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | importExcelUrl() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}` |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | clearList() { |
| | | this.dataSource = [] |
| | | this.selectedRowKeys = [] |
| | | this.ipagination.current = 1 |
| | | }, |
| | | |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | //update-begin---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | this.dataSource = res.result.records || res.result |
| | | this.$emit('getDetailList', res.result.records) |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | |
| | | </style> |