From 1ec4da063b3195f4f46af969a9d170bda2df7c2a Mon Sep 17 00:00:00 2001 From: houjie <714924425@qq.com> Date: 星期三, 23 八月 2023 17:36:08 +0800 Subject: [PATCH] 计量单位:重构, 备件相关功能页面调整 --- src/views/eam/UnitList.vue | 401 +++++++++++++++++++++++++++++++++----------------------- 1 files changed, 236 insertions(+), 165 deletions(-) diff --git a/src/views/eam/UnitList.vue b/src/views/eam/UnitList.vue index 66f0a18..720f997 100644 --- a/src/views/eam/UnitList.vue +++ b/src/views/eam/UnitList.vue @@ -1,187 +1,258 @@ <template> - <div> - <a-card - :bordered="true" - style="height: 50%" - > - <a-row type="flex"> - <a-col><a-button - type="primary" - @click="handleAdd(da)" - >鏂板缓</a-button></a-col> - <a-col><a-button - type="primary" - @click="handleEdit(selectedRows)" - >缂栬緫</a-button></a-col> - <a-col><a-button - type="primary" - @click="batchDel(da)" - >鍒犻櫎</a-button></a-col> - <a-col style="left: 5%"><a-button type="primary">妯℃澘</a-button></a-col> - <a-col style="left: 5%"><a-button type="primary">瀵煎叆</a-button></a-col> - <a-col style="left: 5%"><a-button type="primary">瀵煎嚭</a-button></a-col> - </a-row> - </a-card> - <a-row - type="flex" - :gutter="16" - > - <a-col - :md="5" - :sm="24" + <a-card :bordered="false" title='璁¢噺鍗曚綅'> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" > - 聽 聽 聽 - <MomUnitListLeft - ref="MomUnitListLeft" - class="MomUnitListLeft" - @treeSelect="treeSelect" - /> - 聽 聽 - </a-col> - <a-col - :md="24 - 5" - :sm="24" + <a-row :gutter="24"> + + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="鍗曚綅缂栫爜"> + <j-input + placeholder="璇疯緭鍏ュ崟浣嶇紪鐮�" + v-model="queryParam.num" + ></j-input> + </a-form-item> + </a-col> + <template> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="鍗曚綅鍚嶇О"> + <j-input + placeholder="璇疯緭鍏ュ崟浣嶅悕绉�" + v-model="queryParam.name" + ></j-input> + </a-form-item> + </a-col> + </template> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item + key="1" + @click="batchDel" + ><a-icon type="delete" />鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" > - <MomUnitListRight - ref="MomUnitListRight" - class="MomUnitListRight" - @searchkeys="selectedKeys" - /> - </a-col> - </a-row> - <mom-unit-modal + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange" + > + + <span + slot="action" + slot-scope="text, record" + > + <a @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 @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <unit-modal ref="modalForm" @ok="modalFormOk" - ></mom-unit-modal> - </div> + ></unit-modal> + </a-card> </template> <script> -import MomUnitListLeft from './modules/unit/MomUnitListLeft' -import MomUnitListRight from './modules/unit/MomUnitListRight' -import MomUnitModal from './modules/unit/MomUnitModal' + +import '@assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { deleteAction } from '@/api/manage' +import UnitModal from './modules/unit/UnitModal' export default { - name: 'MomUnitList', - mixins: [JeecgListMixin], - components: { MomUnitListLeft, MomUnitListRight, MomUnitModal }, + name: 'EquipmentImportanceList', + mixins: [JeecgListMixin, mixinDevice], + components: { + UnitModal + }, data() { return { - description: '璁¢噺鍗曚綅椤甸潰', - currentOrgCode: '', - selectedRowKeys: [], - selectedRows: [], + description: '璁¢噺鍗曚綅绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: ' 璁¢噺鍗曚綅缂栫爜', + align: "center", + dataIndex: 'num' + }, + { + title: '璁¢噺鍗曚綅鍚嶇О', + align: "center", + dataIndex: 'name' + }, + { + title: '鍒涘缓浜�', + align: "center", + dataIndex: 'createBy' + }, + { + title: '鍒涘缓鏃ユ湡', + align: "center", + dataIndex: 'createTime' + }, + { + title: '鏇存柊浜�', + align: "center", + dataIndex: 'updateBy' + }, + { + title: '鏇存柊鏃ユ湡', + align: "center", + dataIndex: 'updateTime' + }, + { + title: '澶囨敞', + align: "center", + dataIndex: 'remark' + }, + + { + title: '鎿嶄綔', + dataIndex: 'action', + align: "center", + fixed: "right", + width: 147, + scopedSlots: { customRender: 'action' } + } + ], url: { - list: '/base/getTree', - deleteBatch: '/base/unit/deleteMomUnit', + list: "/base/unit/list", + delete: "/base/unit/delete", + deleteBatch: "/base/unit/deleteBatch", + exportXlsUrl: "/eam/equipmentImportance/exportXls", + importExcelUrl: "/eam/equipmentImportance/importExcel", + }, - da: [], + dictOptions: {}, + superFieldList: [], } }, - - methods: { - //鏂板鏁版嵁锛堟柊寤烘寜閽Е鍙戯級 - handleAdd(da) { - if (this.da.length <= 0) { - this.$message.warning('璇烽�夋嫨涓�涓爲鑺傜偣锛�') - return - } else { - this.$refs.modalForm.add(da, { cb: this.callback }) - } - }, - //淇敼鏁版嵁锛堜慨鏀规寜閽Е鍙戯級 - handleEdit(selectedRows) { - if (this.selectedRows.length <= 0) { - this.$message.warning('璇烽�夋嫨涓�鏉¢渶瑕佷慨鏀圭殑璁¢噺鍗曚綅锛�') - return - } else if (this.selectedRows.length > 1) { - this.$message.warning('娉ㄦ剰锛氬彧鑳介�夋嫨涓�鏉¤閲忓崟浣嶈繘琛屼慨鏀癸紒') - return - } else { - this.$refs.modalForm.edit(selectedRows, { cb: this.callback }) - } - }, - //鎵归噺鍒犻櫎鍙充晶鏁版嵁锛堝垹闄ゆ寜閽Е鍙戯級 - batchDel(da) { - if (!this.url.deleteBatch) { - this.$message.error('璇疯缃畊rl.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.$message.success(res.message) - } else { - that.$message.warning(res.message) - } - }) - .finally(() => { - that.loading = false - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(that.selectedRowKeys.length) - that.onClearSelected() - that.$refs.MomUnitListRight.loadData({ id: da.id }) - that.loadTree() - }) - }, - }) - } - }, - //閲嶆柊璁$畻鍒嗛〉 - reCalculatePage(count) { - //鎬绘暟閲�-count - let total = this.ipagination.total - count - //鑾峰彇鍒犻櫎鍚庣殑鍒嗛〉鏁� - let currentIndex = Math.ceil(total / this.ipagination.pageSize) - //鍒犻櫎鍚庣殑鍒嗛〉鏁�<鎵�鍦ㄥ綋鍓嶉〉 - if (currentIndex < this.ipagination.current) { - this.ipagination.current = currentIndex - } - console.log('currentIndex', currentIndex) - }, - //娓呴櫎鍙充晶閫変腑椤� - onClearSelected() { - this.selectedRowKeys = [] - this.selectedRows = [] - }, - //宸﹀彸鑱斿姩锛坉a涓哄乏渚ч�変腑鏍戠殑鏁版嵁锛屽瓙鎺т欢涓繑鍥烇級 - treeSelect(da) { - let id = da.id - this.da = da - this.onClearSelected() - this.$refs.MomUnitListRight.loadData({ unitCategoryId: id }) - }, - //鍙充晶鍒楄〃閫変腑浜嬩欢 - selectedKeys(selectedRowKeys, selectedRows) { - this.selectedRowKeys = selectedRowKeys - this.selectedRows = selectedRows - }, - //鍔犺浇宸︿晶鏍� - loadTree() { - this.$refs.MomUnitListLeft.queryTreeData() - }, - //鏂板缂栬緫淇濆瓨鍚庡洖璋冨嚱鏁板洖鏄鹃〉闈㈡暟鎹� - callback(id) { - this.$refs.MomUnitListRight.loadData({ id: id }) - this.$refs.MomUnitListRight.getList() + created() { + // this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function () { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; }, }, + methods: { + // initDictConfig() { + // }, + // getSuperFieldList() { + // let fieldList = []; + // fieldList.push({ type: 'string', value: 'num', text: '閲嶈搴︾紪鐮�', dictCode: '' }) + // fieldList.push({ type: 'string', value: 'name', text: '閲嶈搴﹀悕绉�', dictCode: '' }) + // fieldList.push({ type: 'string', value: 'remark', text: '澶囨敞', dictCode: '' }) + // fieldList.push({ type: 'string', value: 'createBy', text: '鍒涘缓浜�', dictCode: '' }) + // fieldList.push({ type: 'datetime', value: 'createTime', text: '鍒涘缓鏃ユ湡' }) + // fieldList.push({ type: 'string', value: 'updateBy', text: '鏇存柊浜�', dictCode: '' }) + // fieldList.push({ type: 'datetime', value: 'updateTime', text: '鏇存柊鏃ユ湡' }) + // this.superFieldList = fieldList + // } + } } </script> <style scoped> -- Gitblit v1.9.3