From 301df333c4dc0c28cee67a8579784bd1c3b85abe Mon Sep 17 00:00:00 2001 From: zhuzhuanzhuan Date: 星期四, 22 二月 2024 15:07:51 +0800 Subject: [PATCH] 1、标准加工时间页面取消按照时间查询 2、设备利用率、设备开动率以及班次利用率页面查询区域日期被删除后因查询不到数据时表格中不会出现任何数据且无提示,故增加提示及禁止删除日期 3、设备综合效率分析页面和设备加工工件报表页面时间被手动清空与点击重置按钮清空后的查询条件不同,调整为时间为空时则查询除时间限定内所有数据 4、利用率走势分析、利用率分段分析以及报警分析页面简化页面查询功能,禁止删除日期 5、优化假期管理、加工数量管理以及合格率管理页面手动清空日期后无法正常查询数据 6、统计分析与统计图表页面调整重置按钮功能为重置名称为第一级车间以及日期为当日前一天,且无法手动清空日期 7、对比分析页面调整重置按钮功能为重置日期为当日前一周,且无法手动清空日期 --- src/views/mdc/base/EquipmentList.vue | 362 +++++++++++++++------------------------------------ 1 files changed, 109 insertions(+), 253 deletions(-) diff --git a/src/views/mdc/base/EquipmentList.vue b/src/views/mdc/base/EquipmentList.vue index cee4b26..2a5815b 100644 --- a/src/views/mdc/base/EquipmentList.vue +++ b/src/views/mdc/base/EquipmentList.vue @@ -8,14 +8,12 @@ <a-col :md="6" :sm="12"> <a-form-item label="璁惧缂栧彿"> - <!--<a-input placeholder="璇疯緭鍏ヨ处鍙锋煡璇�" v-model="queryParam.username"></a-input>--> <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"></a-input> </a-form-item> </a-col> <a-col :md="6" :sm="8"> <a-form-item label="璁惧鍚嶇О"> - <!--<a-input placeholder="璇疯緭鍏ヨ处鍙锋煡璇�" v-model="queryParam.username"></a-input>--> <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="queryParam.equipmentName"></a-input> </a-form-item> </a-col> @@ -23,7 +21,8 @@ <a-col :md="6" :sm="8"> <a-form-item label="杞﹂棿鍚嶇О"> <!--<a-input placeholder="璇疯緭鍏ヨ溅闂村悕绉�" v-model="queryParam.productionName"></a-input>--> - <a-tree-select v-model="queryParam.productionName" :treeData="workshopTreeData" placeholder="璇烽�夋嫨杞﹂棿" tree-default-expand-all></a-tree-select> + <a-tree-select v-model="queryParam.productionName" :treeData="workshopTreeData" placeholder="璇烽�夋嫨杞﹂棿" + :treeDefaultExpandedKeys="treeDefaultExpandedKeys"></a-tree-select> </a-form-item> </a-col> @@ -37,7 +36,7 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator" style="border-top: 5px"> - <a-button @click="handleAdd" type="primary" icon="plus" >娣诲姞璁惧</a-button> + <a-button @click="handleAdd" type="primary" icon="plus">娣诲姞璁惧</a-button> <a-button type="primary" icon="download" @click="handleExportXls('璁惧淇℃伅')">瀵煎嚭</a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay" @click="handleMenuClick"> @@ -56,7 +55,8 @@ <!-- table鍖哄煙-begin --> <div> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> - <i class="anticon anticon-info-circle ant-alert-icon"></i>宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <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> @@ -72,17 +72,10 @@ :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> - - <template slot="avatarslot" slot-scope="text, record, index"> - <div class="anty-img-wrap"> - <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/> - </div> - </template> - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)" >缂栬緫</a> + <a @click="handleEdit(record)">缂栬緫</a> - <a-divider type="vertical" /> + <a-divider type="vertical"/> <a-dropdown> <a class="ant-dropdown-link"> @@ -93,28 +86,11 @@ <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a> </a-menu-item> - <!--<a-menu-item>--> - <!--<a href="javascript:;" @click="handleChangePassword(record.username)">瀵嗙爜</a>--> - <!--</a-menu-item>--> - <a-menu-item> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> <a>鍒犻櫎</a> </a-popconfirm> </a-menu-item> - - <!--<a-menu-item v-if="record.status==1">--> - <!--<a-popconfirm title="纭畾鍐荤粨鍚�?" @confirm="() => handleFrozen(record.id,2,record.username)">--> - <!--<a>鍐荤粨</a>--> - <!--</a-popconfirm>--> - <!--</a-menu-item>--> - - <!--<a-menu-item v-if="record.status==2">--> - <!--<a-popconfirm title="纭畾瑙e喕鍚�?" @confirm="() => handleFrozen(record.id,1,record.username)">--> - <!--<a>瑙e喕</a>--> - <!--</a-popconfirm>--> - <!--</a-menu-item>--> - </a-menu> </a-dropdown> </span> @@ -125,43 +101,21 @@ <!-- table鍖哄煙-end --> <user-modal ref="modalForm" @ok="modalFormOk"></user-modal> - - <password-modal ref="passwordmodal" @ok="passwordModalOk"></password-modal> - - <sys-user-agent-modal ref="sysUserAgentModal"></sys-user-agent-modal> - - <!-- 鐢ㄦ埛鍥炴敹绔� --> - <user-recycle-bin-modal :visible.sync="recycleBinVisible" @ok="modalFormOk"/> - </a-card> </template> <script> import UserModal from './modules/EquipmentList/UserModal' - import PasswordModal from './modules/EquipmentList/PasswordModal' - import {putAction,getFileAccessHttpUrl} from '@/api/manage'; - import {frozenBatch} from '@/api/api' - import {JeecgListMixin} from '@/mixins/JeecgListMixin' - import SysUserAgentModal from "./modules/EquipmentList/SysUserAgentModal"; - import JInput from '@/components/jeecg/JInput' - import UserRecycleBinModal from './modules/EquipmentList/UserRecycleBinModal' - import JSuperQuery from '@/components/jeecg/JSuperQuery' - import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { queryProductionTreeList } from '@/api/api' - import {mapActions} from 'vuex' + import { mapActions } from 'vuex' export default { - name: "EquipmentList", + name: 'EquipmentList', mixins: [JeecgListMixin], components: { - JThirdAppButton, - SysUserAgentModal, UserModal, - PasswordModal, - JInput, - UserRecycleBinModal, - JSuperQuery }, data() { return { @@ -172,103 +126,88 @@ { title: '#', dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 } }, { title: '璁惧缂栧彿', - align: "center", + align: 'center', dataIndex: 'equipmentId', - width: 200, - // sorter: true + width: 200 }, { title: '璁惧鍚嶇О', - align: "center", + align: 'center', width: 200, - dataIndex: 'equipmentName', + dataIndex: 'equipmentName' }, { title: '杞﹂棿', - align: "center", + align: 'center', width: 200, dataIndex: 'productionName' }, { title: '璁惧绫诲瀷', - align: "center", + align: 'center', width: 200, - dataIndex: 'equipmentType', - // scopedSlots: {customRender: "avatarslot"} + dataIndex: 'equipmentType' }, - { title: '椹卞姩绫诲瀷', - align: "center", + align: 'center', width: 200, - dataIndex: 'driveType', - // sorter: true + dataIndex: 'driveType' }, { title: '鏈哄簥IP', - align: "center", + align: 'center', width: 200, dataIndex: 'equipmentIp' }, { title: '璁惧鍔熺巼', - align: "center", + align: 'center', width: 200, dataIndex: 'devicePower' }, { title: '閮ㄩ棬', - align: "center", + align: 'center', width: 200, dataIndex: 'orgCodeTxt' }, { title: '绯荤粺鐗堟湰', - align: "center", + align: 'center', width: 200, dataIndex: 'systemVersion' }, { title: '鎿嶄綔', dataIndex: 'action', - scopedSlots: {customRender: 'action'}, - align: "center", + scopedSlots: { customRender: 'action' }, + align: 'center', width: 150, - fixed:'right' + fixed: 'right' } ], - // superQueryFieldList: [ - // { type: 'input', value: 'username', text: '鐢ㄦ埛璐﹀彿', }, - // { type: 'input', value: 'realname', text: '鐢ㄦ埛濮撳悕', }, - // { type: 'select', value: 'sex', dbType: 'int', text: '鎬у埆', dictCode: 'sex' }, - // ], url: { - syncUser: "/act/process/extActProcess/doSyncUser", - list: "/mdc/mdcEquipment/list", - delete: "/mdc/mdcEquipment/delete", - deleteBatch: "/mdc/mdcEquipment/deleteBatch", - exportXlsUrl: "/mdc/mdcEquipment/exportXls", - // importExcelUrl: "sys/user/importExcel", + list: '/mdc/mdcEquipment/list', + delete: '/mdc/mdcEquipment/delete', + deleteBatch: '/mdc/mdcEquipment/deleteBatch', + exportXlsUrl: '/mdc/mdcEquipment/exportXls' }, - isDepartType:'', - workshopTreeData:[] + isDepartType: '', + workshopTreeData: [], + treeDefaultExpandedKeys: [] } - }, - computed: { - // importExcelUrl: function(){ - // return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; - // } }, created() { this.queryTreeData() @@ -280,61 +219,60 @@ this.QueryDepartTree().then(res => { if (res.success) { this.isDepartType = res.result[0].value - if(this.isDepartType == -1){ - this.columns=[ + if (this.isDepartType == -1) { + this.columns = [ { title: '#', dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 } }, { title: '璁惧缂栧彿', - align: "center", + align: 'center', dataIndex: 'equipmentId', - width: 200, + width: 200 // sorter: true }, { title: '璁惧鍚嶇О', - align: "center", + align: 'center', width: 200, - dataIndex: 'equipmentName', + dataIndex: 'equipmentName' }, { title: '杞﹂棿', - align: "center", + align: 'center', width: 200, dataIndex: 'productionName' }, { title: '璁惧绫诲瀷', - align: "center", + align: 'center', width: 200, - dataIndex: 'equipmentType', - // scopedSlots: {customRender: "avatarslot"} + dataIndex: 'equipmentType' }, { title: '椹卞姩绫诲瀷', - align: "center", + align: 'center', width: 200, - dataIndex: 'driveType', + dataIndex: 'driveType' // sorter: true }, { title: '鏈哄簥IP', - align: "center", + align: 'center', width: 200, dataIndex: 'equipmentIp' }, { title: '璁惧鍔熺巼', - align: "center", + align: 'center', width: 200, dataIndex: 'devicePower' }, @@ -347,98 +285,97 @@ { title: '绯荤粺鐗堟湰', - align: "center", + align: 'center', width: 200, dataIndex: 'systemVersion' }, { title: '鎿嶄綔', dataIndex: 'action', - scopedSlots: {customRender: 'action'}, - align: "center", + scopedSlots: { customRender: 'action' }, + align: 'center', width: 150, - fixed:'right' + fixed: 'right' } ] - }else{ - this.columns=[ + } else { + this.columns = [ { title: '#', dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 } }, { title: '璁惧缂栧彿', - align: "center", + align: 'center', dataIndex: 'equipmentId', - width: 200, + width: 200 // sorter: true }, { title: '璁惧鍚嶇О', - align: "center", + align: 'center', width: 200, - dataIndex: 'equipmentName', + dataIndex: 'equipmentName' }, { title: '杞﹂棿', - align: "center", + align: 'center', width: 200, dataIndex: 'productionName' }, { title: '璁惧绫诲瀷', - align: "center", + align: 'center', width: 200, - dataIndex: 'equipmentType', - // scopedSlots: {customRender: "avatarslot"} + dataIndex: 'equipmentType' }, { title: '椹卞姩绫诲瀷', - align: "center", + align: 'center', width: 200, - dataIndex: 'driveType', + dataIndex: 'driveType' // sorter: true }, { title: '鏈哄簥IP', - align: "center", + align: 'center', width: 200, dataIndex: 'equipmentIp' }, { title: '璁惧鍔熺巼', - align: "center", + align: 'center', width: 200, dataIndex: 'devicePower' }, { title: '閮ㄩ棬', - align: "center", + align: 'center', width: 200, dataIndex: 'orgCodeTxt' }, { title: '绯荤粺鐗堟湰', - align: "center", + align: 'center', width: 200, dataIndex: 'systemVersion' }, { title: '鎿嶄綔', dataIndex: 'action', - scopedSlots: {customRender: 'action'}, - align: "center", + scopedSlots: { customRender: 'action' }, + align: 'center', width: 150, - fixed:'right' + fixed: 'right' } ] @@ -447,125 +384,44 @@ } else { // this.$message.warn(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } - }).finally(() =>{ + }).finally(() => { }) }, - handleEdit: function (record) { - this.$refs.modalForm.edit(record); - this.$refs.modalForm.title = "缂栬緫"; - this.$refs.modalForm.disableSubmit = false; - this.$refs.modalForm.disSeach = true; + /** + * 璋冪敤鎺ュ彛鑾峰彇鏌ヨ鍖哄煙杞﹂棿鏍戝垪琛� + */ + getWorkshopListByApi() { + queryProductionTreeList().then(res => { + if (res.success) { + this.workshopTreeData = res.result + this.treeDefaultExpandedKeys = [...res.result].map(item => item.key) + } + }) + }, + handleEdit: function(record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.disSeach = true // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶 this.$refs.modalForm.removeValidate() }, - handleAdd: function () { - this.$refs.modalForm.add(); - this.$refs.modalForm.title = "鏂板"; - this.$refs.modalForm.disableSubmit = false; - this.$refs.modalForm.disSeach = false; - }, - getAvatarView: function (avatar) { - return getFileAccessHttpUrl(avatar) - }, - batchFrozen: function (status) { - if (this.selectedRowKeys.length <= 0) { - // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); - this.$notification.warning({ - message:'娑堟伅', - description:"璇烽�夋嫨涓�鏉¤褰�" - }); - return false; - } else { - let ids = ""; - let that = this; - let isAdmin = false; - that.selectionRows.forEach(function (row) { - if (row.username == 'admin') { - isAdmin = true; - } - }); - if (isAdmin) { - that.$message.warning('绠$悊鍛樿处鍙蜂笉鍏佽姝ゆ搷浣�,璇烽噸鏂伴�夋嫨锛�'); - return; - } - that.selectedRowKeys.forEach(function (val) { - ids += val + ","; - }); - that.$confirm({ - title: "纭鎿嶄綔", - content: "鏄惁" + (status == 1 ? "瑙e喕" : "鍐荤粨") + "閫変腑璐﹀彿?", - onOk: function () { - frozenBatch({ids: ids, status: status}).then((res) => { - if (res.success) { - // that.$message.success(res.message); - that.$notification.success({ - message:'娑堟伅', - description:res.message - }); - that.loadData(); - that.onClearSelected(); - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); - - } - }); - } - }); - } + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.disSeach = false }, handleMenuClick(e) { if (e.key == 1) { - this.batchDel(); - } else if (e.key == 2) { - this.batchFrozen(2); - } else if (e.key == 3) { - this.batchFrozen(1); + this.batchDel() } }, - // handleFrozen: function (id, status, username) { - // let that = this; - // //TODO 鍚庡彴鏍¢獙绠$悊鍛樿鑹� - // if ('admin' == username) { - // that.$message.warning('绠$悊鍛樿处鍙蜂笉鍏佽姝ゆ搷浣滐紒'); - // return; - // } - // frozenBatch({ids: id, status: status}).then((res) => { - // if (res.success) { - // that.$message.success(res.message); - // that.loadData(); - // } else { - // that.$message.warning(res.message); - // } - // }); - // }, - // handleChangePassword(username) { - // this.$refs.passwordmodal.show(username); - // }, - passwordModalOk() { - //TODO 瀵嗙爜淇敼瀹屾垚 涓嶉渶瑕佸埛鏂伴〉闈紝鍙互鎶奷atasource涓殑鏁版嵁鏇存柊涓�涓� - }, - onSyncFinally({isToLocal}) { - // 鍚屾鍒版湰鍦版椂鍒锋柊涓嬫暟鎹� - if (isToLocal) { - this.loadData() - } - }, - - getWorkshopListByApi(){ - queryProductionTreeList().then(res=>{ - if(res.success) this.workshopTreeData=res.result - }) - } } - } </script> <style scoped> -- Gitblit v1.9.3