¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | class="card-area" |
| | | > |
| | | <template slot="title"> |
| | | <i |
| | | class="action-jeecg actionsite2" |
| | | style="font-size: 18px;" |
| | | /> |
| | | ä»åºä¿¡æ¯ |
| | | </template> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <!-- æç´¢åºå --> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | <a-col |
| | | :md="8" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="ä»åºç¼å·"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä»åºç¼å·æ¥è¯¢" |
| | | v-model="queryParam.code" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="8" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="ä»åºåç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä»åºåç§°æ¥è¯¢" |
| | | v-model="queryParam.name" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div |
| | | class="table-operator" |
| | | style="margin-top: 5px" |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | @click="searchReset" |
| | | icon="reload" |
| | | >éç½®</a-button> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | <a-button |
| | | type="primary" |
| | | icon="download" |
| | | hidden |
| | | @click="handleExportXls('???')" |
| | | >导åº</a-button> |
| | | <a-dropdown |
| | | hidden |
| | | v-if="selectedRowKeys.length > 0" |
| | | > |
| | | <a-button style="margin-left: 8px"> |
| | | æ¹éæä½ |
| | | <a-icon type="down" /> |
| | | </a-button> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item @click="batchDel"> |
| | | <a-icon type="delete" />å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="rowSelection" |
| | | @change="handleTableChange" |
| | | :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" |
| | | :customRow="clickThenSelect" |
| | | > |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a |
| | | href="javascript:;" |
| | | @click="handleEdit(record)" |
| | | >ç¼è¾</a> |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link"> |
| | | æ´å¤ |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | </a-table> |
| | | |
| | | <a-tabs |
| | | type="card" |
| | | defaultActiveKey="1" |
| | | > |
| | | <a-tab-pane key="1"> |
| | | <span slot="tab"> |
| | | <a-badge v-if="showTabsFlag">åºåºåºä½ </a-badge> |
| | | <a-badge |
| | | v-if="!showTabsFlag" |
| | | :count="5" |
| | | show-zero |
| | | :number-style="{ backgroundColor: '#52c41a' }" |
| | | >åºåºåºä½ </a-badge> |
| | | </span> |
| | | <div |
| | | class="table-operator" |
| | | style="margin: 10px" |
| | | > |
| | | |
| | | <warehouse-area-location-list ref="WarehouseAreaLocationList"></warehouse-area-location-list> |
| | | </div> |
| | | </a-tab-pane> |
| | | |
| | | <!-- <a-tab-pane |
| | | key="2" |
| | | forceRender |
| | | > |
| | | <span slot="tab"> |
| | | <a-badge v-if="showTabsFlag">管ç对象 </a-badge> |
| | | <a-badge |
| | | v-if="!showTabsFlag" |
| | | :count="5" |
| | | show-zero |
| | | :number-style="{ backgroundColor: '#52c41a' }" |
| | | >管ç对象 </a-badge> |
| | | </span> |
| | | <div |
| | | class="table-operator" |
| | | style="margin: 10px" |
| | | > |
| | | <manage-object-list ref="ManageObjectList"></manage-object-list> |
| | | </div> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane |
| | | key="3" |
| | | forceRender |
| | | > |
| | | <span slot="tab"> |
| | | <a-badge v-if="showTabsFlag">æå¡å¯¹è±¡ </a-badge> |
| | | <a-badge |
| | | v-if="!showTabsFlag" |
| | | :count="5" |
| | | show-zero |
| | | :number-style="{ backgroundColor: '#52c41a' }" |
| | | >æå¡å¯¹è±¡ </a-badge> |
| | | </span> |
| | | <div |
| | | class="table-operator" |
| | | style="margin: 10px" |
| | | > |
| | | <service-object-list ref="EquipmentFileList"></service-object-list> |
| | | </div> |
| | | </a-tab-pane> --> |
| | | </a-tabs> |
| | | <warehouse-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></warehouse-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { requestPut, deleteAction, getFileAccessHttpUrl, getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import WarehouseModal from './modules/warehouseNew/WarehouseModal.vue' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | import JEllipsis from '@/components/jeecg/JEllipsis' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import Vue from 'vue' |
| | | |
| | | import WarehouseAreaLocationList from './modules/warehouseNew/WarehouseAreaLocationList' |
| | | import ManageObjectList from './modules/warehouseNew/ManageObjectList' |
| | | import ServiceObjectList from './modules/warehouseNew/ServiceObjectList.vue' |
| | | |
| | | export default { |
| | | name: 'WarehouseListNew.', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | WarehouseModal, |
| | | JInput, |
| | | JEllipsis, |
| | | WarehouseAreaLocationList, |
| | | ManageObjectList, |
| | | Tooltip, |
| | | ServiceObjectList, |
| | | }, |
| | | data() { |
| | | return { |
| | | showTabsFlag: true, |
| | | disabled: true, |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '20'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | selectedRowKeys: [], |
| | | selectionRows: [], |
| | | //é»è®¤æåº |
| | | isorter: { |
| | | column: 'code', |
| | | order: 'desc', |
| | | }, |
| | | |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | width: 50, |
| | | }, |
| | | { |
| | | title: 'ä»åºç¼ç ', |
| | | align: "center", |
| | | dataIndex: 'code', |
| | | }, |
| | | { |
| | | title: 'ä»åºåç§°', |
| | | align: "center", |
| | | dataIndex: 'name', |
| | | }, |
| | | { |
| | | title: 'ä»åºç±»å', |
| | | align: "center", |
| | | dataIndex: 'type_dictText', |
| | | }, |
| | | { |
| | | title: 'æ¯å¦åºååº', |
| | | align: "center", |
| | | dataIndex: 'whetherWasteWarehouse_dictText', |
| | | }, |
| | | { |
| | | title: 'åºåºåºä½ç®¡ç', |
| | | align: "center", |
| | | dataIndex: 'locationManage_dictText', |
| | | }, |
| | | { |
| | | title: 'æå¡å¯¹è±¡ç±»å', |
| | | align: "center", |
| | | dataIndex: 'serviceObject_dictText', |
| | | }, |
| | | { |
| | | title: 'èªå¨å', |
| | | align: "center", |
| | | dataIndex: 'whetherAutomationWarehouse_dictText', |
| | | }, |
| | | { |
| | | title: '夿³¨', |
| | | align: "center", |
| | | dataIndex: 'remark', |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: "center", |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action', |
| | | }, |
| | | width: 200, |
| | | fixed: 'right', |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/base/warehouse/find", |
| | | delete: "/base/warehouse/deleteWarehouseAreaLocation", |
| | | active: "/eam/equipment/active", |
| | | exportXlsUrl: '/eam/equipment/exportXls', |
| | | importExcelUrl: 'base/site/importExcel', |
| | | }, |
| | | //æ°å¢ãç¼è¾ãå é¤ãæ¹éå 餿使¹åæ°æ®åå·æ°å
³èçç»ä»¶ççå¬å±æ§ |
| | | alterFlag: "", |
| | | }; |
| | | }, |
| | | |
| | | computed: { |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.onSelectChange(selectedRowKeys, selectedRows); |
| | | }, |
| | | getCheckboxProps(record) { |
| | | return ({ |
| | | props: { |
| | | // disabled: !(record.equipmentCategoryDtlList.length == 0), |
| | | } |
| | | }) |
| | | }, |
| | | selectedRowKeys: this.selectedRowKeys, |
| | | }; |
| | | }, |
| | | }, |
| | | methods: { |
| | | |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(","), [record]); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | if (selectedRowKeys.length == 1) { |
| | | this.$refs.WarehouseAreaLocationList.warehouseId = selectedRowKeys[0] |
| | | // this.$refs.EquipmentFileList.warehouseId = selectedRowKeys[0] |
| | | // this.$refs.ManageObjectList.warehouseId = selectedRowKeys[0] |
| | | } else { |
| | | this.$refs.WarehouseAreaLocationList.warehouseId = '-1' |
| | | // this.$refs.ManageObjectList.warehouseId = '-1' |
| | | // this.$refs.EquipmentFileList.warehouseId = '-1' |
| | | } |
| | | }, |
| | | |
| | | //ç¦ç¨ç¶ææ ·å¼ |
| | | tableRowClass(record, index) { |
| | | if (record.status != "1") { |
| | | return "frozenRowClass"; |
| | | } |
| | | return ""; |
| | | }, |
| | | |
| | | handleActive(id) { |
| | | let that = this; |
| | | requestPut(that.url.active, {}, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }); |
| | | }, |
| | | handleAdd: function () { |
| | | this.$refs.modalForm.add(); |
| | | this.$refs.modalForm.title = "æ°å¢"; |
| | | this.$refs.modalForm.disableSubmit = false; |
| | | }, |
| | | handleDelete: function (id) { |
| | | if (!this.url.delete) { |
| | | this.$message.error("请设置url.delete屿§!") |
| | | return |
| | | } |
| | | var that = this; |
| | | deleteAction(that.url.delete, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(1) |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | that.alterFlag = new Date(); |
| | | that.selectionRows = [] |
| | | that.selectedRowKeys = [] |
| | | that.$refs.WarehouseAreaLocationList.warehouseId = '-1' |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | batchDel: function () { |
| | | if (!this.url.deleteBatch) { |
| | | this.$message.error("请设置url.deleteBatch屿§!") |
| | | return |
| | | } |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼'); |
| | | return; |
| | | } else { |
| | | var ids = ""; |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ","; |
| | | } |
| | | var that = this; |
| | | this.$confirm({ |
| | | title: "确认å é¤", |
| | | content: "æ¯å¦å é¤é䏿°æ®?", |
| | | onOk: function () { |
| | | that.loading = true; |
| | | deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | that.onClearSelected(); |
| | | that.alterFlag = new Date(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | |
| | | searchReset() { |
| | | this.queryParam = {}; |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | this.$refs.WarehouseAreaLocationList.warehouseId = '-1' |
| | | this.loadData(1); |
| | | |
| | | }, |
| | | |
| | | searchQuery() { |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | this.$refs.WarehouseAreaLocationList.warehouseId = '-1' |
| | | // this.$refs.ManageObjectList.warehouseId = '-1' |
| | | // this.$refs.EquipmentFileList.warehouseId = '-1' |
| | | this.loadData(1); |
| | | }, |
| | | |
| | | modalFormOk() { |
| | | // æ°å¢/ä¿®æ¹ æåæ¶ï¼éè½½å表 |
| | | this.loadData() |
| | | //æ¸
空å表éä¸ |
| | | this.onClearSelected() |
| | | |
| | | this.$refs.WarehouseAreaLocationList.warehouseId = '-1' |
| | | // this.$refs.ManageObjectList.warehouseId = '-1' |
| | | // this.$refs.EquipmentFileList.warehouseId = '-1' |
| | | }, |
| | | }, |
| | | watch: { |
| | | // alterFlag() { |
| | | // this.$bus.$emit('queryTreeData'); |
| | | // }, |
| | | selectionRows() { |
| | | this.$bus.$emit('warehouseSelectionRows', this.selectionRows); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.queryParam = {}; |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | this.loadData(1); |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | | <style> |
| | | @import '~@assets/less/common.less'; |
| | | |
| | | .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | .success { |
| | | color: green; |
| | | } |
| | | .error { |
| | | color: red; |
| | | } |
| | | .fontweight { |
| | | font-weight: bold; |
| | | } |
| | | </style> |