From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期一, 18 九月 2023 13:24:30 +0800 Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430 --- src/views/spare/modules/sparePartReceive/SpareSelectList.vue | 293 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 293 insertions(+), 0 deletions(-) diff --git a/src/views/spare/modules/sparePartReceive/SpareSelectList.vue b/src/views/spare/modules/sparePartReceive/SpareSelectList.vue new file mode 100644 index 0000000..d0dd846 --- /dev/null +++ b/src/views/spare/modules/sparePartReceive/SpareSelectList.vue @@ -0,0 +1,293 @@ +<template> + <!--鏀寔鍏ㄥ睆缂╂斁--> + <a-modal :visible='visible' :title='title' switchFullscreen @ok='handleSubmit' @cancel='close' style='top:50px' + cancelText='鍏抽棴' :width='1800'> + <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='6' :sm='4'> + <a-form-item label='澶囦欢缂栫爜'> + <a-input placeholder='璇疯緭鍏ュ浠剁紪鐮�' v-model='queryParam.num'/> + </a-form-item> + </a-col> + <a-col :md='6' :sm='4'> + <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-row :gutter='24'> + <a-col :md='24' :sm='12'> + <a-table ref='table' + :scroll='{ x: true }' + size='middle' rowKey='id' + bordered + :columns='columns' + :dataSource='dataSource' + :pagination='ipagination' + :rowSelection='rowSelection' + + :loading='loading' + @change='handleTableChange'> + </a-table> + </a-col> + </a-row> + + </a-card> + </a-modal> +</template> + +<script> +import { filterObj } from '@/utils/util' +import { getAction } from '@api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' + +export default { + name: 'SpareSelectList', + mixins: [JeecgListMixin], + components: {}, + data() { + return { + + queryParam: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + columns: [ + { + title: '澶囦欢缂栫爜', + align: 'center', + dataIndex: 'spareNum', + ellipsis: true + }, + { + title: '澶囦欢鍚嶇О', + align: 'center', + dataIndex: 'spareName', + ellipsis: true + }, + { + title: '鍨嬪彿', + align: 'center', + dataIndex: 'model', + + }, + { + title: '瑙勬牸', + align: 'center', + dataIndex: 'specification', + ellipsis: true + }, + { + title: '鎵规鍙�', + align: 'center', + dataIndex: 'batchNum', + + + }, + { + title: '鍒堕�犲晢', + align: 'center', + dataIndex: 'constructorName', + }, + { + title: '鍑哄巶鏃ユ湡', + align: 'center', + dataIndex: 'manufactureDate', + + }, + { title: '鏈夋晥鏈�', + align: 'center', + dataIndex: 'validityPeriod', + + + }, + { title: '鍗曚綅', + align: 'center', + dataIndex: 'mainUnitId_dictText', + }, + /* { title: '杈呭崟浣�', + align: 'center', + dataIndex: 'auxiliaryUnitId_dictText', + width: 150 + + }, */ + { title: '鏁伴噺', + align: 'center', + dataIndex: 'mainQuantity', + + + }, + /* { title: '杈呮暟閲�', + align: 'center', + dataIndex: 'auxiliaryQuantity', + width: 150 + + }, */ + /* { + title: '鎹㈢畻姣斾緥', + align: 'center', + dataIndex: 'conversionRatio', + width: 150 + } */ + ], + selectedRowKeys: [], + oldSelectRows: [], + scrollTrigger: {}, + dataSource: [], + selectSource: [], + 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/sparePartScrap/getSpareList' + }, + } + }, + 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 + } + 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 (this.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) { + console.log(oldSelectRows) + this.oldSelectRows = oldSelectRows + this.visible = true + 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) { + this.queryParam = [] + if (num !== 0) { + this.loadData(1) + } + this.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> \ No newline at end of file -- Gitblit v1.9.3