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/eam/modules/equipment/EquipmentAccount2List.vue | 938 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 938 insertions(+), 0 deletions(-) diff --git a/src/views/eam/modules/equipment/EquipmentAccount2List.vue b/src/views/eam/modules/equipment/EquipmentAccount2List.vue new file mode 100644 index 0000000..e8231ce --- /dev/null +++ b/src/views/eam/modules/equipment/EquipmentAccount2List.vue @@ -0,0 +1,938 @@ +<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="璁惧缂栧彿"> + <a-input + placeholder="璇疯緭鍏ヨ澶囩紪鍙锋煡璇�" + v-model="queryParam.num" + ></a-input> + </a-form-item> + </a-col> + <a-col + :md="8" + :sm="8" + > + <a-form-item label="璁惧鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ヨ澶囧悕绉版煡璇�" + v-model="queryParam.name" + ></a-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" + :hidden="disabled" + >鏂板</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <a-button + type="primary" + icon="download" + @click="handleExportXls('???')" + >瀵煎嚭</a-button> + <a-dropdown 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(4000px + 50%)', y: 900 }" + :customRow="clickThenSelect" + > + <span + slot="equipmentPhoto" + slot-scope="text,record" + > + <Tooltip + placement="top" + title="棰勮鍥剧墖" + > + <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;" + /> + </Tooltip> + </span> + + <!--宸ヨ壓鍙傛暟涓�у睍绀�--> + <span + slot="processParameters" + slot-scope="text,record" + > + <a-badge + v-if="record.processParameters==1" + status="success" + /> + <span + v-if="record.processParameters==1" + class="success" + >鏄�</span> + <a-badge + v-if="record.processParameters==0" + status="error" + /> + <span + v-if="record.processParameters==0" + class="error" + >鍚�</span> + </span> + <span + slot="processParameters" + slot-scope="text,record" + > + <a-badge + v-if="record.processParameters==1" + status="success" + /> + <span + v-if="record.processParameters==1" + class="success" + >鏄�</span> + <a-badge + v-if="record.processParameters==0" + status="error" + /> + <span + v-if="record.processParameters==0" + class="error" + >鍚�</span> + </span> + <span + slot="precisionParameters" + slot-scope="text,record" + > + <a-badge + v-if="record.precisionParameters==1" + status="success" + /> + <span + v-if="record.precisionParameters==1" + class="success" + >鏄�</span> + <a-badge + v-if="record.precisionParameters==0" + status="error" + /> + <span + v-if="record.precisionParameters==0" + class="error" + >鍚�</span> + </span> + <span + slot="verification" + slot-scope="text,record" + > + <a-badge + v-if="record.verification==1" + status="success" + /> + <span + v-if="record.verification==1" + class="success" + >鏄�</span> + <a-badge + v-if="record.verification==0" + status="error" + /> + <span + v-if="record.verification==0" + class="error" + >鍚�</span> + </span> + + <span + slot="action" + slot-scope="text, record" + > + <!-- class="table-operation" --> + <!-- <a + href="javascript:;" + @click="equipmentStructuresShow(record)" + >璁惧缁撴瀯</a> + <a-divider type="vertical" /> --> + <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 @click="equipmentResumeShow(record)">璁惧灞ュ巻</a> + </a-menu-item> + <a-menu-item> + <a @click="handleEdit(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> + + <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-top: 0px" + > + <process-parameters-list ref="ProcessParametersList"></process-parameters-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-top: 0px" + > + <precision-parameters-list ref="PrecisionParametersList"></precision-parameters-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-top: 0px" + > + <equipment-file-list ref="EquipmentFileList"></equipment-file-list> + </div> + </a-tab-pane> + + </a-tabs> + <equipment-model + ref="modalForm" + @ok="modalFormOk" + ></equipment-model> + + <equipment-structure-drawer + ref="EquipmentStructureDrawer" + @ok="modalFormOk" + ></equipment-structure-drawer> + + <equipment-resume-drawer + ref="EquipmentResumeDrawer" + @ok="modalFormOk" + ></equipment-resume-drawer> + </a-card> +</template> + +<script> +import { requestPut, deleteAction, getFileAccessHttpUrl, getAction } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import EquipmentModel from './EquipmentModel.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 ProcessParametersList from './ProcessParametersList' +import PrecisionParametersList from './PrecisionParametersList' +import EquipmentFileList from './EquipmentFileList' +import EquipmentStructureDrawer from './EquipmentStructureDrawer' +import EquipmentResumeDrawer from './EquipmentResume/EquipmentResumeDrawer' + +export default { + name: 'EquipmentCategory2List.', + mixins: [JeecgListMixin], + components: { + EquipmentModel, + JInput, + JEllipsis, + ProcessParametersList, + PrecisionParametersList, + EquipmentFileList, + Tooltip, + EquipmentStructureDrawer, + EquipmentResumeDrawer + }, + props: { + nodeSelected: { + type: Object, + default: {} + } + }, + 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: 'num', + order: 'asc', + }, + + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + width: 50, + }, + { + title: '缁熶竴缂栫爜', + align: "center", + dataIndex: 'num', + }, + { + title: '璁惧鍚嶇О', + align: "center", + dataIndex: 'name', + }, + { + title: '鍨嬪彿', + align: "center", + dataIndex: 'model', + }, + { + title: '瑙勬牸', + align: "center", + dataIndex: 'specification', + }, + // { + // title: '璧勪骇缂栫爜', + // align: "center", + // dataIndex: 'assetNumber', + // }, + { + title: '鎬诲姛鐜�', + align: "center", + dataIndex: 'gpo', + }, + { + title: '浣跨敤閮ㄩ棬', + align: "center", + dataIndex: 'useId_dictText', + }, + { + title: '宸ュ尯', + align: "center", + dataIndex: 'equipmentUda1', + }, + { + title: '缁存姢閮ㄩ棬', + align: "center", + dataIndex: 'manageId_dictText', + }, + { + title: '缁翠慨鐝粍', + align: "center", + dataIndex: 'teamId_dictText', + }, + { + title: 'ABC鏍囪瘑', + align: "center", + dataIndex: 'equipmentImportanceId_dictText', + }, + { + title: '鍏抽敭璁惧鏍囪瘑', + align: "center", + dataIndex: 'keyEquipmentIdentification', + }, + { + title: '瀹夊叏閰嶇疆', + align: "center", + dataIndex: 'securityConfiguration', + }, + { + title: '鍐峰嵈绯荤粺', + align: "center", + dataIndex: 'coolingSystem', + }, + { + title: '鐏伀鍣�', + align: "center", + dataIndex: 'fireExtinguisher', + }, + + { + title: '鐏伀鍣ㄦ湁鏁堟湡', + align: "center", + dataIndex: 'fireExtinguisherValidityPeriod', + }, + { + title: '鎿嶄綔绯荤粺', + align: "center", + dataIndex: 'operatingSystem', + }, + { + title: '绯荤粺', + align: "center", + dataIndex: 'system', + }, + { + title: '璁惧绔彛', + align: "center", + dataIndex: 'port', + }, + { + title: '鍧愭爣鏁伴噺', + align: "center", + dataIndex: 'coordinateNum', + }, + { + title: '璁惧鐘舵��', + align: "center", + dataIndex: 'equipmentStatus_dictText', + }, + { + title: '閲嶉噺', + align: "center", + dataIndex: 'equipmentUda3', + }, + { + title: '閲嶉噺璁¢噺鍗曚綅', + align: "center", + dataIndex: 'equipmentUda4_dictText', + }, + { + title: '鍔熻兘浣嶇疆', + align: "center", + dataIndex: 'equipmentUda5', + }, + { + title: '瀹夎浣嶇疆', + align: "center", + dataIndex: 'equipmentUda2', + }, + { + title: '鍑哄巶鏃ユ湡', + align: "center", + dataIndex: 'leaveFactoryDate', + }, + { + title: '绔嬮」鍗″彿', + align: "center", + dataIndex: 'projectApprovalNo', + }, + { + title: '璧勯噾鏉ユ簮', + align: "center", + dataIndex: 'fundSource', + }, + { + title: '楠屾敹鏃ユ湡', + align: "center", + dataIndex: 'acceptanceCheckDate', + }, + { + title: '鍑哄巶缂栧彿', + align: "center", + dataIndex: 'factoryNo', + }, + { + title: '璧勪骇鍒堕�犲晢', + align: "center", + dataIndex: 'constructorId_dictText', + }, + { + title: '璧勪骇鐨勬潵婧愬浗瀹�', + align: "center", + dataIndex: 'sourceCountry', + }, + // { + // title: '鎶�鏈姸鎬�', + // align: "center", + // dataIndex: 'technologyStatus_dictText', + // }, + // { + // title: '鐗圭璁惧', + // align: "center", + // dataIndex: 'specificEquipment_dictText', + // }, + // { + // title: '璁惧鍥剧墖', + // align: "center", + // dataIndex: 'equipmentPhoto', + // scopedSlots: { customRender: 'equipmentPhoto' }, + // }, + // { + // title: '渚涘簲鍟�', + // align: "center", + // dataIndex: 'supplierId_dictText', + // }, + // { + // title: '鍑哄巶缂栧彿', + // align: "center", + // dataIndex: 'factoryNumber', + // }, + // { + // title: '鍑哄巶鏃ユ湡', + // align: "center", + // dataIndex: 'leaveFactoryDate', + // }, + // { + // title: '楠屾敹鏃ユ湡', + // align: "center", + // dataIndex: 'acceptanceCheckDate', + // }, + // // { + // // title: '鎵�鏈夌粍缁�', + // // align: "center", + // // dataIndex: 'affiliationId_dictText', + // // }, + + // { + // title: '绠$悊浜哄憳', + // align: "center", + // dataIndex: 'manager_dictText', + // }, + // { + // title: '浣跨敤閮ㄩ棬', + // align: "center", + // dataIndex: 'useId_dictText', + // }, + // { + // title: '璐d换浜�', + // align: "center", + // dataIndex: 'functionary_dictText', + // }, + // { + // title: '浣嶇疆', + // align: "center", + // dataIndex: 'location', + // }, + { + title: '宸ヨ壓鍙傛暟绠$悊', + align: "center", + dataIndex: 'processParameters', + scopedSlots: { customRender: 'processParameters' }, + }, + { + title: '宸ヨ壓鍙傛暟妯℃澘', + align: "center", + dataIndex: 'processParametersTemplateName', + }, + // { + // title: '璁惧绮惧害绠$悊', + // align: "center", + // dataIndex: 'precisionParameters', + // scopedSlots: { customRender: 'precisionParameters' }, + // }, + // { + // title: '绮惧害鍙傛暟妯℃澘', + // align: "center", + // dataIndex: 'precisionParametersTemplateName', + // }, + // // { + // // title: '妫�瀹氱鐞�', + // // align: "center", + // // dataIndex: 'verification', + // // scopedSlots: { customRender: 'verification' }, + // // }, + // // { + // // title: '妫�瀹氬懆鏈�/鏈�', + // // align: "center", + // // dataIndex: 'verificationPeriod', + // // }, + // // { + // // title: '涓婃妫�瀹氭棩鏈�', + // // align: "center", + // // dataIndex: 'lastVerificationDate', + // // }, + // // { + // // title: '涓嬫妫�瀹氭棩鏈�', + // // align: "center", + // // dataIndex: 'nextVerificationDate', + // // }, + // // { + // // title: '鐘舵��', + // // align: 'center', + // // dataIndex: 'status', + // // width: 100, + // // }, + { + title: '澶囨敞', + align: "center", + dataIndex: 'remark', + }, + { + title: '鎿嶄綔', + align: "center", + dataIndex: 'action', + scopedSlots: { + customRender: 'action', + }, + width: 200, + fixed: 'right', + }, + ], + url: { + list: "/eam/equipment/list", + delete: "/eam/equipment/delete", + deleteBatch: "/eam/equipment/deleteBatch", + active: "/eam/equipment/active", + exportXlsUrl: '/eam/equipment/exportXls', + importExcelUrl: "/eam/equipment/importExcel", + // importExcelUrl: 'base/site/importExcel', + }, + //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� + alterFlag: "", + equipmentRecord: {}, + // parentNum: "-1", + // parentName: "璁惧鍒嗙被", + }; + }, + + 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, + }; + }, + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, + + onSelectChange(selectedRowKeys, selectionRows) { + if (selectedRowKeys.length == 1) { + this.$refs.ProcessParametersList.equipmentId = selectedRowKeys[0] + this.$refs.EquipmentFileList.equipmentId = selectedRowKeys[0] + this.$refs.PrecisionParametersList.equipmentId = selectedRowKeys[0] + } else { + this.$refs.ProcessParametersList.equipmentId = '-1' + this.$refs.PrecisionParametersList.equipmentId = '-1' + this.$refs.EquipmentFileList.equipmentId = '-1' + } + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + }, + + //绂佺敤鐘舵�佹牱寮� + 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({ processParameters: '1', precisionParameters: '1', verification: '1' }); + this.$refs.modalForm.title = "鏂板"; + this.$refs.modalForm.disableSubmit = false; + this.$refs.modalForm.equipmentCategoryId = this.nodeSelected.key; + }, + handleDelete: function (id) { + if (!this.url.delete) { + this.$message.error("璇疯缃畊rl.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(); + } else { + that.$message.warning(res.message); + } + }); + }, + + batchDel: function () { + 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.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; + }); + } + }); + } + }, + + equipmentStructuresShow(record) { + this.$refs.EquipmentStructureDrawer.visible = true + this.$refs.EquipmentStructureDrawer.title = '璁惧缁撴瀯' + setTimeout(() => { + this.$bus.$emit('equipmentRecord', record) + this.$bus.$emit('equipmentStructureId', '-1') + }, 200) + }, + + + equipmentResumeShow(record) { + this.$refs.EquipmentResumeDrawer.visible = true + this.$refs.EquipmentResumeDrawer.title = '璁惧灞ュ巻' + this.$refs.EquipmentResumeDrawer.handleShow(record) + }, + + searchReset() { + this.queryParam = {}; + if (this.nodeSelected.key != -1) { + this.disabled = false; + this.queryParam.equipmentCategoryId = this.nodeSelected.key; + } else { + this.disabled = true; + } + this.selectedRowKeys = [] + this.selectionRows = [] + // this.$refs.ProcessParametersList.equipmentId = '-1' + this.$refs.PrecisionParametersList.equipmentId = '-1' + this.$refs.EquipmentFileList.equipmentId = '-1' + this.loadData(1); + }, + + searchQuery() { + this.selectedRowKeys = [] + this.selectionRows = [] + // this.$refs.ProcessParametersList.equipmentId = '-1' + this.$refs.PrecisionParametersList.equipmentId = '-1' + this.$refs.EquipmentFileList.equipmentId = '-1' + this.loadData(1); + }, + + modalFormOk() { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData() + //娓呯┖鍒楄〃閫変腑 + this.onClearSelected() + + // this.$refs.ProcessParametersList.equipmentId = '-1' + this.$refs.PrecisionParametersList.equipmentId = '-1' + this.$refs.EquipmentFileList.equipmentId = '-1' + }, + }, + watch: { + alterFlag() { + this.$bus.$emit('queryTreeData'); + }, + selectionRows() { + this.$bus.$emit('equipmentSelectionRows', this.selectionRows); + }, + nodeSelected() { + this.queryParam = {}; + if (this.nodeSelected.key != -1) { + this.disabled = false; + this.queryParam.equipmentCategoryId = this.nodeSelected.key; + } else { + this.disabled = true; + } + this.selectedRowKeys = [] + this.selectionRows = [] + // this.$refs.ProcessParametersList.equipmentId = '-1' + this.$refs.PrecisionParametersList.equipmentId = '-1' + this.$refs.EquipmentFileList.equipmentId = '-1' + this.loadData(1); + }, + }, + created() { + this.queryParam = {}; + this.queryParam.equipmentCategoryId = this.nodeSelected.key; + 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> \ No newline at end of file -- Gitblit v1.9.3