From e2726f9984cd169e184d6767594d2f4ed93610a0 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期二, 30 七月 2024 10:00:46 +0800 Subject: [PATCH] 1、修改项目名称和logo 2、调整用户管理编辑字段 3、调整首页为设备监控页面 --- src/views/mdc/base/modules/deviceRepair/JDate.vue | 86 src/views/mdc/base/modules/deviceRepair/DeviceRepairModel.vue | 519 ++++ src/components/tools/UserMenu.vue | 49 src/views/mdc/base/MdcUtilizationRateList.vue | 209 + src/components/tools/Logo.vue | 4 src/views/user/Login.vue | 4 src/views/mdc/base/DeviceRepair.vue | 141 + src/views/mdc/base/DeviceParamThresholdManagement.vue | 250 ++ src/views/mdc/base/modules/deviceRepair/DeviceRepairModelEdit.vue | 485 ++++ src/views/system/modules/UserModal.vue | 116 src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeForm.vue | 126 + src/api/mdc.js | 13 src/utils/util.js | 6 src/views/mdc/base/modules/deviceRepair/DeviceRepairEditListModel.vue | 238 ++ src/config/router.config.js | 6 src/components/layouts/TabLayout.vue | 12 src/components/page/GlobalLayout.vue | 6 src/defaultSettings.js | 2 src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationForm.vue | 124 + src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue | 638 +++++ src/views/mdc/base/modules/deviceRepair/DeviceRepairListModel.vue | 365 +++ public/index.html | 2 src/views/mdc/base/DeviceBaseInfo.vue | 1 src/views/mdc/base/modules/DeviceParamThresholdManagement/ParamThresholdModal.vue | 252 ++ src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue | 762 ++++++ src/views/mdc/base/Torqueconfiguration.vue | 139 + src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.vue | 60 src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalList.vue | 340 +++ src/views/mdc/base/modules/deviceRepair/DeviceRepairModelAdd.vue | 390 +++ src/views/mdc/base/modules/mdcUtilizationRate/MdcUtilizationRateModel.vue | 204 + src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModal.vue | 385 +++ src/assets/logo-yt.jpg | 0 src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.Style#Drawer.vue | 84 src/components/page/GlobalHeader.vue | 2 src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue | 372 +++ src/views/mdc/base/MdcEquipmentTypeList.vue | 218 + 36 files changed, 6,502 insertions(+), 108 deletions(-) diff --git a/public/index.html b/public/index.html index f42bfe6..64e7658 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> - <title>JeecgBoot 浼佷笟绾т綆浠g爜骞冲彴</title> + <title>涓浗涓�鎷栫鐞嗙郴缁�</title> <link rel="icon" href="<%= BASE_URL %>logo.png"> <script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script> <style> diff --git a/src/api/mdc.js b/src/api/mdc.js index cf25ea1..002c46f 100644 --- a/src/api/mdc.js +++ b/src/api/mdc.js @@ -5,5 +5,16 @@ getDriveTypeApi: () => getAction('/mdc/mdcDriveTypeParamConfig/getDriveParamOptions'), // -------------------------------------璁惧鐢垫祦璐熻浇瀵规瘮椤甸潰-------------------------------------------- // 鑾峰彇璁惧鐢垫祦璐熻浇瀵规瘮鍥捐〃鏁版嵁 - getEquipCurrentLoadContrastChartDataApi: params => getAction('/mdc/equipmentElectricStatistical/getElectricValue', params) + getEquipCurrentLoadContrastChartDataApi: params => getAction('/mdc/equipmentElectricStatistical/getElectricValue', params), + // -------------------------------------璁惧鍙傛暟闃堝�肩鐞嗛〉闈�-------------------------------------------- + // 鏍规嵁椹卞姩绫诲瀷鑾峰彇鍙傛暟 + getParamListByDriveTypeApi: controlSystemType => getAction(`/mdc/mdcDriveTypeParamConfig/getDriveParamOptionsByType?controlSystemType=${controlSystemType}`), + // 澧炲姞璁惧鍙傛暟闃堝�� + addParamThresholdApi: params => postAction('/mdc/mdcEquipmentThreshold/add', params), + // 缂栬緫璁惧鍙傛暟闃堝�� + editParamThresholdApi: params => postAction('/mdc/mdcEquipmentThreshold/edit', params), + // 鍒犻櫎璁惧鍙傛暟闃堝�� + deleteParamThresholdApi: id => deleteAction('/mdc/mdcEquipmentThreshold/delete', { id }), + // 鍒犻櫎璁惧鍙傛暟闃堝�� + deleteBatchParamThresholdApi: ids => deleteAction('/mdc/mdcEquipmentThreshold/deleteBatch', { ids }) } \ No newline at end of file diff --git a/src/assets/logo-yt.jpg b/src/assets/logo-yt.jpg new file mode 100644 index 0000000..c51fe2a --- /dev/null +++ b/src/assets/logo-yt.jpg Binary files differ diff --git a/src/components/layouts/TabLayout.vue b/src/components/layouts/TabLayout.vue index 4249c19..f4b8b07 100644 --- a/src/components/layouts/TabLayout.vue +++ b/src/components/layouts/TabLayout.vue @@ -14,7 +14,7 @@ @change="changePage" @tabClick="tabCallBack" @edit="editPage"> - <a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList" :closable="!(page.meta.title=='棣栭〉')"> + <a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList" :closable="!(page.meta.title=='璁惧鐩戞帶')"> <span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span> </a-tab-pane> </a-tabs> @@ -43,7 +43,7 @@ import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types' import registerApps from "@/qiankun"; - const indexKey = '/dashboard/analysis' + const indexKey = '/mdc/base/DeviceBaseInfo' export default { name: 'TabLayout', @@ -165,12 +165,12 @@ // 灏嗛椤垫坊鍔犲埌绗竴浣� addIndexToFirst() { this.pageList.splice(0, 0, { - name: 'dashboard-analysis', + name: 'mdc-base-DeviceBaseInfo', path: indexKey, fullPath: indexKey, meta: { - icon: 'dashboard', - title: '棣栭〉' + icon: '', + title: '璁惧鐩戞帶' } }) this.linkList.splice(0, 0, indexKey) @@ -183,7 +183,7 @@ * @param title 瑕佷慨鏀圭殑鏂版爣棰� */ changeTitle(title) { - let projectTitle = "Jeecg-Boot 浼佷笟绾т綆浠g爜骞冲彴" + let projectTitle = "涓浗涓�鎷栫鐞嗙郴缁�" // 棣栭〉鐗规畩澶勭悊 if (this.$route.path === indexKey) { document.title = projectTitle diff --git a/src/components/page/GlobalHeader.vue b/src/components/page/GlobalHeader.vue index 4463912..d4224a6 100644 --- a/src/components/page/GlobalHeader.vue +++ b/src/components/page/GlobalHeader.vue @@ -152,7 +152,7 @@ } else { let rightWidth = '400px' this.topMenuStyle.topNavHeader = { 'min-width': '165px' } - this.topMenuStyle.topSmenuStyle = { 'width': 'calc(100% - 165px)' } + this.topMenuStyle.topSmenuStyle = { 'width': 'calc(100% - 240px)' } this.topMenuStyle.headerIndexRight = { 'min-width': rightWidth, 'white-space': 'nowrap' } this.topMenuStyle.headerIndexLeft = { 'width': `calc(100% - ${rightWidth})` } } diff --git a/src/components/page/GlobalLayout.vue b/src/components/page/GlobalLayout.vue index 7b0aa51..842d256 100644 --- a/src/components/page/GlobalLayout.vue +++ b/src/components/page/GlobalLayout.vue @@ -134,11 +134,11 @@ //--update-begin----author:scott---date:20190320------for:鏍规嵁鍚庡彴鑿滃崟閰嶇疆锛屽垽鏂槸鍚﹁矾鐢辫彍鍗曞瓧娈碉紝鍔ㄦ�侀�夋嫨鏄惁鐢熸垚璺敱锛堜负浜嗘敮鎸佸弬鏁癠RL鑿滃崟锛�------ //this.menus = this.mainRouters.find((item) => item.path === '/').children; this.menus = this.permissionMenuList - + //--update-begin----author:liusq---date:20210223------for:鍏充簬娴嬭竟鑿滃崟閬尅鍐呭闂璇︾粏璇存槑 #2255 this.collapsed=!this.sidebarOpened; //--update-begin----author:liusq---date:20210223------for:鍏充簬娴嬭竟鑿滃崟閬尅鍐呭闂璇︾粏璇存槑 #2255 - + // 鏍规嵁鍚庡彴閰嶇疆鑿滃崟锛岄噸鏂版帓搴忓姞杞借矾鐢变俊鎭� //console.log('----鍔犺浇鑿滃崟閫昏緫----') //console.log(this.mainRouters) @@ -463,7 +463,7 @@ display: flex; .logo.top-nav-header { - width: 165px; + width: 240px; height: 64px; position: relative; line-height: 64px; diff --git a/src/components/tools/Logo.vue b/src/components/tools/Logo.vue index d0fb089..2fe9c07 100644 --- a/src/components/tools/Logo.vue +++ b/src/components/tools/Logo.vue @@ -4,7 +4,7 @@ <!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo棰滆壊鏍规嵁涓婚棰滆壊鍙樺寲 --> <img v-if="navTheme === 'dark'" src="~@/assets/logo-white.png" alt="logo"> - <img v-else src="~@/assets/logo.svg" alt="logo"> + <img v-else src="~@/assets/logo-yt.jpg" alt="logo"> <!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo棰滆壊鏍规嵁涓婚棰滆壊鍙樺寲 --> <h1 v-if="showTitle">{{ title }}</h1> @@ -21,7 +21,7 @@ props: { title: { type: String, - default: 'Jeecg-Boot Pro', + default: '涓浗涓�鎷栭泦鍥㈡湁闄愬叕鍙�', required: false }, showTitle: { diff --git a/src/components/tools/UserMenu.vue b/src/components/tools/UserMenu.vue index f8e3d4e..9609f96 100644 --- a/src/components/tools/UserMenu.vue +++ b/src/components/tools/UserMenu.vue @@ -26,11 +26,6 @@ <!-- update-end author:sunjianlei date:20200219 for: 鑿滃崟鎼滅储鏀逛负鍔ㄦ�佺粍浠讹紝鍦ㄦ墜鏈虹鍛堢幇鍑哄脊鍑烘 --> <!-- update-end author:sunjianlei date:20191220 for: 瑙e喅鍏ㄥ眬鏍峰紡鍐茬獊鐨勯棶棰� --> <!-- update_end author:zhaoxin date:20191129 for: 鍋氬ご閮ㄨ彍鍗曟爮瀵艰埅 --> - <span class="action"> - <a class="logout_title" target="_blank" href="http://doc.jeecg.com"> - <a-icon type="question-circle-o"></a-icon> - </a> - </span> <header-notice class="action"/> <a-dropdown> <span class="action action-full ant-dropdown-link user-dropdown-menu"> @@ -38,30 +33,30 @@ <span v-if="isDesktop()">娆㈣繋鎮紝{{ nickname() }}</span> </span> <a-menu slot="overlay" class="user-dropdown-menu-wrapper"> - <a-menu-item key="0"> - <router-link :to="{ name: 'account-center' }"> - <a-icon type="user"/> - <span>涓汉涓績</span> - </router-link> - </a-menu-item> - <a-menu-item key="1"> - <router-link :to="{ name: 'account-settings-base' }"> - <a-icon type="setting"/> - <span>璐︽埛璁剧疆</span> - </router-link> - </a-menu-item> - <a-menu-item key="3" @click="systemSetting"> - <a-icon type="tool"/> - <span>绯荤粺璁剧疆</span> - </a-menu-item> + <!--<a-menu-item key="0">--> + <!--<router-link :to="{ name: 'account-center' }">--> + <!--<a-icon type="user"/>--> + <!--<span>涓汉涓績</span>--> + <!--</router-link>--> + <!--</a-menu-item>--> + <!--<a-menu-item key="1">--> + <!--<router-link :to="{ name: 'account-settings-base' }">--> + <!--<a-icon type="setting"/>--> + <!--<span>璐︽埛璁剧疆</span>--> + <!--</router-link>--> + <!--</a-menu-item>--> + <!--<a-menu-item key="3" @click="systemSetting">--> + <!--<a-icon type="tool"/>--> + <!--<span>绯荤粺璁剧疆</span>--> + <!--</a-menu-item>--> <a-menu-item key="4" @click="updatePassword"> <a-icon type="setting"/> <span>瀵嗙爜淇敼</span> </a-menu-item> - <a-menu-item key="5" @click="updateCurrentDepart"> - <a-icon type="cluster"/> - <span>鍒囨崲閮ㄩ棬</span> - </a-menu-item> + <!--<a-menu-item key="5" @click="updateCurrentDepart">--> + <!--<a-icon type="cluster"/>--> + <!--<span>鍒囨崲閮ㄩ棬</span>--> + <!--</a-menu-item>--> <a-menu-item key="6" @click="clearCache"> <a-icon type="sync"/> <span>娓呯悊缂撳瓨</span> @@ -184,8 +179,8 @@ onOk() { return that.Logout({}).then(() => { // update-begin author:scott date:20211223 for:銆怞TC-198銆戦��鍑虹櫥褰曚綋楠屼笉濂� - //that.$router.push({ path: '/user/login' }); - window.location.reload() + that.$router.push({ path: '/user/login' }); + // window.location.reload() // update-end author:scott date:20211223 for:銆怞TC-198銆戦��鍑虹櫥褰曚綋楠屼笉濂� }).catch(err => { that.$message.error({ diff --git a/src/config/router.config.js b/src/config/router.config.js index eaa75d9..cafae25 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -8,10 +8,10 @@ { path: '/', - name: 'dashboard', + name: 'mdc-base-DeviceBaseInfo', component: TabLayout, - meta: { title: '棣栭〉' }, - redirect: '/dashboard/analysis', + meta: { title: '璁惧鐩戞帶' }, + redirect: '/mdc/base/DeviceBaseInfo', children: [] }, { diff --git a/src/defaultSettings.js b/src/defaultSettings.js index 2d337e1..150475c 100644 --- a/src/defaultSettings.js +++ b/src/defaultSettings.js @@ -15,7 +15,7 @@ export default { primaryColor: '#000000', // primary color of ant design - navTheme: 'dark', // theme for nav menu + navTheme: 'light', // theme for nav menu layout: 'topmenu', // nav menu position: sidemenu or topmenu contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu fixedHeader: true, // sticky header diff --git a/src/utils/util.js b/src/utils/util.js index bf4f48f..6c74fe3 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -85,11 +85,11 @@ export function generateIndexRouter(data) { let indexRouter = [{ path: '/', - name: 'dashboard', + name: 'mdc-base-DeviceBaseInfo', //component: () => import('@/components/layouts/BasicLayout'), component: resolve => require(['@/components/layouts/TabLayout'], resolve), - meta: { title: '棣栭〉' }, - redirect: '/dashboard/analysis', + meta: { title: '璁惧鐩戞帶' }, + redirect: '/mdc/base/DeviceBaseInfo', children: [ ...generateChildRouters(data) ] diff --git a/src/views/mdc/base/DeviceBaseInfo.vue b/src/views/mdc/base/DeviceBaseInfo.vue index 0394307..4791344 100644 --- a/src/views/mdc/base/DeviceBaseInfo.vue +++ b/src/views/mdc/base/DeviceBaseInfo.vue @@ -106,6 +106,7 @@ created() { const { productionId } = this.$route.params if (productionId) this.param.key = productionId + console.log(this.$route) }, methods: { equipmentStatistics(param, resopnse = { key: false }) { diff --git a/src/views/mdc/base/DeviceParamThresholdManagement.vue b/src/views/mdc/base/DeviceParamThresholdManagement.vue new file mode 100644 index 0000000..2ed2a2d --- /dev/null +++ b/src/views/mdc/base/DeviceParamThresholdManagement.vue @@ -0,0 +1,250 @@ +<template> + <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="12"> + <a-form-item label="涓枃鍚�"> + <j-input placeholder="璇疯緭鍏ヤ腑鏂囧悕" v-model="queryParam.chineseName"></j-input> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="8"> + <a-form-item label="鑻辨枃鍚�"> + <j-input placeholder="璇疯緭鍏ヨ嫳鏂囧悕" v-model="queryParam.englishName"></j-input> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="8"> + <a-form-item label="椹卞姩绫诲瀷"> + <a-auto-complete + v-model="queryParam.controlSystemType" + :data-source="driveTypeList" + placeholder="璇烽�夋嫨鎺у埗绯荤粺绫诲瀷" + :filter-option="filterOption" + :allowClear="true" + /> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="8"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" style="border-top: 5px"> + <a-button @click="handleAdd" type="primary" icon="plus">娣诲姞鍙傛暟闃堝��</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay" @click="handleMenuClick"> + <a-menu-item key="1"> + <a-icon type="delete" @click="batchDel"/> + 鍒犻櫎 + </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;"> + <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" + bordered + size="middle" + rowKey="id" + :scroll="{x:'max-content',y:600}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :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-divider type="vertical"/> + + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + + </span> + + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <ParamThresholdModal ref="modalForm" @ok="modalFormOk" :driveTypeList="driveTypeList"/> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import api from '@/api/mdc' + import ParamThresholdModal from './modules/DeviceParamThresholdManagement/ParamThresholdModal' + + export default { + name: 'EquipmentList', + mixins: [JeecgListMixin], + components: { + ParamThresholdModal + }, + data() { + return { + name: 'DeviceParamThresholdManagement', + description: '杩欐槸璁惧鍙傛暟闃堝�肩鐞嗛〉闈�', + queryParam: {}, + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '涓枃鍚�', + align: 'center', + dataIndex: 'chineseName', + width: 350 + // sorter: true + }, + { + title: '鑻辨枃鍚�', + align: 'center', + width: 350, + dataIndex: 'englishName' + }, + { + title: '椹卞姩绫诲瀷', + align: 'center', + width: 350, + dataIndex: 'controlSystemType' + }, + { + title: '闃堝�间笂闄�', + align: 'center', + width: 270, + dataIndex: 'maxThreshold' + // scopedSlots: {customRender: "avatarslot"} + }, + { + title: '闃堝�间笅闄�', + align: 'center', + width: 270, + dataIndex: 'minThreshold' + // sorter: true + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + fixed: 'right', + width: 150 + } + ], + driveTypeList: [], + url: { + list: '/mdc/mdcEquipmentThreshold/list', + delete: '/mdc/mdcEquipmentThreshold/delete', + deleteBatch: '/mdc/mdcEquipmentThreshold/deleteBatch' + } + } + }, + created() { + this.getDriveTypeByApi() + }, + methods: { + handleEdit: function(record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + + // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶 + this.$refs.modalForm.removeValidate() + }, + + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + + // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶 + this.$refs.modalForm.removeValidate() + }, + + handleMenuClick(e) { + if (e.key == 1) { + this.batchDel() + } else if (e.key == 2) { + this.batchFrozen(2) + } else if (e.key == 3) { + this.batchFrozen(1) + } + }, + + /** + * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + */ + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + this.driveTypeList = res.result.map(item => item.value) + }) + }, + + /** + * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳� + * @param input 杈撳叆鐨勫唴瀹� + * @param option 閰嶇疆 + * @returns {boolean} 鍒ゆ柇鏄惁绛涢�� + */ + filterOption(input, option) { + return ( + option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0 + ) + } + } + + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> \ No newline at end of file diff --git a/src/views/mdc/base/DeviceRepair.vue b/src/views/mdc/base/DeviceRepair.vue new file mode 100644 index 0000000..adc416c --- /dev/null +++ b/src/views/mdc/base/DeviceRepair.vue @@ -0,0 +1,141 @@ +<template> + <div style="width: 100%; height: 100%;"> + <a-card :bordered="false"> + <a-row type="flex" :gutter="16"> + <a-col :md="5"> + <a-tabs :activeKey="activeKey" @change="tabChange"> + <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render> + <base-tree @getCurrSelected="changeSelectionNode"></base-tree> + </a-tab-pane> + <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇"> + <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree> + </a-tab-pane> + </a-tabs> + </a-col> + <a-col :md="19"> + <device-repair-list ref="DeviceRepairList" :nodeTree='selectEquement' :nodePeople='selectPeople' :Type="slectTypeTree" /> + </a-col> + </a-row> + + </a-card> + </div> + +</template> + +<script> + import { putAction, getAction } from '@/api/manage' + import { frozenBatch } from '@/api/api' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import JInput from '@/components/jeecg/JInput' + import BaseTree from '../common/BaseTree' + import DeviceRepairList from './modules/deviceRepair/DeviceRepairList' + import JSuperQuery from '@/components/jeecg/JSuperQuery' + import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton' + import DepartTree from './modules/DepartList/DepartListTree/DepartTree' + import {mapActions} from 'vuex' + + export default { + name: 'DeviceRepair', + components: { + JThirdAppButton, + JInput, + BaseTree, + JSuperQuery, + DepartTree, + DeviceRepairList + }, + data() { + return { + activeKey: '1', + description: '璁惧淇℃伅', + selectEquementId: '', + selectEquement: {}, + selectPeople:{}, + slectTypeTree: '', + url: { + equipmentStatistics: '/mdc/equipment/equipmentStatistics' + }, + isDepartType:'', + } + }, + created() { + this.queryTreeData() + }, + methods: { + ...mapActions(['QueryDepartTree']), + queryTreeData() { + this.QueryDepartTree().then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + } else { + // this.$message.warn(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + + } + }).finally(() =>{ + }) + }, + tabChange(val) { + // console.log(val) + this.activeKey = val + this.slectTypeTree = val + }, + /* changeSelection(val) { + this.selectEquementId = val + this.$refs.DeviceRepairList.pQuery(val) + },*/ + changeSelectionNode(val) { + this.selectEquement = val + this.slectTypeTree = '1' + }, + changeSelectionNodedd(val) { + this.selectPeople = val + this.slectTypeTree = '2' + } + } + + } +</script> +<style scoped> + @import '~@assets/less/common.less'; + + .equipMessage { + width: 100%; + height: 10%; + } + + .equipMessage table { + width: 60%; + height: 100%; + line-height: 50%; + } + + .equipMessage table td { + text-align: center; + } + + .equipMessage table td span { + display: inline-block; + width: 15px; + height: 15px; + } + + .equipMessage table td .equipShutdown { + background-color: #808080; + } + + .equipMessage table td .equipStandby { + background-color: #ffbf37; + } + + .equipMessage table td .equipRun { + background-color: #19FE01; + } + + .equipMessage table td .equipAlarm { + background-color: #FD0008; + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/MdcEquipmentTypeList.vue b/src/views/mdc/base/MdcEquipmentTypeList.vue new file mode 100644 index 0000000..3f6577e --- /dev/null +++ b/src/views/mdc/base/MdcEquipmentTypeList.vue @@ -0,0 +1,218 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁惧绫诲瀷鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囩被鍨嬪悕绉�" v-model="queryParam.equipmentTypeName"></a-input> + </a-form-item> + </a-col> + <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> + <!--<a @click="handleToggleSearch" style="margin-left: 8px">--> + <!--{{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}--> + <!--<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>--> + <!--</a>--> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <!--<a-button type="primary" icon="download" @click="handleExportXls('璁惧绫诲瀷')">瀵煎嚭</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>--> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> + <!--<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> + <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;"> + <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" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange" + :scroll="{x:'max-content',y:465}" + > + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <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;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <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> + + <mdc-equipment-type-modal ref="modalForm" @ok="modalFormOk"></mdc-equipment-type-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import MdcEquipmentTypeModal from './modules/EquipmentTypeList/MdcEquipmentTypeModal' + import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' + + export default { + name: 'MdcEquipmentTypeList', + mixins:[JeecgListMixin, mixinDevice], + components: { + MdcEquipmentTypeModal + }, + data () { + return { + description: '璁惧绫诲瀷绠$悊椤甸潰', + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'璁惧绫诲瀷鍚嶇О', + align:"center", + dataIndex: 'equipmentTypeName', + width:530 + }, + { + title:'璁惧绫诲瀷鍥剧墖', + align:"center", + dataIndex: 'equipmentTypePictures', + scopedSlots: {customRender: 'imgSlot'}, + width:530 + }, + { + title:'璁惧绫诲瀷鐘舵��', + align:"center", + dataIndex: 'equipmentTypeStates', + customRender: (text) => (text ? filterMultiDictText(this.dictOptions['equipmentTypeStates'], text) : ''), + width:530 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + scopedSlots: { customRender: 'action' }, + width:150, + fixed:'right' + } + ], + url: { + list: "/mdc/mdcEquipmentType/queryWrapper", + delete: "/mdc/mdcEquipmentType/deleteEquipmentType", + deleteBatch: "/mdc/mdcEquipmentType/deleteBatchEquipmentType", + exportXlsUrl: "/mdcequipmenttype/mdcEquipmentType/exportXls", + importExcelUrl: "mdcequipmenttype/mdcEquipmentType/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.$set(this.dictOptions, 'equipmentTypeStates', [{text:'鏄�',value:'Y'},{text:'鍚�',value:'N'}]) + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'equipmentTypeName',text:'璁惧绫诲瀷鍚嶇О',dictCode:''}) + fieldList.push({type:'string',value:'equipmentTypePictures',text:'璁惧绫诲瀷鍥剧墖',dictCode:''}) + fieldList.push({type:'switch',value:'equipmentTypeStates',text:'璁惧绫诲瀷鐘舵��'}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/mdc/base/MdcUtilizationRateList.vue b/src/views/mdc/base/MdcUtilizationRateList.vue new file mode 100644 index 0000000..896efef --- /dev/null +++ b/src/views/mdc/base/MdcUtilizationRateList.vue @@ -0,0 +1,209 @@ +<template> + <a-card :bordered="false" class="mdcutilization_list"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="8"> + <a-form-item label="绫诲埆"> + <a-input placeholder="璇疯緭鍏ョ被鍒�" v-model="queryParam.rateParameterCategory"></a-input> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="8"> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <!--<div class="table-operator">--> + <!--<a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>--> + <!--<a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>--> + <!--</div>--> + + <!-- table鍖哄煙-begin --> + <div> + <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" + :pagination="ipagination" :loading="loading" + @change="handleTableChange"> + <span slot="rateParameterColor" slot-scope="text, record"> + <div :style="{background:record.rateParameterColor}"> </div> + </span> + <span slot="action" slot-scope="text, record"> + <a href="javascript:;" @click="handleEdit(record)">缂栬緫</a> + </span> + <!--<span slot="action1" slot-scope="text,record">--> + <!--<span><=</span>--> + <!--</span>--> + </a-table> + </div> + <!-- table鍖哄煙-end --> + <mdc-utilization-rate-model ref="formModel" @ok="modalFormOk"></mdc-utilization-rate-model> + </a-card> +</template> + +<script> + import { + JeecgListMixin + } from '@/mixins/JeecgListMixin' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import { + initDictOptions, + filterDictText + } from '@/components/dict/JDictSelectUtil' + import { + requestPut + } from '@/api/manage' + import JInput from '@/components/jeecg/JInput' + import JEllipsis from '@/components/jeecg/JEllipsis' + import JDate from '@/components/jeecg/JDate' + import moment from 'moment' + import { + getAction, + postAction, + deleteAction + } from '@/api/manage' + import MdcUtilizationRateModel from './modules/mdcUtilizationRate/MdcUtilizationRateModel' + + export default { + name: 'MdcUtilizationRateList', + mixins: [JeecgListMixin], + + components: { + JDictSelectTag, + JInput, + JEllipsis, + JDate, + MdcUtilizationRateModel + }, + data() { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + columns: [{ + title: '绫诲埆', + align: 'center', + dataIndex: 'rateParameterCategory' + }, + { + title: '棰滆壊', + align: 'center', + dataIndex: 'rateParameterColor', + scopedSlots: { + customRender: 'rateParameterColor' + } + }, + { + title: '鏈�灏忚寖鍥达紙鍗曚綅锛�%锛�', + align: 'center', + dataIndex: 'minimumRange' + }, + // { + // title:'', + // dataIndex:'action1', + // align:'center', + // scopedSlots: { + // customRender: 'action1' + // } + // }, + { + title: '鏈�澶ц寖鍥达紙鍗曚綅锛�%锛�', + align: 'center', + dataIndex: 'maximumRange' + }, + { + title: '绛夌骇', + align: 'center', + dataIndex: 'rateParameterLevel' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { + customRender: 'action' + } + } + ], + url: { + list: '/mdc/MdcUtilizationRate/queryWrapper' + } + } + }, + created() { + this.loadData() + }, + methods: { + searchReset() { + this.queryParam = {} + this.loadData() + this.onClearSelected() + }, + searchQuery() { + this.loadData() + this.onClearSelected() + }, + modalFormOk(val) { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData() + this.selectedRowKeys = [val.borrowSubId] + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectionRows + }, + handleEdit(record) { + this.$refs.formModel.edit(record) + this.$refs.formModel.title = '缂栬緫' + this.$refs.formModel.disableSubmit = false + } + } + } +</script> +<style> + @import '~@assets/less/common.less'; + @media screen and (min-width: 1920px){ + .mdcutilization_list{ + height: 825px!important; + overflow: scroll; + } + } + @media screen and (min-width: 1680px) and (max-width: 1920px){ + .mdcutilization_list{ + height: 825px!important; + overflow: scroll; + } + } + @media screen and (min-width: 1400px) and (max-width: 1680px){ + .mdcutilization_list{ + height: 655px!important; + overflow: scroll; + } + } + @media screen and (min-width: 1280px) and (max-width: 1400px){ + .mdcutilization_list{ + height: 552px!important; + overflow: scroll; + } + } + @media screen and (max-width: 1280px){ + .mdcutilization_list{ + height: 552px!important; + overflow: scroll; + } + } +</style> diff --git a/src/views/mdc/base/Torqueconfiguration.vue b/src/views/mdc/base/Torqueconfiguration.vue new file mode 100644 index 0000000..be23e7e --- /dev/null +++ b/src/views/mdc/base/Torqueconfiguration.vue @@ -0,0 +1,139 @@ +<template> + <div style="width: 100%; height: 100%;"> + <a-card :bordered="false"> + <a-row type="flex" :gutter="16"> + <a-col :md="5"> + <a-tabs :activeKey="activeKey" @change="tabChange"> + <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render> + <base-tree @getCurrSelected="changeSelectionNode"></base-tree> + </a-tab-pane> + <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇">, + <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree> + </a-tab-pane> + </a-tabs> + </a-col> + <a-col :md="19"> + <torqueconfiguration-list ref="TorqueconfigurationList" :nodePeople='selectPeople' :nodeTree = 'selectEquement' :Type="slectTypeTree"></torqueconfiguration-list> + </a-col> + </a-row> + </a-card> + </div> + +</template> + +<script> + import { putAction, getAction } from '@/api/manage' + import { frozenBatch } from '@/api/api' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import JInput from '@/components/jeecg/JInput' + import BaseTree from '../common/BaseTree' + import TorqueconfigurationList from './modules/TorqueconfigurationList/TorqueconfigurationList' + import JSuperQuery from '@/components/jeecg/JSuperQuery' + import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton' + import DepartTree from './modules/DepartList/DepartListTree/DepartTree' + import {mapActions} from 'vuex' + export default { + name: 'Torqueconfiguration', + components: { + JThirdAppButton, + JInput, + BaseTree, + JSuperQuery, + DepartTree, + TorqueconfigurationList + }, + data() { + return { + activeKey: '1', + description: '璁惧淇℃伅', + selectEquementId: '', + selectEquement: {}, + selectPeople:{}, + slectTypeTree:"", + url: { + equipmentStatistics: '/mdc/equipment/equipmentStatistics' + }, + isDepartType:'', + } + }, + created() { + this.queryTreeData() + }, + methods: { + ...mapActions(['QueryDepartTree']), + queryTreeData() { + this.QueryDepartTree().then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + } else { + // this.$message.warn(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() =>{ + }) + }, + tabChange(val) { + // console.log(val); + this.activeKey = val + this.slectTypeTree = val + }, + // changeSelection(val) { + // this.selectEquementId = val + // this.$refs.efficiencyList.pQuery(val) + // this.$refs.efficiencyList.searchQuery() + // }, + changeSelectionNode(val) { + this.selectEquement = val + this.slectTypeTree = "1" + }, + changeSelectionNodedd(val) { + this.selectPeople = val + this.slectTypeTree = "2" + } + } + + } +</script> +<style scoped> + @import '~@assets/less/common.less'; + + .equipMessage { + width: 100%; + height: 10%; + } + + .equipMessage table { + width: 60%; + height: 100%; + line-height: 50%; + } + + .equipMessage table td { + text-align: center; + } + + .equipMessage table td span { + display: inline-block; + width: 15px; + height: 15px; + } + + .equipMessage table td .equipShutdown { + background-color: #808080; + } + + .equipMessage table td .equipStandby { + background-color: #ffbf37; + } + + .equipMessage table td .equipRun { + background-color: #19FE01; + } + + .equipMessage table td .equipAlarm { + background-color: #FD0008; + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/DeviceParamThresholdManagement/ParamThresholdModal.vue b/src/views/mdc/base/modules/DeviceParamThresholdManagement/ParamThresholdModal.vue new file mode 100644 index 0000000..73e9c7c --- /dev/null +++ b/src/views/mdc/base/modules/DeviceParamThresholdManagement/ParamThresholdModal.vue @@ -0,0 +1,252 @@ +<template> + <a-modal + :title="title" + :maskClosable="true" + :width="modalWidth" + @cancel="visible=false" + :visible="visible"> + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelCol" + :wrapperCol="wrapperCol"> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item prop="controlSystemType" label="椹卞姩绫诲瀷"> + <a-select v-model="model.controlSystemType" @change="handleDriveTypeChange" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷"> + <a-select-option v-for="(item,index) in driveTypeList" :key="index" :value="item"> + {{item}} + </a-select-option> + </a-select> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item prop="chineseName" label="鍙傛暟"> + <a-select v-model="model.chineseName" placeholder="璇烽�夋嫨鍙傛暟"> + <a-select-option v-for="item in paramList" :key="item.value" :value="item.value"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + + <a-col :span="12"> + <a-form-model-item prop="maxThreshold" label="闃堝�间笂闄�"> + <a-input-number v-model="model.maxThreshold" placeholder="璇疯緭鍏ラ槇鍊间笂闄�" style="width: 100%"></a-input-number> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item prop="minThreshold" label="闃堝�间笅闄�"> + <a-input-number v-model="model.minThreshold" placeholder="璇疯緭鍏ラ槇鍊间笅闄�" style="width: 100%"></a-input-number> + </a-form-model-item> + </a-col> + + </a-row> + + </a-form-model> + </a-spin> + + + <template slot="footer"> + <a-popconfirm title="纭畾鏀惧純鎿嶄綔锛�" @confirm="visible=false" okText="纭畾" cancelText="鍙栨秷"> + <a-button style="margin-right: .8rem">鍙栨秷</a-button> + </a-popconfirm> + <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">鎻愪氦</a-button> + </template> + + </a-modal> + +</template> + +<script> + import pick from 'lodash.pick' + import api from '@/api/mdc' + + export default { + name: 'ParamThresholdModal', + components: {}, + props: { + driveTypeList: { + type: Array + } + }, + data() { + return { + modalWidth: 700, + form: this.$form.createForm(this), + validatorRules: { + controlSystemType: [ + { + required: true, message: '璇烽�夋嫨椹卞姩绫诲瀷' + } + ], + chineseName: [ + { + required: true, message: '璇烽�夋嫨鍙傛暟' + } + ], + minThreshold: [ + { + required: true, message: '璇疯緭鍏ラ槇鍊间笂闄�' + }, + { + pattern: /^[0-9]+$/, + message: '璇疯緭鍏ラ樋鎷変集鏁板瓧' + } + ], + maxThreshold: [ + { + required: true, message: '璇疯緭鍏ラ槇鍊间笅闄�' + }, + { + pattern: /^[0-9]+$/, + message: '璇疯緭鍏ラ樋鎷変集鏁板瓧' + } + ] + }, + title: '鎿嶄綔', + visible: false, + model: { + controlSystemType: '', + chineseName: '', + minThreshold: '', + maxThreshold: '' + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 15 } + }, + confirmLoading: false, + url: { + userId: '/sys/user/generateUserId' // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url + }, + paramList: [] + } + }, + created() { + + }, + methods: { + add() { + this.visible = true + this.model = { + controlSystemType: this.driveTypeList[0], + chineseName: '', + minThreshold: '', + maxThreshold: '' + } + console.log('driveType',this.driveTypeList) + this.handleDriveTypeChange(this.driveTypeList[0]) + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'controlSystemType', 'chineseName', 'minThreshold', 'maxThreshold')) + }) + }, + + edit(record) { + this.visible = true + this.model = Object.assign({}, record) + api.getParamListByDriveTypeApi(record.controlSystemType) + .then(res => { + if (res.success) { + this.paramList = res.result + } + }) + this.model.chineseName = `${record.englishName}(${record.chineseName})` + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'controlSystemType', 'chineseName', 'minThreshold', 'maxThreshold')) + }) + }, + + handleSubmit() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + if (this.model.maxThreshold > this.model.minThreshold) { + that.confirmLoading = true + let obj + if (this.title == '鏂板') { + obj = api.addParamThresholdApi(this.model) + } else { + obj = api.editParamThresholdApi(this.model) + } + obj.then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.confirmLoading = false + this.visible = false + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: '闃堝�间笂闄愪笉鑳藉皬浜庣瓑浜庨槇鍊间笅闄�' + }) + } + + } else { + return false + } + }) + }, + + /** + * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳� + * @param input 杈撳叆鐨勫唴瀹� + * @param option 閰嶇疆 + * @returns {boolean} 鍒ゆ柇鏄惁绛涢�� + */ + filterOption(input, option) { + return ( + option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0 + ) + }, + + /** + * 椹卞姩鍙傛暟绫诲瀷閫変腑鍚庢覆鏌撶浉搴旂殑鍙傛暟鍒楄〃 + * @param value 椹卞姩鍙傛暟绫诲瀷閫変腑椤� + */ + handleDriveTypeChange(value) { + api.getParamListByDriveTypeApi(value) + .then(res => { + if (res.success) { + this.paramList = res.result + this.model.chineseName = res.result.length ? res.result[0].value : undefined + if (this.model.chineseName) this.$refs.form.clearValidate('chineseName') + } + }) + }, + + /** + * 缂栬緫鎴栨煡鐪嬭鎯呮暟鎹椂娓呴櫎鎶藉眽琛ㄥ崟楠岃瘉 + */ + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } + } + + } +</script> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeForm.vue b/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeForm.vue new file mode 100644 index 0000000..15be1d3 --- /dev/null +++ b/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeForm.vue @@ -0,0 +1,126 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="璁惧绫诲瀷鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentTypeName"> + <a-input v-model="model.equipmentTypeName" placeholder="璇疯緭鍏ヨ澶囩被鍨嬪悕绉�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="璁惧绫诲瀷鍥剧墖" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentTypePictures"> + <j-image-upload v-model="model.equipmentTypePictures" ></j-image-upload> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="璁惧绫诲瀷鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentTypeStates"> + <j-switch v-model="model.equipmentTypeStates" ></j-switch> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'MdcEquipmentTypeForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + equipmentTypeName: [ + { required: true, message: '璇疯緭鍏ヨ澶囩被鍨嬪悕绉�!'}, + { validator: (rule, value, callback) => validateDuplicateValue('mdc_equipment_type', 'equipment_type_name', value, this.model.id, callback)}, + ], + }, + url: { + add: "/mdc/mdcEquipmentType/addEquipmentType", + edit: "/mdc/mdcEquipmentType/editEquipmentType", + queryById: "/mdc/mdcEquipmentType/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + // that.$message.success(res.message); + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); + that.$emit('ok'); + }else{ + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git "a/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.Style\043Drawer.vue" "b/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.Style\043Drawer.vue" new file mode 100644 index 0000000..0fcd0b0 --- /dev/null +++ "b/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.Style\043Drawer.vue" @@ -0,0 +1,84 @@ +<template> + <a-drawer + :title="title" + :width="width" + placement="right" + :closable="false" + @close="close" + destroyOnClose + :visible="visible"> + <mdc-equipment-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></mdc-equipment-type-form> + <div class="drawer-footer"> + <a-button @click="handleCancel" style="margin-bottom: 0;">鍏抽棴</a-button> + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">鎻愪氦</a-button> + </div> + </a-drawer> +</template> + +<script> + + import MdcEquipmentTypeForm from './MdcEquipmentTypeForm' + + export default { + name: 'MdcEquipmentTypeModal', + components: { + MdcEquipmentTypeForm + }, + data () { + return { + title:"鎿嶄綔", + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }); + }, + close () { + this.$emit('close'); + this.visible = false; + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + handleCancel () { + this.close() + } + } + } +</script> + +<style lang="less" scoped> +/** Button鎸夐挳闂磋窛 */ + .ant-btn { + margin-left: 30px; + margin-bottom: 30px; + float: right; + } + .drawer-footer{ + position: absolute; + bottom: -8px; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: right; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.vue b/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.vue new file mode 100644 index 0000000..588bc6b --- /dev/null +++ b/src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <mdc-equipment-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></mdc-equipment-type-form> + </j-modal> +</template> + +<script> + + import MdcEquipmentTypeForm from './MdcEquipmentTypeForm' + export default { + name: 'MdcEquipmentTypeModal', + components: { + MdcEquipmentTypeForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationForm.vue b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationForm.vue new file mode 100644 index 0000000..eef3d6b --- /dev/null +++ b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationForm.vue @@ -0,0 +1,124 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid"> + <a-input v-model="model.equipmentid" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname"> + <a-input v-model="model.equipmentname" placeholder="璇疯緭鍏ヨ澶囧悕绉�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startdate"> + <j-date placeholder="璇烽�夋嫨鏃堕棿" v-model="model.startdate" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鎵煩鍊�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="torquevalue"> + <a-input v-model="model.torquevalue" placeholder="璇疯緭鍏ユ壄鐭╁��" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes"> + <a-input v-model="model.notes" placeholder="璇疯緭鍏ュ娉�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'TorqueconfigurationForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/torquec/torqueconfiguration/add", + edit: "/torquec/torqueconfiguration/edit", + queryById: "/torquec/torqueconfiguration/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue new file mode 100644 index 0000000..e9f6724 --- /dev/null +++ b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationList.vue @@ -0,0 +1,762 @@ +<template> + <div class="device_list"> + <!-- 鏌ヨ鍖哄煙 --> + <div style=" background-color: #fff;overflow: auto" class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24" style="width: 100%;"> + <a-col :md="7" :sm="7"> + <a-form-item label="鏃堕棿"> + <a-range-picker @change="dateParamChange" v-model="dates" format="YYYY-MM-DD HH:mm:ss"/> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5"> + <a-form-item label="璁惧缂栧彿"> + <a-input placeholder="杈撳叆璁惧缂栧彿鏌ヨ" v-model="queryParams.equipmentId"></a-input> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" v-model="queryParams.equipmentName"></a-input> + </a-form-item> + </a-col> + <a-col :md="2" :sm="2" :xs="2"> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </a-col> + <!--<a-col :md="2" :sm="3" :xs="3">--> + <!--<a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>--> + <!--</a-col>--> + <!--<a-col :md="2" :sm="2" :xs="2">--> + <!--<a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>--> + <!--</a-col>--> + <!--<a-col :lg="2" :md="3" :sm="3" :xs="3">--> + <!--<a-button type="primary" @click="exportExcel" icon="download">瀵煎嚭</a-button>--> + <!--</a-col>--> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" style="display: inline;"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板 + </a-button> + <a-button type="primary" icon="download" @click="handleExportXls('鎵煩閰嶇疆')">瀵煎嚭</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-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 id="DeviceList" style="flex: 1;overflow: hidden"> + <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns" + :dataSource="dataSource" :pagination="ipagination" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange" :scroll="{x:'max-content',y:scrollY}"> + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a @click="handleDelete(record.id)">鍒犻櫎</a> + </span> + <!--瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず--> + <span slot="num" slot-scope="text" style="font-weight: bold"> + <j-ellipsis :value="text" :length="8"/> + </span> + <span slot="name" slot-scope="text" style="font-weight: bold"> + <j-ellipsis :value="text" :length="8"/> + </span> + <span slot="model" slot-scope="text" style="font-weight: bold"> + <j-ellipsis :value="text" :length="8"/> + </span> + </a-table> + </div> + <!-- table鍖哄煙-end --> + <!--<device-repair-model></device-repair-model>--> + <torqueconfiguration-modal ref="modalForm" @ok="modalFormOk"></torqueconfiguration-modal> + <torqueconfiguration-modaledit ref="modalFormedit" @ok="modalFormOk">></torqueconfiguration-modaledit> + <!--<device-repair-model-add ref="modalFormadd" @ok="modalFormOk"></device-repair-model-add>--> + <!--<device-repair-model-edit ref="modalFormedit" @ok="modalFormOk"></device-repair-model-edit>--> + <!--<repair-model ref="repairModelFrom" @ok="modalFormOk"></repair-model>--> + + </div> +</template> + +<script> + import moment from 'moment' + import $ from 'jquery' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JDate from '../../../../../components/jeecg/JDate' + import { + requestPut, + deleteAction, + getAction, + downFile, + getFileAccessHttpUrl + } from '@/api/manage' + import TorqueconfigurationModal from './TorqueconfigurationModal' + import TorqueconfigurationModaledit from './TorqueconfigurationModalEdit' + // import DeviceRepairModelAdd from './DeviceRepairModelAdd' + // import DeviceRepairModelEdit from './DeviceRepairModelEdit' + import '@/components/table2excel/table2excel' + import { + JeecgListMixin + } from '@/mixins/JeecgListMixin' + import JInput from '@/components/jeecg/JInput' + import JEllipsis from '@/components/jeecg/JEllipsis' + import Tooltip from 'ant-design-vue/es/tooltip' + import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' + export default { + name: 'TorqueconfigurationList', + mixins: [JeecgListMixin], + components: { + Tooltip, + TorqueconfigurationModal, + TorqueconfigurationModaledit, + // DeviceRepairModelAdd, + // DeviceRepairModelEdit, + JDictSelectTag, + JInput, + JDate, + JEllipsis + }, + props: { nodeTree: '', Type:'',nodePeople: '' }, + data() { + return { + typeTree:"", + typeParent:1, + typeEquipment:1, + dates: [], + xianshi:"", + readOnly:true, + queryParam: {}, + queryParams:{}, + queryParamEquip:{}, + queryParamPeople:{}, + dataStartsoucre:[], + scrollY:465, + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + columns: [ + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width:200 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + width:250 + // defaultSortOrder:'descend', + // sorter: (a, b) => {return a.equipmentName>b.equipmentName?1:-1} + }, + { + title: '鏃堕棿', + align: 'center', + dataIndex: 'torqueDate', + width:250 + // scopedSlots:{customRender:'startTime'}, + // customRender:(text,row,index) => { + // return moment(text).format("YYYY-MM-DD HH:mm:ss") + // } + }, + { + title: '鎵煩鍊�', + align: 'center', + dataIndex: 'torqueValue', + width:150 + }, + { + title: '杩涚粰鍙傛暟', + align: 'center', + dataIndex: 'feedParameter', + width:150 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'notes', + width:250 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: {customRender: 'action'}, + align: "center", + width: 150, + fixed:'right' + } + ], + url: { + list: '/mdc/MdcTorqueConfig/pageList', + delete: '/mdc/MdcTorqueConfig/deleteMdcTorqueConfig', + deleteBatch: '/mdc/MdcTorqueConfig/deleteBatchMdcTorqueConfig', + getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', + exportXlsUrl: "/mdc/MdcTorqueConfig/exportXls", + importExcelUrl: "/mdc/MdcTorqueConfig/importExcel", + } + } + }, + watch:{ + Type(valmath){ + this.dataList = []; + this.queryParams.typeTree = valmath + console.log(valmath,'瑙﹀彂Type鐨剋atch鏂规硶') + // console.log(this.queryParams.typeTree) + }, + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParamEquip.parentId = "" + this.queryParams.equipmentId = val.equipmentId + this.queryParamEquip.equipmentId = val.equipmentId + } else { + this.queryParamEquip.parentId = val.key + this.queryParams.equipmentId = '' + } + this.searchQuery() + } + }, + nodePeople(val){ + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParamEquip.parentId = "" + this.queryParams.equipmentId = val.equipmentId + this.queryParamEquip.equipmentId = val.equipmentId + } else { + this.queryParamPeople.parentId = val.key + this.queryParams.equipmentId = '' + } + this.searchQuery() + } + } + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + dateParamChange(v1, v2) { + // console.log(v1,v2) + this.queryParam.startTime = v2[0] + this.queryParam.endTime = v2[1] + // console.log(v2[0],v2[1]) + }, + onChange(value, dateString) { + // console.log('Selected Time: ', value); + // console.log('Formatted Selected Time: ', dateString); + }, + onOk(value) { + console.log('onOk: ', value); + }, + /** + * 鏌ヨ鍖哄煙閲嶇疆鎸夐挳 + */ + searchReset() { + if(this.queryParams.typeTree == "1"){ + console.log('绗竴涓殑typeTree',this.queryParams.typeTree) + this.typeTree = this.queryParams.typeTree + this.typeParent = this.queryParams.parentId + this.typeEquipment = this.queryParams.equipmentId + this.queryParams = {} + this.queryParam = {} + this.dates = [] + this.queryParams.typeTree = this.typeTree + this.queryParams.parentId = this.typeParent + console.log('杩涘叆绗竴涓�') + if(this.queryParams.parentId != ""){ + this.queryParams.equipmentId = "" + }else{ + if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ + this.queryParams.equipmentId = this.typeEquipment + }else{ + this.queryParams.equipmentId = this.queryParamEquip.equipmentId + } + } + this.ipagination.current = 1 + this.ResetloadData(); + }else{ + console.log('杩涘叆绗簩涓�') + console.log('绗簩涓殑typeTree',this.queryParams.typeTree) + this.typeTree = this.queryParams.typeTree + this.typeParent = this.queryParams.parentId + // this.typeEquipment = this.queryParams.equipmentId + this.queryParams = {} + this.queryParam = {} + this.dates = [] + this.queryParams.typeTree = this.typeTree + this.queryParams.parentId = this.typeParent + // this.queryParams.equipmentId = this.typeEquipment + this.ipagination.current = 1 + this.ResetloadData(); + } + + }, + ResetloadData() { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + var params = this.getQueryParams();//鏌ヨ鏉′欢 + if(!params){ + return false; + } + params.typeTree = this.queryParams.typeTree + params.parentId = this.queryParams.parentId + params.equipmentId = this.queryParams.equipmentId + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records||res.result; + // this.initDeviceType(this.dataSource) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + // this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + handleEdit: function (record) { + this.$refs.modalFormedit.edit(record); + this.$refs.modalFormedit.title = "缂栬緫"; + this.$refs.modalFormedit.disableSubmit = false; + }, + handleTableChange(pagination, filters, sorter) { + this.dataSource = [] + //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 + //TODO 绛涢�� + // console.log(pagination) + if (Object.keys(sorter).length > 0) { + this.isorter.column = sorter.field; + this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" + } + this.ipagination = pagination; + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); + param.pageNo = this.ipagination.current; + param.pageSize = this.ipagination.pageSize; + param.field = this.getQueryField(); + param.parentId = this.queryParams.parentId; + param.equipmentId = this.queryParams.equipmentId; + param.startTime = this.queryParam.startTime; + param.endTime = this.queryParam.endTime; + getAction(this.url.list,param).then((res) => { + if(res.success){ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + searchQueryEdit(){ + if(this.queryParams.typeTree == "1"){ + this.queryParams.parentId = this.queryParamEquip.parentId + }else{ + this.queryParams.parentId = this.queryParamPeople.parentId + this.queryParams.equipmentIds = "" + } + this.dataSource = []; + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); + param.pageNo = this.ipagination.current; + param.pageSize = this.ipagination.pageSize; + param.field = this.getQueryField(); + param.parentId = this.queryParams.parentId; + param.equipmentId = this.queryParams.equipmentId; + param.startTime = this.queryParam.startTime; + param.endTime = this.queryParam.endTime; + getAction(this.url.list,param).then((res) => { + if(res.success){ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + searchQuery(){ + if(this.queryParams.typeTree == "1"){ + this.queryParams.parentId = this.queryParamEquip.parentId + // this.queryParams.equipmentId = this.queryParamEquip.equipmentId + }else{ + this.queryParams.parentId = this.queryParamPeople.parentId + // this.queryParams.equipmentId = "" + } + this.dataSource = []; + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); + param.pageNo = 1; + param.pageSize = this.ipagination.pageSize; + param.field = this.getQueryField(); + param.parentId = this.queryParams.parentId; + param.equipmentId = this.queryParams.equipmentId; + param.startTime = this.queryParam.startTime; + param.endTime = this.queryParam.endTime; + console.log('param',param); + getAction(this.url.list,param).then((res) => { + if(res.success){ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + + } + }).finally(() => { + this.loading = false + }) + }, + handleExportXls(fileName){ + if(!fileName || typeof fileName != "string"){ + fileName = "瀵煎嚭鏂囦欢" + } + let param = this.getQueryParams(); + if(this.selectedRowKeys && this.selectedRowKeys.length>0){ + param['selections'] = this.selectedRowKeys.join(",") + } + param.pageSize = this.ipagination.pageSize; + param.field = this.getQueryField(); + param.parentId = this.queryParams.parentId; + param.equipmentId = this.queryParams.equipmentId; + param.startTime = this.queryParam.startTime; + param.endTime = this.queryParam.endTime; + console.log("瀵煎嚭鍙傛暟",param) + downFile(this.url.exportXlsUrl,param).then((data)=>{ + if (!data) { + this.$message.warning("鏂囦欢涓嬭浇澶辫触") + return + } + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls') + }else{ + let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'})) + let link = document.createElement('a') + link.style.display = 'none' + link.href = url + link.setAttribute('download', fileName+'.xls') + document.body.appendChild(link) + link.click() + document.body.removeChild(link); //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url); //閲婃斁鎺塨lob瀵硅薄 + } + }) + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + if(!params){ + return false; + } + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records||res.result; + // this.initDeviceType(this.dataSource) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + // this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + modalFormOk(val) { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.searchQueryEdit(); + // this.$emit('openBasetree','') + this.selectedRowKeys = [] + }, + 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.$notification.success({ + message:'娑堟伅', + description:res.message + }); + that.searchQuery(); + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }); + }, + batchDel: function () { + if(!this.url.deleteBatch){ + this.$message.error("璇疯缃畊rl.deleteBatch灞炴��!") + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message:'娑堟伅', + description:"璇烽�夋嫨涓�鏉¤褰�" + }); + 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.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + that.loadData(); + that.onClearSelected(); + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + that.loading = false; + }); + } + }); + } + }, + handleAdd() { + console.log(this.$refs.modalForm.edit) + this.$refs.modalForm.add(this.node) + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + handleAddXIU() { + this.$refs.modalFormadd.add() + this.$refs.modalFormadd.title = '鏂板' + this.$refs.modalFormadd.disableSubmit = false + }, + pQuery(parentId) { + this.queryParam.parentId = parentId[0] + if(this.selectedRowKeys.length >= 1) { + this.selectedRowKeys.length = 0 + } + this.loadData() + }, + onSelectChange(selectedRowKeys) { + this.selectedRowKeys = selectedRowKeys + }, + initEquipment(id) { + let _this = this + getAction(this.url.getEquipmentByPid, { pid: id }).then((res) => { + if (res.success) { + if (res.result) { + _this.$set(this.queryParams, 'equipmentName', res.result.equipmentName) + _this.$set(this.queryParams, 'equipmentId', res.result.equipmentId) + _this.equipment = res.result + _this.searchQuery() + } else { + // _this.$message.warning('璇烽厤缃澶囷紒') + _this.$notification.warning({ + message:'娑堟伅', + description:'璇疯仈绯荤鐞嗗憳锛屽紑鏀捐澶囨潈闄愶紒' + }); + } + } + }) + }, + exportExcel() { + $("#DeviceList").table2excel({ + exclude: ".noExl", + name: "Excel Document Name", + filename: "鎵煩閰嶇疆", + exclude_img: true, + fileext: ".xls", + exclude_links: true, + exclude_inputs: true + }); + }, + + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + handleWindowResize(){ + const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0,-2) + const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0,-2) + this.scrollY = boxHeight - tableHeadHeight - 50 + } + // /** + // * 杞﹂棿閫変腑椤瑰彇娑堝悗瑙﹀彂姝や簨浠讹紝鐢盉aseTree缁勪欢鐢变簨浠舵�荤嚎瑙﹀彂 + // * @param value 鎻愮ず淇℃伅 + // */ + // treeClearSelected(value){ + // this.queryParams.equipmentId='' + // this.queryParams.parentId='' + // this.ResetloadData() + // } + }, + created() { + this.queryParam.typeTree = "1" + // this.$bus.$on('treeClearSelected',this.treeClearSelected) + }, + mounted(){ + window.addEventListener('resize',this.handleWindowResize) + this.handleWindowResize() + }, + beforeDestroy(){ + window.removeEventListener('resize',this.handleWindowResize) + } + } +</script> + +<style lang="less" scoped> + @import '~@assets/less/common.less'; + + .device_list{ + overflow: hidden; + display: flex; + flex-direction: column; + } + + @media screen and (min-width: 1920px){ + .device_list{ + height: 811px!important; + } + } + @media screen and (min-width: 1680px) and (max-width: 1920px){ + .device_list{ + height: 811px!important; + } + } + @media screen and (min-width: 1400px) and (max-width: 1680px){ + .device_list{ + height: 663px!important; + } + } + @media screen and (min-width: 1280px) and (max-width: 1400px){ + .device_list{ + height: 564px!important; + } + } + @media screen and (max-width: 1280px){ + .device_list{ + height: 564px!important; + } + } +</style> diff --git a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModal.vue b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModal.vue new file mode 100644 index 0000000..ee2f506 --- /dev/null +++ b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModal.vue @@ -0,0 +1,385 @@ +<template> + <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="璁惧缁�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input-search :readOnly="true" v-decorator="['equipmentIds', validatorRules.equipmentIds]" + @search="deviceSearch" enter-button placeholder="璇烽�夋嫨璁惧"/> + </a-form-item> + </a-col> + <a-col :span="12"> + <a-form-item label="鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨鏃堕棿" + v-decorator="['torqueDate', validatorRules.torqueDate]" style="width: 100%"></j-date> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="鎵煩鍊�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input-number :min="0" :disabled="disableSubmit" placeholder="璇疯緭鍏ユ壄鐭╁��" + v-decorator="['torqueValue', validatorRules.torqueValue]"/> + </a-form-item> + </a-col> + <a-col :span="12"> + <a-form-item label="杩涚粰鍙傛暟" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input placeholder="璇疯緭鍏ヨ繘缁欏弬鏁�" v-decorator="['feedParameter', validatorRules.feedParameter]"></a-input> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item label="澶囨敞" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <a-textarea :maxLength="20" v-decorator="['notes', validatorRules.notes]" + placeholder="璇疯緭鍏ュ娉�"></a-textarea> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'閫夋嫨璁惧'"/> + </a-modal> +</template> + +<script> + import moment from 'moment' + import pick from 'lodash.pick' + import TorqueconfigurationModalList from './TorqueconfigurationModalList' + // import JDate from './JDate' + import { + getAction, + postAction, + requestPut + } from '@/api/manage' + import { + duplicateCheck + } from '@/api/api' + import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer' + + export default { + name: 'TorqueconfigurationModal', + components: { SelectDeviceDrawer }, + props: {}, + data() { + return { + mesag: 21, + readOnly: true, + title: '', + visible: false, + show: false, + model: {}, + checked: false, + startData: '', + endData: '', + labelCol: { + xs: { + span: 24 + }, + sm: { + span: 6 + } + }, + wrapperCol: { + xs: { + span: 24 + }, + sm: { + span: 18 + } + }, + labelColLong: { + xs: { + span: 24 + }, + sm: { + span: 3 + } + }, + wrapperColLong: { + xs: { + span: 24 + }, + sm: { + span: 21 + } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + equipmentIds: { + rules: [ + { + required: true, + message: '璇烽�夋嫨璁惧' + } + ] + }, + torqueDate: { + rules: [ + { + required: true, + message: '璇烽�夋嫨鏃堕棿' + } + ] + }, + torqueValue: { + rules: [ + { + required: true, + message: '璇疯緭鍏ユ壄鐭╁��' + } + ] + }, + feedParameter:{ + rules:[ + { + required:true, + message:'璇疯緭鍏ヨ繘缁欏弬鏁�' + } + ] + } + }, + + url: { + add: '/mdc/MdcTorqueConfig/addMdcTorqueConfig', + edit: '/mdc/MdcTorqueConfig/editMdcTorqueConfig' + }, + + disableSubmit: true, + partCategoryCascade: [], + cascadeDefaultValue: [] + } + }, + created() { + }, + + methods: { + // disabledDate(current){ + // //Can not slect days before today and today + // // return current && current < moment().endOf("day"); + // return current < moment().subtract(+1, 'day')//浠婂ぉ涔嬪墠鐨勫勾鏈堟棩涓嶅彲閫夛紝涓嶅寘鎷粖澶� + // }, + moment, + // onChange(dates) { + // // console.log(111) + // // console.log(dates,dateStrings) + // // console.log('From: ', dates[0], ', to: ', dates[1]); + // // console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]); + // // this.startTime = dateStrings[0]; + // // this.endData = dateStrings[1]; + // // console.log(this.startData,this.endData); + // }, + onChangeEnd(dates, dateStrings) { + this.endTime = dateStrings[0] + }, + getDeviceRows(val) { + var equipmentIds + for (var i = 0; i < val.length; i++) { + if (i == 0) { + equipmentIds = val[i].equipmentId + } else { + equipmentIds = equipmentIds + ',' + val[i].equipmentId + } + } + // console.log("========",equipmentIds); + this.form.setFieldsValue({ + equipmentIds: equipmentIds + }) + // this.form.setFieldsValue({ + // equipmentId: val.equipmentId, + // equipmentName: val.equipmentName, + // equipmentModel: val.equipmentModel, + // equipmentIp: val.equipmentIp, + // dataPort: val.dataPort, + // driveType: val.driveType + // }) + }, + deviceSearch() { + this.$refs.selectDeviceDrawer.visible = true + this.$refs.selectDeviceDrawer.selectedRowKeys = [] + this.$refs.selectDeviceDrawer.selectedRows = [] + this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : [] + }, + //绾ц仈妗唎nChange浜嬩欢 + // onChange(value) { + // + // }, + getParentIdsById(id) { + let that = this + getAction(this.url.getParentIdsById, { + id: id + }).then((res) => { + if (res.success) { + that.form.setFieldsValue({ + partCategoryId: res.result + }) + } + }) + }, + add(node) { + let _this = this + this.visible = true + this.form.resetFields() + this.model = {} + this.$nextTick(() => { + // _this.form.setFieldsValue({ 'tierType': node.entity.tierType + 1, 'parentName': node.title }) + // _this.model.parentId = node.key + }) + }, + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'equipmentIds', 'equipmentName', 'mdcRepairType', 'startTime', 'endTime' + )) + }) + }, + close() { + this.$emit('close') + this.visible = false + this.show = false + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + // let start = moment(formData.startTime).format('YYYY-MM-DD HH:mm:ss'); + // let end = moment(formData.endTime).format('YYYY-MM-DD HH:mm:ss'); + // let startOne = start.replace(/:/g,''); + // let endOne = end.replace(/:/g,''); + // var data = new Date(); + // let stertDate = moment(data).format("YYYY-MM-DD HH:mm:ss"); + // let dataStart = stertDate.replace(/:/g,''); + // if(startOne < dataStart){ + // that.$message.warning("寮�濮嬫椂闂翠笉鑳藉皬浜庡綋鍓嶆椂闂�") + // that.confirmLoading = false + // }else{ + // if(startOne>=endOne){ + // that.$message.warning("缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�"); + // // console.log(this.model) + // // this.endTime = '' + // that.confirmLoading = false + // }else{ + let obj + if (!this.model.id) { + obj = postAction(this.url.add, formData) + } else { + obj = requestPut(this.url.edit, formData, { + id: this.model.id + }) + } + obj.then((res) => { + if (res.success) { + // that.$message.success("娣诲姞鎴愬姛") + that.$notification.success({ + message: '娑堟伅', + description: '娣诲姞鎴愬姛' + }) + // that.$message.success(res.message) + that.$emit('ok', res.result) + } else { + // that.$message.warning(res.message) + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } + // } + + // } + }) + }, + handleCancel() { + this.close() + }, + // loadCascade() { + // getAction(this.url.loadCascadeData).then((res) => { + // if (res.success) { + // this.partCategoryCascade = res.result + // } + // }) + // }, + onCascadeChange(value, selectedOptions) { + this.cascadeDefaultValue = [...value] + }, + filter(inputValue, path) { + return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) + }, + //楠岃瘉 缂栫爜 + validateNum(rule, value, callback) { + var params = { + tableName: 'lxmes_base_part', + fieldName: 'num', + fieldVal: value, + dataId: this.model.id, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true' + } + duplicateCheck(params).then((res) => { + if (res.success) { + callback() + } else { + callback('瀛樿揣缂栫爜宸插瓨鍦�!') + } + }) + }, + checkboxChange(e) { + this.checked = e.target.checked + }, + + /** + * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂 + * @param data 宸查�夋嫨鐨勮澶� + */ + selectOK(data) { + // let params = {} + // params.equipmentIdList = [] + // for (var a = 0; a < data.length; a++) { + // params.equipmentIdList.push(data[a]) + // } + console.log('data=', data) + this.form.setFieldsValue({ + equipmentIds: data.join(',') + }) + } + + } + } +</script> + +<style scoped lang="less"> + .ant-btn { + padding: 0 10px; + margin-left: 3px; + } + + .ant-form-item-control { + line-height: 0px; + } + + /** 涓昏〃鍗曡闂磋窛 */ + .ant-form .ant-form-item { + margin-bottom: 10px; + } + + /** Tab椤甸潰琛岄棿璺� */ + .ant-tabs-content .ant-form-item { + margin-bottom: 0px; + } + + /deep/ .ant-input-number { + width: 100% !important; + } +</style> diff --git a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue new file mode 100644 index 0000000..ba239b5 --- /dev/null +++ b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue @@ -0,0 +1,372 @@ +<template> + <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�" + v-decorator="['equipmentId',validatorRules.equipmentId]"/> + </a-form-item> + </a-col> + + <a-col :span="12"> + <a-form-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�" + v-decorator="['equipmentName',validatorRules.equipmentName]"/> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨鏃堕棿" + class="query-group-cust" v-decorator="['torqueDate', validatorRules.torqueDate]" style="width: 100%"></j-date> + </a-form-item> + </a-col> + + <a-col :span="12"> + <a-form-item label="鎵煩鍊�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input-number :min="0" :disabled="disableSubmit" placeholder="璇疯緭鍏ユ壄鐭╁��" + v-decorator="['torqueValue', validatorRules.torqueValue]"/> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="杩涚粰鍙傛暟" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input placeholder="璇疯緭鍏ヨ繘缁欏弬鏁�" v-decorator="['feedParameter', validatorRules.feedParameter]"></a-input> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-form-item label="澶囨敞" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <a-textarea :maxLength="20" :disabled="disableSubmit" v-decorator="['notes', validatorRules.notes]" placeholder="璇疯緭鍏ュ娉�" ></a-textarea> + </a-form-item> + </a-row> + </a-form> + </a-spin> + <!--<device-repair-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-repair-list-model>--> + <!--<device-repair-edit-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-repair-edit-list-model>--> + </a-modal> +</template> + +<script> + import moment from 'moment' + import pick from 'lodash.pick' + // import DeviceRepairListModel from './DeviceRepairListModel' + // import DeviceRepairEditListModel from './DeviceRepairEditListModel' + // import JDate from './JDate' + import { + getAction, + postAction, + requestPut + } from '@/api/manage' + import { + duplicateCheck + } from '@/api/api' + + export default { + name: 'TorqueconfigurationModalEdit', + // components: {DeviceRepairListModel,JDate,DeviceRepairEditListModel}, + props: {}, + data() { + return { + readOnly:true, + title: '', + visible: false, + show: false, + model: {}, + checked: false, + startData:"", + endData:"", + labelCol: { + xs: { + span: 24 + }, + sm: { + span: 6 + } + }, + wrapperCol: { + xs: { + span: 24 + }, + sm: { + span: 18 + } + }, + labelColLong: { + xs: { + span: 24 + }, + sm: { + span: 3 + } + }, + wrapperColLong: { + xs: { + span: 24 + }, + sm: { + span: 21 + } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + equipmentId:{ + rules:[ + { + required:true, + message: "" + }, + ], + }, + equipmentName:{ + rules:[ + { + required:true, + message: "" + }, + ], + }, + torqueDate:{ + rules:[ + { + required:true, + message: "璇烽�夋嫨鏃堕棿" + }, + ], + }, + torqueValue:{ + rules:[ + { + required:true, + message: "璇疯緭鍏ユ壄鐭╁��" + }, + ], + }, + feedParameter:{ + rules:[ + { + required:true, + message:'璇疯緭鍏ヨ繘缁欏弬鏁�' + } + ] + } + // mdcRepairType:{ + // rules:[ + // { + // required:true, + // message: "" + // }, + // ], + // initialValue: '浼戠彮' + // } + }, + + url: { + add: '/mdc/mdcEquipmentRepair/add', + edit: '/mdc/MdcTorqueConfig/editMdcTorqueConfig' + }, + + disableSubmit: true, + partCategoryCascade: [], + cascadeDefaultValue: [], + editStart:'' + } + }, + created() { + }, + + methods: { + disabledDate(current){ + //Can not slect days before today and today + // return current && current < moment().endOf("day"); + return current < moment().subtract(+1, 'day')//浠婂ぉ涔嬪墠鐨勫勾鏈堟棩涓嶅彲閫夛紝涓嶅寘鎷粖澶� + }, + moment, + // onChange(dates) { + // console.log(111) + // console.log(dates,dateStrings) + // // console.log('From: ', dates[0], ', to: ', dates[1]); + // // console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]); + // // this.startTime = dateStrings[0]; + // // this.endData = dateStrings[1]; + // // console.log(this.startData,this.endData); + // }, + onChangeEnd(dates, dateStrings){ + this.endTime = dateStrings[0]; + }, + getDeviceRows(val) { + this.form.setFieldsValue({ + equipmentId: val.equipmentId, + equipmentName: val.equipmentName, + // // equipmentModel: val.equipmentModel, + // // equipmentIp: val.equipmentIp, + // // dataPort: val.dataPort, + // // driveType: val.driveType + }) + // var equipmentIds; + // for(var i = 0;i<val.length;i++){ + // if (i == 0) { + // equipmentIds = val[i].equipmentId; + // } else { + // equipmentIds = equipmentIds + "," + val[i].equipmentId; + // } + // } + // console.log("========",equipmentIds); + // this.form.setFieldsValue({ + // equipmentId: equipmentIds, + // }) + }, + deviceSearch() { + this.$refs.deviceRepairListModel.openPage() + this.$refs.deviceRepairListModel.title = '閫夋嫨璁惧' + this.$refs.deviceRepairListModel.disableSubmit = false + }, + //绾ц仈妗唎nChange浜嬩欢 + // onChange(value) { + // + // }, + getParentIdsById(id) { + let that = this + getAction(this.url.getParentIdsById, { + id: id + }).then((res) => { + if (res.success) { + that.form.setFieldsValue({ + partCategoryId: res.result + }) + } + }) + }, + add(node) { + let _this = this + this.visible = true + this.form.resetFields() + this.model = {} + this.$nextTick(() => { + // _this.form.setFieldsValue({ 'tierType': node.entity.tierType + 1, 'parentName': node.title }) + // _this.model.parentId = node.key + }) + }, + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + // this.editStart = (this.model.startTime).replace(/:/g,''); + this.visible = true + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model,'equipmentId', 'equipmentName','torqueDate', 'torqueValue','feedParameter','notes' + )) + }) + }, + close() { + this.$emit('close') + this.visible = false + this.show = false + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + let obj + if (!this.model.id) { + obj = postAction(this.url.add, formData) + } else { + obj = requestPut(this.url.edit, formData, { + id: this.model.id + }) + } + obj.then((res) => { + if (res.success) { + // that.$message.success("淇敼鎴愬姛") + that.$notification.success({ + message:'娑堟伅', + description:"淇敼鎴愬姛" + }); + // that.$message.success(res.message) + that.$emit('ok', res.result) + } else { + // that.$message.warning(res.message) + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + // loadCascade() { + // getAction(this.url.loadCascadeData).then((res) => { + // if (res.success) { + // this.partCategoryCascade = res.result + // } + // }) + // }, + onCascadeChange(value, selectedOptions) { + this.cascadeDefaultValue = [...value] + }, + filter(inputValue, path) { + return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) + }, + //楠岃瘉 缂栫爜 + validateNum(rule, value, callback) { + var params = { + tableName: 'lxmes_base_part', + fieldName: 'num', + fieldVal: value, + dataId: this.model.id, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true' + } + duplicateCheck(params).then((res) => { + if (res.success) { + callback() + } else { + callback('瀛樿揣缂栫爜宸插瓨鍦�!') + } + }) + }, + checkboxChange(e) { + this.checked = e.target.checked + } + } + } +</script> + +<style scoped lang="less"> + .ant-btn { + padding: 0 10px; + margin-left: 3px; + } + + .ant-form-item-control { + line-height: 0px; + } + + /** 涓昏〃鍗曡闂磋窛 */ + .ant-form .ant-form-item { + margin-bottom: 10px; + } + + /** Tab椤甸潰琛岄棿璺� */ + .ant-tabs-content .ant-form-item { + margin-bottom: 0px; + } + /deep/ .ant-input-number{ + width: 100%!important; + } +</style> diff --git a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalList.vue b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalList.vue new file mode 100644 index 0000000..3191785 --- /dev/null +++ b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalList.vue @@ -0,0 +1,340 @@ + +<template> + <a-modal :title="title" width="70%" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel" + cancelText="鍏抽棴"> + <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="6" v-if="isDepartType == 0"> + <a-form-item label="閮ㄩ棬" v-if="isDepartType == 0"> + <!--<a-select v-model="queryParam.sectionPid" placeholder="璇烽�夋嫨閮ㄩ棬" :options="sectionPData" @change="initGroupOptions" />--> + <a-tree-select + v-model="value" + style="width: 100%" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + :tree-data="treeData" + placeholder="璇烽�夋嫨閮ㄩ棬" + tree-default-expand-all + > + <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">--> + <!--Child Node1 {{ value }}--> + <!--</span>--> + </a-tree-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="杞﹂棿" > + <!--<a-select v-model="queryParam.sectionId" placeholder="璇烽�夋嫨鍥㈤槦" :options="sectionData"/>--> + <a-tree-select + v-model="valueProduct" + style="width: 100%" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + :tree-data="sectionData" + placeholder="璇烽�夋嫨杞﹂棿" + tree-default-expand-all + > + <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">--> + <!--Child Node1 {{ value }}--> + <!--</span>--> + </a-tree-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="缁熶竴缂栫爜"> + <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜妫�绱�" v-model="queryParam.equipmentId"></a-input> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉版绱�" v-model="queryParam.equipmentName"></a-input> + </a-form-item> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </div> + <!-- table鍖哄煙-begin --> + <div> + <a-table ref="table" size="middle" bordered rowKey="id" :scroll="{聽 y: 400聽}" :columns="columns" + :dataSource="dataSource" :pagination="ipagination" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + </a-table> + </div> + <!-- table鍖哄煙-end --> + </a-card> + </a-modal> +</template> + +<script> + import {mapActions} from 'vuex' + import { + ajaxGetSelectItems + } from '@/api/api' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import { + deleteAction, + requestPut, + getAction, + postAction + } from '@/api/manage' + import { + JeecgListMixin + } from '@/mixins/JeecgListMixin' + import JInput from '@/components/jeecg/JInput' + import JEllipsis from '@/components/jeecg/JEllipsis' + import Tooltip from 'ant-design-vue/es/tooltip' + import JDate from '@/components/jeecg/JDate' + import moment from 'moment' + + export default { + name: 'DeviceCalendarListModel', + mixins: [JeecgListMixin], + components: { + JDictSelectTag, + JEllipsis, + JInput, + Tooltip, + JDate + }, + props: { + status: { + type: Number, + default: 1 + } + }, + data() { + return { + isDepartType:'', + /*readOnly:true,*/ + title:'', + visible: false, + SelectedList:[], + treeData:[], + /*disableMixinCreated: true, + queryParam: {},*/ + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + },{ + + title: '缁熶竴缂栫爜', + align: 'center', + dataIndex: 'equipmentId', + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + }, + { + title: '椹卞姩绫诲瀷', + align: 'center', + dataIndex: 'driveType' + }, + { + title: '鏁版帶绯荤粺', + align: 'center', + dataIndex: 'controlSystem' + }, + ], + sectionPData: [], + sectionData: [], + url: { + list: '/mdc/mdcEquipment/findEquipmentList', + loadOptions: '/sys/sysDepart/loadDepartTreeOptions', + loadProductionOptions:'/mdc/mdcProduction/loadProductionTreeOptions' + }, + value:undefined, + valueProduct:undefined + } + }, + created() { + this.queryTreeData() + }, + watch: { + value(value) { + // console.log(value); + this.queryParam.departId = value + }, + valueProduct(value){ + this.queryParam.productionId = value + } + }, + methods: { + ...mapActions(['QueryDepartTree']), + queryTreeData() { + this.QueryDepartTree().then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + } else { + // this.$message.warn(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() =>{ + }) + }, + onSelectChange(selectedRowKeys, selectionRows) { + // this.SelectedList.push(selectedRowKeys); + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows + // this.SelectedList =[...this.SelectedList,...selectionRows]; + // console.log(this.SelectedList); + }, + handleTableChange(pagination, filters, sorter) { + // this.onClearSelected() + //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 + //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(); + }, + openPage() { + this.visible = true + this.onClearSelected() + this.dataSource = []; + this.queryParam = { + status: this.status + }; + + this.loadData(); + this.initOptions(); + this.initGroupOptions() + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + + if(!params){ + return false; + } + + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + // console.log(res) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + modalFormOk(val) { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData(); + + this.selectedRowKeys = [val.id]; + }, + searchQuery() { + this.loadData(); + this.onClearSelected() + }, + searchReset() { + this.queryParam = { + status: 1 + }; + this.loadData(); + this.onClearSelected() + }, + close() { + this.$emit('close') + this.visible = false + }, + handleCancel() { + this.close() + }, + handleOk() { + // this.selectionRows = this.SelectedList; + // console.log(this.selectionRows); + this.$emit('sendSelectionRows', this.selectionRows) + this.close() + }, + initOptions() { + getAction(this.url.loadOptions).then(res => { + if (res.success) { + this.treeData = res.result + } else { + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }) + }, + + + initGroupOptions() { + getAction(this.url.loadProductionOptions).then(res => { + if (res.success) { + this.sectionData = res.result + } else { + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }) + } + }, + } +</script> +<style> + @import '~@assets/less/common.less'; + + .frozenRowClass { + color: #c9c9c9; + } + + .success { + color: green; + } + + .error { + color: red; + } +</style> diff --git a/src/views/mdc/base/modules/deviceRepair/DeviceRepairEditListModel.vue b/src/views/mdc/base/modules/deviceRepair/DeviceRepairEditListModel.vue new file mode 100644 index 0000000..d765332 --- /dev/null +++ b/src/views/mdc/base/modules/deviceRepair/DeviceRepairEditListModel.vue @@ -0,0 +1,238 @@ +<template> + <a-modal :title="title" :width="1000" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel" + cancelText="鍏抽棴"> + <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="6"> + <a-form-item label="缁熶竴缂栫爜"> + <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜妫�绱�" v-model="queryParam.equipmentId"></a-input> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉版绱�" v-model="queryParam.equipmentName"></a-input> + </a-form-item> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </div> + <!-- table鍖哄煙-begin --> + <div> + <a-table ref="table" size="middle" bordered rowKey="id" :scroll="{聽 y: 300聽}" :columns="columns" + :dataSource="dataSource" :pagination="ipagination" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}" + @change="handleTableChange"> + </a-table> + </div> + <!-- table鍖哄煙-end --> + </a-card> + </a-modal> +</template> + +<script> + import { + ajaxGetSelectItems + } from '@/api/api' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import { + deleteAction, + requestPut, + getAction, + postAction + } from '@/api/manage' + import { + JeecgListMixin + } from '@/mixins/JeecgListMixin' + import JInput from '@/components/jeecg/JInput' + import JEllipsis from '@/components/jeecg/JEllipsis' + import Tooltip from 'ant-design-vue/es/tooltip' + import JDate from '@/components/jeecg/JDate' + import moment from 'moment' + + export default { + name: 'DeviceRepairEditListModel', + mixins: [JeecgListMixin], + components: { + JDictSelectTag, + JEllipsis, + JInput, + Tooltip, + JDate + }, + props: { + status: { + type: Number, + default: 1 + } + }, + data() { + return { + readOnly:true, + title:'', + visible: false, + disableMixinCreated: true, + queryParam: {}, + columns: [{ + title: '缁熶竴缂栫爜', + align: 'center', + dataIndex: 'equipmentId', + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + }, + // { + // title: '璁惧鍨嬪彿', + // align: 'center', + // dataIndex: 'equipmentModel', + // }, + // // { + // // title: '璁惧绫诲瀷', + // // align: 'center', + // // dataIndex: 'equipmentType', + // // }, + // { + // title: '鏈哄簥IP', + // align: 'center', + // dataIndex: 'equipmentIp', + // }, + // { + // title: '椹卞姩绫诲瀷', + // align: 'center', + // dataIndex: 'driveType', + // }, + // { + // title: '绔彛', + // align: 'center', + // dataIndex: 'dataPort', + // }, + // { + // title: '鏁版帶绯荤粺', + // align: 'center', + // dataIndex: 'controlSystem', + // } + ], + url: { + list: '/mdc/mdcequipment/findListEquipment', + }, + + } + }, + created() { + + }, + methods: { + openPage() { + this.visible = true + this.onClearSelected() + this.dataSource = []; + this.queryParam = { + status: this.status + }; + this.loadData(); + }, + onSelectChange(selectedRowKeys, selectionRows) { + // this.SelectedList.push(selectedRowKeys); + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows + // this.SelectedList =[...this.SelectedList,...selectionRows]; + // console.log(this.SelectedList); + }, + loadData(arg) { + if(!this.url.list){ + // this.$message.error("璇疯缃畊rl.list灞炴��!") + this.$notification.error({ + message:'娑堟伅', + description:"璇疯缃畊rl.list灞炴��!" + }); + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + + if(!params){ + return false; + } + + this.loading = true; + postAction(this.url.list, params).then((res) => { + if (res.success) { + // console.log(res) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + modalFormOk(val) { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData(); + this.selectedRowKeys = [val.id]; + }, + searchQuery() { + this.loadData(); + this.onClearSelected() + }, + searchReset() { + this.queryParam = { + status: 1 + }; + this.loadData(); + this.onClearSelected() + }, + close() { + this.$emit('close') + this.visible = false + }, + handleCancel() { + this.close() + }, + handleOk() { + this.$emit('sendSelectionRows', this.selectionRows[0]) + this.close() + }, + }, + } +</script> +<style> + @import '~@assets/less/common.less'; + + .frozenRowClass { + color: #c9c9c9; + } + + .success { + color: green; + } + + .error { + color: red; + } +</style> diff --git a/src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue b/src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue new file mode 100644 index 0000000..2a5c4e1 --- /dev/null +++ b/src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue @@ -0,0 +1,638 @@ +<template> + <div class="device_list"> + <!-- 鏌ヨ鍖哄煙 --> + <div style="background-color: #fff" class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24" style="width: 100%;"> + <a-col :md="7" :sm="7"> + <a-form-item label="鏃堕棿"> + <a-range-picker @change="dateParamChange" v-model="dates" format="YYYY-MM-DD HH:mm:ss"/> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5"> + <a-form-item label="璁惧缂栧彿"> + <a-input placeholder="杈撳叆璁惧缂栧彿鏌ヨ" v-model="queryParams.equipmentId"></a-input> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" v-model="queryParams.equipmentName"></a-input> + </a-form-item> + </a-col> + <a-col :md="2" :sm="2" :xs="2"> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </a-col> + <!--<a-col :md="2" :sm="3" :xs="3">--> + <!--<a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>--> + <!--</a-col>--> + <!--<a-col :md="2" :sm="2" :xs="2">--> + <!--<a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>--> + <!--</a-col>--> + <!--<a-col :lg="2" :md="3" :sm="3" :xs="3">--> + <!--<!–<a-button type="primary" @click="exportExcel" icon="download">瀵煎嚭</a-button>–>--> + <!--<a-button type="primary" @click="handleExportXls('缁翠慨浼戠彮绠$悊')" icon="download">瀵煎嚭</a-button>--> + <!--</a-col>--> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" style="display: inline;"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板 + </a-button> + <a-button type="primary" @click="handleExportXls('缁翠慨浼戠彮绠$悊')" icon="download">瀵煎嚭</a-button> + <!--<a-button v-has="'user.add'" @click="handleAddXIU" type="primary" icon="plus">浼戠彮鏂板--> + <!--</a-button>--> + </div> + + <!-- table鍖哄煙-begin --> + <div id="DeviceList" style="flex: 1;overflow: hidden"> + <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns" + :dataSource="dataSource" :pagination="ipagination" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange" :scroll="{x:'max-content',y:scrollY}"> + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a @click="handleDelete(record.id)">鍒犻櫎</a> + </span> + <!--瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず--> + <span slot="num" slot-scope="text" style="font-weight: bold"> + <j-ellipsis :value="text" :length="8"/> + </span> + <span slot="name" slot-scope="text" style="font-weight: bold"> + <j-ellipsis :value="text" :length="8"/> + </span> + <span slot="model" slot-scope="text" style="font-weight: bold"> + <j-ellipsis :value="text" :length="8"/> + </span> + </a-table> + </div> + <!-- table鍖哄煙-end --> + <device-repair-model ref="modalForm" :equipmentId="queryParams.equipmentId" @ok="modalFormOk"></device-repair-model> + <!--<device-repair-model-add ref="modalFormadd" @ok="modalFormOk"></device-repair-model-add>--> + <device-repair-model-edit ref="modalFormedit" @ok="modalFormOk"></device-repair-model-edit> + <!--<repair-model ref="repairModelFrom" @ok="modalFormOk">0</repair-model>--> + </div> +</template> + +<script> + import moment from 'moment' + import $ from 'jquery' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JDate from '../../../../../components/jeecg/JDate' + import { + requestPut, + deleteAction, + getAction + } from '@/api/manage' + import DeviceRepairModel from './DeviceRepairModel' + import DeviceRepairModelAdd from './DeviceRepairModelAdd' + import DeviceRepairModelEdit from './DeviceRepairModelEdit' + import '@/components/table2excel/table2excel' + import { + JeecgListMixin + } from '@/mixins/JeecgListMixin' + import JInput from '@/components/jeecg/JInput' + import JEllipsis from '@/components/jeecg/JEllipsis' + import Tooltip from 'ant-design-vue/es/tooltip' + import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' + import ACol from 'ant-design-vue/es/grid/Col' + export default { + name: 'DeviceRepairList', + mixins: [JeecgListMixin], + components: { + ACol, + Tooltip, + DeviceRepairModel, + DeviceRepairModelAdd, + DeviceRepairModelEdit, + JDictSelectTag, + JInput, + JDate, + JEllipsis + }, + props: { nodeTree: '', Type:'',nodePeople: '' }, + data() { + return { + typeTree:"", + typeParent:1, + typeEquipment:1, + dates: [], + xianshi:"", + readOnly:true, + queryParam: {}, + queryParams:{}, + queryParamEquip:{}, + queryParamPeople:{}, + dataStartsoucre:[], + scrollY:465, + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + columns: [ + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width:250 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + defaultSortOrder:'descend', + sorter: (a, b) => {return a.equipmentName>b.equipmentName?1:-1}, + width:250 + }, + { + title: '缁翠慨绫诲瀷', + align: 'center', + dataIndex: 'mdcRepairTypeDictText', + width:250 + }, + { + title: '寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'startTime', + width:250 + // scopedSlots:{customRender:'startTime'}, + // customRender:(text,row,index) => { + // return moment(text).format("YYYY-MM-DD HH:mm:ss") + // } + }, + { + title: '缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'endTime', + width:250 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: {customRender: 'action'}, + align: "center", + width: 150, + fixed:'right' + } + ], + url: { + list: '/mdc/mdcEquipmentRepair/pageList', + deleteBatch: '/mdc/mdcEquipmentRepair/delete', + getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', + exportXlsUrl:'/mdc/mdcEquipmentRepair/exportXls' + } + } + }, + watch:{ + Type(valmath){ + this.dataList = []; + this.queryParams.typeTree = valmath + // console.log(this.queryParams.typeTree) + }, + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParamEquip.parentId = "" + this.queryParams.equipmentId = val.equipmentId + this.queryParamEquip.equipmentId = val.equipmentId + } else { + this.queryParamEquip.parentId = val.key + this.queryParams.equipmentId ='' + } + }else{ + this.queryParams.equipmentId='' + this.queryParamEquip.parentId = "" + } + this.searchQuery() + }, + nodePeople(val){ + if (JSON.stringify(val) != '{}') { + if (val.equipmentId) { + this.queryParamEquip.parentId = "" + this.queryParams.equipmentId = val.equipmentId + this.queryParamEquip.equipmentId = val.equipmentId + } else { + this.queryParamPeople.parentId = val.key + this.queryParams.equipmentId = '' + } + this.searchQuery() + } + } + }, + methods: { + dateParamChange(v1, v2) { + // console.log(v1,v2) + this.queryParam.startTime = v2[0] + this.queryParam.endTime = v2[1] + // console.log(v2[0],v2[1]) + }, + onChange(value, dateString) { + // console.log('Selected Time: ', value); + // console.log('Formatted Selected Time: ', dateString); + }, + onOk(value) { + console.log('onOk: ', value); + }, + searchReset() { + if(this.queryParams.typeTree == "1"){ + this.typeTree = this.queryParams.typeTree + this.typeParent = this.queryParams.parentId + this.typeEquipment = this.queryParams.equipmentId + this.queryParams = {} + this.queryParam = {} + this.dates = [] + this.queryParams.typeTree = this.typeTree + this.queryParams.parentId = this.typeParent + if(this.queryParams.parentId != ""){ + this.queryParams.equipmentId = "" + }else{ + if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ + this.queryParams.equipmentId = this.typeEquipment + }else{ + this.queryParams.equipmentId = this.queryParamEquip.equipmentId + } + + } + + this.ipagination.current = 1 + this.ResetloadData(); + }else{ + this.typeTree = this.queryParams.typeTree + this.typeParent = this.queryParams.parentId + // this.typeEquipment = this.queryParams.equipmentId + this.queryParams = {} + this.queryParam = {} + this.dates = [] + this.queryParams.typeTree = this.typeTree + this.queryParams.parentId = this.typeParent + // this.queryParams.equipmentId = this.typeEquipment + this.ipagination.current = 1 + this.ResetloadData(); + } + + }, + ResetloadData() { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + var params = this.getQueryParams();//鏌ヨ鏉′欢 + if(!params){ + return false; + } + params.typeTree = this.queryParams.typeTree + params.parentId = this.queryParams.parentId + params.equipmentId = this.queryParams.equipmentId + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records||res.result; + // this.initDeviceType(this.dataSource) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + // this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + handleEdit: function (record) { + this.$refs.modalFormedit.edit(record); + this.$refs.modalFormedit.title = "缂栬緫"; + this.$refs.modalFormedit.disableSubmit = false; + }, + handleTableChange(pagination, filters, sorter) { + this.dataSource = [] + //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 + //TODO 绛涢�� + // console.log(pagination) + if (Object.keys(sorter).length > 0) { + this.isorter.column = sorter.field; + this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" + } + this.ipagination = pagination; + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); + param.pageNo = this.ipagination.current; + param.pageSize = this.ipagination.pageSize; + param.field = this.getQueryField(); + param.parentId = this.queryParams.parentId; + param.equipmentId = this.queryParams.equipmentId; + param.startTime = this.queryParam.startTime; + param.endTime = this.queryParam.endTime; + getAction(this.url.list,param).then((res) => { + if(res.success){ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + searchQueryEdit(){ + if(this.queryParams.typeTree == "1"){ + this.queryParams.parentId = this.queryParamEquip.parentId + }else{ + this.queryParams.parentId = this.queryParamPeople.parentId + this.queryParams.equipmentIds = "" + } + this.dataSource = []; + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); + param.pageNo = this.ipagination.current; + param.pageSize = this.ipagination.pageSize; + param.field = this.getQueryField(); + param.parentId = this.queryParams.parentId; + param.equipmentId = this.queryParams.equipmentId; + param.startTime = this.queryParam.startTime; + param.endTime = this.queryParam.endTime; + getAction(this.url.list,param).then((res) => { + if(res.success){ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + searchQuery(){ + if(this.queryParams.typeTree == "1"){ + this.queryParams.parentId = this.queryParamEquip.parentId + // this.queryParams.equipmentId = this.queryParamEquip.equipmentId + }else{ + this.queryParams.parentId = this.queryParamPeople.parentId + // this.queryParams.equipmentId = "" + } + this.dataSource = []; + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); + param.pageNo = 1; + param.pageSize = this.ipagination.pageSize; + param.field = this.getQueryField(); + param.parentId = this.queryParams.parentId; + param.equipmentId = this.queryParams.equipmentId; + param.startTime = this.queryParam.startTime; + param.endTime = this.queryParam.endTime; + // console.log(param); + getAction(this.url.list,param).then((res) => { + if(res.success){ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + if(!params){ + return false; + } + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records||res.result; + // this.initDeviceType(this.dataSource) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + // this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + modalFormOk(val) { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.searchQueryEdit(); + // this.$emit('openBasetree','') + this.selectedRowKeys = [] + }, + handleDelete: function (id) { + if(!this.url.deleteBatch){ + this.$message.error("璇疯缃畊rl.delete灞炴��!") + return + } + var that = this; + deleteAction(that.url.deleteBatch, {id: id}).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); + that.searchQuery(); + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }); + }, + /** + * 鎵撳紑鏂板缁翠慨鎴栦紤鐝脊绐� + */ + handleAdd() { + this.$refs.modalForm.add(this.node) + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + // handleAddXIU() { + // this.$refs.modalFormadd.add() + // this.$refs.modalFormadd.title = '鏂板' + // this.$refs.modalFormadd.disableSubmit = false + // }, + pQuery(parentId) { + this.queryParam.parentId = parentId[0] + if(this.selectedRowKeys.length >= 1) { + this.selectedRowKeys.length = 0 + } + this.loadData() + }, + onSelectChange(selectedRowKeys) { + this.selectedRowKeys = selectedRowKeys + }, + initEquipment(id) { + let _this = this + getAction(this.url.getEquipmentByPid, { pid: id }).then((res) => { + if (res.success) { + if (res.result) { + _this.$set(this.queryParams, 'equipmentName', res.result.equipmentName) + _this.$set(this.queryParams, 'equipmentId', res.result.equipmentId) + _this.equipment = res.result + _this.searchQuery() + } else { + // _this.$message.warning('璇烽厤缃澶囷紒') + _this.$notification.warning({ + message:'娑堟伅', + description:"璇烽厤缃澶�!" + }); + } + } + }) + }, + exportExcel() { + $("#DeviceList").table2excel({ + exclude: ".noExl", + name: "Excel Document Name", + filename: "缁翠慨浼戠彮绠$悊", + exclude_img: true, + fileext: ".xls", + exclude_links: true, + exclude_inputs: true + }); + }, + + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + handleWindowResize(){ + const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0,-2) + const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0,-2) + this.scrollY = boxHeight - tableHeadHeight - 50 + } + }, + created() { + this.queryParam.typeTree = "1" + }, + mounted(){ + window.addEventListener('resize',this.handleWindowResize) + this.handleWindowResize() + }, + beforeDestroy(){ + window.removeEventListener('resize',this.handleWindowResize) + } + } +</script> + +<style lang="less" scoped> + @import '~@assets/less/common.less'; + + .device_list{ + overflow: hidden; + display: flex; + flex-direction: column; + } + + @media screen and (min-width: 1920px){ + .device_list{ + height: 811px!important; + } + } + @media screen and (min-width: 1680px) and (max-width: 1920px){ + .device_list{ + height: 811px!important; + } + } + @media screen and (min-width: 1400px) and (max-width: 1680px){ + .device_list{ + height: 663px!important; + } + } + @media screen and (min-width: 1280px) and (max-width: 1400px){ + .device_list{ + height: 564px!important; + } + } + @media screen and (max-width: 1280px){ + .device_list{ + height: 564px!important; + } + } +</style> diff --git a/src/views/mdc/base/modules/deviceRepair/DeviceRepairListModel.vue b/src/views/mdc/base/modules/deviceRepair/DeviceRepairListModel.vue new file mode 100644 index 0000000..ae7e3ec --- /dev/null +++ b/src/views/mdc/base/modules/deviceRepair/DeviceRepairListModel.vue @@ -0,0 +1,365 @@ + +<template> + <a-modal :title="title" width="70%" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel" + cancelText="鍏抽棴"> + <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="6" v-if="isDepartType == 0"> + <a-form-item label="閮ㄩ棬" v-if="isDepartType == 0"> + <!--<a-select v-model="queryParam.sectionPid" placeholder="璇烽�夋嫨閮ㄩ棬" :options="sectionPData" @change="initGroupOptions" />--> + <a-tree-select + v-model="value" + style="width: 100%" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + :tree-data="treeData" + placeholder="璇烽�夋嫨閮ㄩ棬" + tree-default-expand-all + > + <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">--> + <!--Child Node1 {{ value }}--> + <!--</span>--> + </a-tree-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="杞﹂棿" > + <!--<a-select v-model="queryParam.sectionId" placeholder="璇烽�夋嫨鍥㈤槦" :options="sectionData"/>--> + <a-tree-select + v-model="valueProduct" + style="width: 100%" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + :tree-data="sectionData" + placeholder="璇烽�夋嫨杞﹂棿" + tree-default-expand-all + > + <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">--> + <!--Child Node1 {{ value }}--> + <!--</span>--> + </a-tree-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="缁熶竴缂栫爜"> + <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜妫�绱�" v-model="queryParam.equipmentId"></a-input> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉版绱�" v-model="queryParam.equipmentName"></a-input> + </a-form-item> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </div> + <!-- table鍖哄煙-begin --> + <div> + <a-table ref="table" size="middle" bordered rowKey="id" :scroll="{聽 y: 400聽}" :columns="columns" + :dataSource="dataSource" :pagination="ipagination" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,getCheckboxProps:getCheckboxProps,selections: true,}" + @change="handleTableChange"> + </a-table> + </div> + <!-- table鍖哄煙-end --> + </a-card> + </a-modal> +</template> + +<script> + import {mapActions} from 'vuex' + import { + ajaxGetSelectItems + } from '@/api/api' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import { + deleteAction, + requestPut, + getAction, + postAction + } from '@/api/manage' + import { + JeecgListMixin + } from '@/mixins/JeecgListMixin' + import JInput from '@/components/jeecg/JInput' + import JEllipsis from '@/components/jeecg/JEllipsis' + import Tooltip from 'ant-design-vue/es/tooltip' + import JDate from '@/components/jeecg/JDate' + import moment from 'moment' + + export default { + name: 'DeviceCalendarListModel', + mixins: [JeecgListMixin], + components: { + JDictSelectTag, + JEllipsis, + JInput, + Tooltip, + JDate + }, + props: { + status: { + type: Number, + default: 1 + }, + selectedEquipmentIds:{ + type:String + } + }, + data() { + return { + isDepartType:'', + /*readOnly:true,*/ + title:'', + visible: false, + SelectedList:[], + treeData:[], + /*disableMixinCreated: true, + queryParam: {},*/ + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + },{ + + title: '缁熶竴缂栫爜', + align: 'center', + dataIndex: 'equipmentId', + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + }, + { + title: '椹卞姩绫诲瀷', + align: 'center', + dataIndex: 'driveType' + }, + { + title: '鏁版帶绯荤粺', + align: 'center', + dataIndex: 'controlSystem' + }, + ], + sectionPData: [], + sectionData: [], + url: { + list: '/mdc/mdcEquipment/findEquipmentList', + loadOptions: '/sys/sysDepart/loadDepartTreeOptions', + loadProductionOptions:'/mdc/mdcProduction/loadProductionTreeOptions' + }, + value:undefined, + valueProduct:undefined + } + }, + created() { + this.queryTreeData() + }, + watch: { + value(value) { + // console.log(value); + this.queryParam.departId = value + }, + valueProduct(value){ + this.queryParam.productionId = value + } + }, + methods: { + ...mapActions(['QueryDepartTree']), + queryTreeData() { + this.QueryDepartTree().then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + } else { + // this.$message.warn(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() =>{ + }) + }, + onSelectChange(selectedRowKeys, selectionRows) { + // this.SelectedList.push(selectedRowKeys); + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows + // this.SelectedList =[...this.SelectedList,...selectionRows]; + // console.log(this.SelectedList); + console.log('selectedRowKeys',selectedRowKeys) + console.log('selectionRows',selectionRows) + + }, + handleTableChange(pagination, filters, sorter) { + // this.onClearSelected() + //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 + //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(); + }, + openPage() { + this.visible = true + this.onClearSelected() + this.dataSource = []; + this.queryParam = { + status: this.status + }; + + this.loadData(); + this.initOptions(); + this.initGroupOptions() + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + + if(!params){ + return false; + } + + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + // console.log(res) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + modalFormOk(val) { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData(); + + this.selectedRowKeys = [val.id]; + }, + searchQuery() { + this.loadData(); + this.onClearSelected() + }, + searchReset() { + this.queryParam = { + status: 1 + }; + this.loadData(); + this.onClearSelected() + }, + close() { + this.$emit('close') + this.visible = false + }, + handleCancel() { + this.close() + }, + handleOk() { + // this.selectionRows = this.SelectedList; + // console.log(this.selectionRows); + this.$emit('sendSelectionRows', this.selectionRows) + this.close() + }, + initOptions() { + getAction(this.url.loadOptions).then(res => { + if (res.success) { + this.treeData = res.result + } else { + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }) + }, + initGroupOptions() { + getAction(this.url.loadProductionOptions).then(res => { + if (res.success) { + this.sectionData = res.result + } else { + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }) + }, + /** + * 姣忔鍔犺浇鍒楄〃鏃跺垽鏂凡閫変腑璁惧缂栧彿鏁扮粍鏄惁鍖呭惈琛ㄦ牸鏁版嵁涓殑璁惧缂栧彿锛屽鏋滃寘鍚垯閫変腑 + * @param record + * @returns {{props: {defaultChecked: boolean}}} + */ + getCheckboxProps(record){ + if(this.selectedEquipmentIds){ + let selectedEquipmentIdsArr=this.selectedEquipmentIds.split(',') + return { + props:{ + defaultChecked: selectedEquipmentIdsArr.includes(record.equipmentId) + } + } + }else{ + return { + props:{ + defaultChecked:false + } + } + } + } + }, + } +</script> +<style> + @import '~@assets/less/common.less'; + + .frozenRowClass { + color: #c9c9c9; + } + + .success { + color: green; + } + + .error { + color: red; + } +</style> diff --git a/src/views/mdc/base/modules/deviceRepair/DeviceRepairModel.vue b/src/views/mdc/base/modules/deviceRepair/DeviceRepairModel.vue new file mode 100644 index 0000000..64f0cbd --- /dev/null +++ b/src/views/mdc/base/modules/deviceRepair/DeviceRepairModel.vue @@ -0,0 +1,519 @@ +<template> + <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row :gutter="24"> + <a-col :span="24"> + <!--<a-form-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<a-input-search :readOnly="true" v-decorator="['equipmentId', validatorRules.equipmentId]"--> + <!--@search="deviceSearch" enter-button/>--> + <!--<!–<a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�"–>--> + <!--<!–v-decorator="['equipmentId',validatorRules.equipmentId]"/>–>--> + <!--</a-form-item>--> + <!--</a-col>--> + <!--<a-col :span="12">--> + <!--<a-form-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�"--> + <!--v-decorator="['equipmentName',validatorRules.equipmentName]"/>--> + <!--</a-form-item>--> + <a-form-item label="璁惧缁�" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <a-input-search :readOnly="true" v-decorator="['equipmentIds', validatorRules.equipmentIds]" + @search="deviceSearch" enter-button placeholder="璇烽�夋嫨璁惧"/> + <!--<a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�"--> + <!--v-decorator="['equipmentId',validatorRules.equipmentId]"/>--> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item label="缁翠慨绫诲瀷" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <a-radio-group v-decorator="['mdcRepairType', validatorRules.mdcRepairType]"> + <a-radio :value="1"> + 缁翠慨 + </a-radio> + <a-radio :value="2"> + 浼戠彮 + </a-radio> + </a-radio-group> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="寮�濮嬫椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="{defaultValue:moment('08:00:00','HH:mm:ss'),hideDisabledOptions:true}" + date-format="YYYY-MM-DD HH:mm:ss" + placeholder="璇烽�夋嫨寮�濮嬫椂闂�" + :disabledDate="disabledDate" class="query-group-cust" + v-decorator="['startTime', validatorRules.startTime]" :disabledTime="disabledDateTime" + :showToday="false"></j-date> + </a-form-item> + </a-col> + <a-col :span="12"> + <a-form-item label="缁撴潫鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="{defaultValue:moment('08:00:00','HH:mm:ss'),hideDisabledOptions:true}" + date-format="YYYY-MM-DD HH:mm:ss" + placeholder="璇烽�夋嫨缁撴潫鏃堕棿" + :disabledDate="disabledDate" class="query-group-cust" + v-decorator="['endTime', validatorRules.endTime]" :disabledTime="disabledDateTime" + :showToday="false"></j-date> + </a-form-item> + </a-col> + </a-row> + <!--<a-row :gutter="24">--> + <!--<a-col :span="12">--> + <!--<a-form-item v-show="this.mesag == 1" label="缁翠慨绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<a-input :disabled="disableSubmit" :readOnly="readOnly" placeholder="璇烽�夋嫨璁惧绫诲瀷"--> + <!--:triggerChange="true"--> + <!--v-decorator="['mdcRepairType', validatorRules.mdcRepairType]"/>--> + <!--</a-form-item>--> + <!--</a-col>--> + <!--</a-row>--> + </a-form> + </a-spin> + <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'閫夋嫨璁惧'"/> + </a-modal> +</template> + +<script> + import moment from 'moment' + import pick from 'lodash.pick' + import JDate from './JDate' + import { + getAction, + postAction, + requestPut + } from '@/api/manage' + import { + duplicateCheck + } from '@/api/api' + import Vue from 'vue' + import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer' + + export default { + name: 'DeviceRepairModel', + components: { SelectDeviceDrawer, JDate }, + props: { + equipmentId: { + type: String + } + }, + + data() { + return { + mesag: 21, + readOnly: true, + title: '', + visible: false, + show: false, + model: {}, + checked: false, + startData: '', + endData: '', + labelCol: { + xs: { + span: 24 + }, + sm: { + span: 6 + } + }, + wrapperCol: { + xs: { + span: 24 + }, + sm: { + span: 18 + } + }, + labelColLong: { + xs: { + span: 24 + }, + sm: { + span: 3 + } + }, + wrapperColLong: { + xs: { + span: 24 + }, + sm: { + span: 21 + } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + equipmentIds: { + rules: [ + { + required: true, + message: '璇烽�夋嫨璁惧' + } + ], + initialValue: '' + }, + equipmentName: { + rules: [ + { + required: true, + message: '' + } + ] + }, + mdcRepairType: { + rules: [ + { + required: true, + message: '' + } + ], + initialValue: 1 + }, + startTime: { + rules: [ + { + required: true, + message: '璇烽�夋嫨寮�濮嬫椂闂�' + } + ] + }, + endTime: { + rules: [ + { + required: true, + message: '璇烽�夋嫨缁撴潫鏃堕棿' + } + ] + } + }, + + url: { + add: '/mdc/mdcEquipmentRepair/add', + edit: '/mdc/mdcEquipmentRepair/edit' + }, + + disableSubmit: true, + partCategoryCascade: [], + cascadeDefaultValue: [], + selectedEquipmentIds: '' + } + + }, + created() { + }, + watch: { + // 鐩戞帶璁惧缂栧彿锛屽綋鏀瑰彉鏍戜腑閫夐」鏃跺皢鍊艰祴鍊肩粰鏂板寮圭獥鐨勮澶囩粍閫夐」 + equipmentId: function(val) { + this.validatorRules.equipmentIds.initialValue = val + }, + // 鐩戞帶寮圭獥鏄剧ず锛屽鏋滃叧闂垯娓呯┖宸查�夋嫨鐨勫閫夛紝濡傛灉寮�鍚垯灏嗘爲涓凡閫夋嫨椤硅祴鍊肩粰宸查�夋嫨澶氶�� + visible: function(val) { + if (!val) { + this.selectedEquipmentIds = '' + } else { + this.selectedEquipmentIds = this.validatorRules.equipmentIds.initialValue + } + } + }, + methods: { + disabledDate(current) { + //Can not slect days before today and today + // return current && current < moment().endOf("day"); + return current < moment().subtract(+2, 'day').endOf('day')//鍓嶄竴澶╀箣鍓嶇殑骞存湀鏃ヤ笉鍙�夛紝涓嶅寘鎷墠涓�澶� + }, + moment, + // onChange(dates) { + // // console.log(111) + // // console.log(dates,dateStrings) + // // console.log('From: ', dates[0], ', to: ', dates[1]); + // // console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]); + // // this.startTime = dateStrings[0]; + // // this.endData = dateStrings[1]; + // // console.log(this.startData,this.endData); + // }, + onChangeEnd(dates, dateStrings) { + this.endTime = dateStrings[0] + }, + getDeviceRows(val) { + // var equipmentIds + // for (var i = 0; i < val.length; i++) { + // if (i == 0) { + // equipmentIds = val[i].equipmentId + // } else { + // equipmentIds = equipmentIds + ',' + val[i].equipmentId + // } + // } + // // console.log("========",equipmentIds); + // this.form.setFieldsValue({ + // equipmentIds: equipmentIds + // }) + for (var i = 0; i < val.length; i++) { + if (i == 0) { + this.selectedEquipmentIds = val[i].equipmentId + } else { + this.selectedEquipmentIds = this.selectedEquipmentIds + ',' + val[i].equipmentId + } + } + // console.log("========",equipmentIds); + this.form.setFieldsValue({ + equipmentIds: this.selectedEquipmentIds + }) + // this.form.setFieldsValue({ + // equipmentId: val.equipmentId, + // equipmentName: val.equipmentName, + // equipmentModel: val.equipmentModel, + // equipmentIp: val.equipmentIp, + // dataPort: val.dataPort, + // driveType: val.driveType + // }) + }, + deviceSearch() { + this.$refs.selectDeviceDrawer.visible = true + this.$refs.selectDeviceDrawer.selectedRowKeys = [] + this.$refs.selectDeviceDrawer.selectedRows = [] + this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : [] + }, + //绾ц仈妗唎nChange浜嬩欢 + // onChange(value) { + // + // }, + getParentIdsById(id) { + let that = this + getAction(this.url.getParentIdsById, { + id: id + }).then((res) => { + if (res.success) { + that.form.setFieldsValue({ + partCategoryId: res.result + }) + } + }) + }, + add(node) { + let _this = this + this.visible = true + this.form.resetFields() + this.model = {} + this.$nextTick(() => { + // _this.form.setFieldsValue({ 'tierType': node.entity.tierType + 1, 'parentName': node.title }) + // _this.model.parentId = node.key + }) + }, + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'equipmentIds', 'equipmentName', 'mdcRepairType', 'startTime', 'endTime' + )) + }) + }, + close() { + this.$emit('close') + this.visible = false + this.show = false + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + let start = moment(formData.startTime).format('YYYY-MM-DD HH:mm:ss') + let end = moment(formData.endTime).format('YYYY-MM-DD HH:mm:ss') + let startOne = start.replace(/:/g, '') + let endOne = end.replace(/:/g, '') + var data = new Date() + let stertDate = moment(data).format('YYYY-MM-DD HH:mm:ss') + let dataStart = stertDate.replace(/:/g, '') + // if (startOne < dataStart) { + // // that.$message.warning("寮�濮嬫椂闂翠笉鑳藉皬浜庡綋鍓嶆椂闂�") + // that.$notification.warning({ + // message: '娑堟伅', + // description: '寮�濮嬫椂闂翠笉鑳藉皬浜庡綋鍓嶆椂闂�' + // }) + // that.confirmLoading = false + // } else { + // if (startOne >= endOne) { + // // that.$message.warning("缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�"); + // that.$notification.warning({ + // message: '娑堟伅', + // description: '缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�' + // }) + // // console.log(this.model) + // // this.endTime = '' + // that.confirmLoading = false + // } else { + // let obj + // if (!this.model.id) { + // obj = postAction(this.url.add, formData) + // } else { + // obj = requestPut(this.url.edit, formData, { + // id: this.model.id + // }) + // } + // obj.then((res) => { + // if (res.success) { + // // that.$message.success("娣诲姞鎴愬姛") + // that.$notification.success({ + // message: '娑堟伅', + // description: '娣诲姞鎴愬姛' + // }) + // // that.$message.success(res.message) + // that.$emit('ok', res.result) + // } else { + // // that.$message.warning(res.message) + // that.$notification.warning({ + // message: '娑堟伅', + // description: res.message + // }) + // } + // }).finally(() => { + // that.confirmLoading = false + // that.close() + // }) + // } + // } + if (startOne >= endOne) { + // that.$message.warning("缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�"); + that.$notification.warning({ + message: '娑堟伅', + description: '缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�' + }) + // console.log(this.model) + // this.endTime = '' + that.confirmLoading = false + } else { + let obj + if (!this.model.id) { + obj = postAction(this.url.add, formData) + } else { + obj = requestPut(this.url.edit, formData, { + id: this.model.id + }) + } + obj.then((res) => { + if (res.success) { + // that.$message.success("娣诲姞鎴愬姛") + that.$notification.success({ + message: '娑堟伅', + description: '娣诲姞鎴愬姛' + }) + // that.$message.success(res.message) + that.$emit('ok', res.result) + } else { + // that.$message.warning(res.message) + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } + } + }) + }, + handleCancel() { + this.close() + }, + loadCascade() { + getAction(this.url.loadCascadeData).then((res) => { + if (res.success) { + this.partCategoryCascade = res.result + } + }) + }, + onCascadeChange(value, selectedOptions) { + this.cascadeDefaultValue = [...value] + }, + filter(inputValue, path) { + return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) + }, + //楠岃瘉 缂栫爜 + validateNum(rule, value, callback) { + var params = { + tableName: 'lxmes_base_part', + fieldName: 'num', + fieldVal: value, + dataId: this.model.id, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true' + } + duplicateCheck(params).then((res) => { + if (res.success) { + callback() + } else { + callback('瀛樿揣缂栫爜宸插瓨鍦�!') + } + }) + }, + checkboxChange(e) { + this.checked = e.target.checked + }, + range(start, end) { + const result = [] + for (let i = start; i < end; i++) { + result.push(i) + } + return result + }, + /** + * 绂佺敤鏃ユ湡閫夋嫨鍣ㄤ腑鐨勬椂闂撮�夋嫨 + * @returns {{disabledSeconds: (function(): number[])}} 杩斿洖鍊间负涓�涓璞★紝鍙互绂佹灏忔椂銆佸垎閽熴�佺锛岀洰鍓嶄粎绂佹鎵�鏈夌鏁�,鏈�浣庝粠1寮�濮嬶紝浠�0寮�濮嬬‘瀹氭寜閽皢琚鐢� + */ + disabledDateTime() { + return { + disabledSeconds: () => this.range(1, 60) + } + }, + + /** + * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂 + * @param data 宸查�夋嫨鐨勮澶� + */ + selectOK(data) { + // let params = {} + // params.equipmentIdList = [] + // for (var a = 0; a < data.length; a++) { + // params.equipmentIdList.push(data[a]) + // } + console.log('data=', data) + this.form.setFieldsValue({ + equipmentIds: data.join(',') + }) + } + } + } +</script> + +<style scoped> + .ant-btn { + padding: 0 10px; + margin-left: 3px; + } + + .ant-form-item-control { + line-height: 0px; + } + + /** 涓昏〃鍗曡闂磋窛 */ + .ant-form .ant-form-item { + margin-bottom: 10px; + } + + /** Tab椤甸潰琛岄棿璺� */ + .ant-tabs-content .ant-form-item { + margin-bottom: 0px; + } + + +</style> diff --git a/src/views/mdc/base/modules/deviceRepair/DeviceRepairModelAdd.vue b/src/views/mdc/base/modules/deviceRepair/DeviceRepairModelAdd.vue new file mode 100644 index 0000000..e1ac1e5 --- /dev/null +++ b/src/views/mdc/base/modules/deviceRepair/DeviceRepairModelAdd.vue @@ -0,0 +1,390 @@ +<template> + <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row :gutter="24"> + <a-col :span="24"> + <!--<a-form-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<a-input-search :readOnly="true" v-decorator="['equipmentId', validatorRules.equipmentId]"--> + <!--@search="deviceSearch" enter-button/>--> + <!--<!–<a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�"–>--> + <!--<!–v-decorator="['equipmentId',validatorRules.equipmentId]"/>–>--> + <!--</a-form-item>--> + <a-form-item label="璁惧缁�" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <a-input-search :readOnly="true" v-decorator="['equipmentIds', validatorRules.equipmentIds]" + @search="deviceSearch" enter-button/> + <!--<a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�"--> + <!--v-decorator="['equipmentId',validatorRules.equipmentId]"/>--> + </a-form-item> + </a-col> + <!--<a-col :span="12">--> + <!--<a-form-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�"--> + <!--v-decorator="['equipmentName',validatorRules.equipmentName]"/>--> + <!--</a-form-item>--> + <!--</a-col>--> + </a-row> + <!--<a-row :gutter="24">--> + <!--<a-col :span="24">--> + <!--<a-form-item label="璁惧鍚嶇О" :labelCol="labelColLong" :wrapperCol="wrapperColLong">--> + <!--<a-input :readOnly="true" v-decorator="['equipmentName', validatorRules.equipmentName]"--> + <!--enter-button/>--> + <!--</a-form-item>--> + <!--</a-col>--> + <!--</a-row>--> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="寮�濮嬫椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="{defaultValue:moment('08:00:00','HH:mm:ss')}" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" :disabledDate="disabledDate" + class="query-group-cust" v-decorator="['startTime', validatorRules.startTime]"></j-date> + </a-form-item> + </a-col> + <a-col :span="12"> + <a-form-item label="缁撴潫鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="{defaultValue:moment('08:00:00','HH:mm:ss')}" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" :disabledDate="disabledDate" + class="query-group-cust" v-decorator="['endTime', validatorRules.endTime]"></j-date> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item v-show="this.mesag == 1" label="缁翠慨绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="readOnly" placeholder="璇烽�夋嫨璁惧绫诲瀷" + :triggerChange="true" + v-decorator="['mdcRepairType', validatorRules.mdcRepairType]"/> + + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <device-repair-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-repair-list-model> + + </a-modal> +</template> + +<script> + import moment from 'moment' + import pick from 'lodash.pick' + import DeviceRepairListModel from './DeviceRepairListModel' + import JDate from './JDate' + import { + getAction, + postAction, + requestPut + } from '@/api/manage' + import { + duplicateCheck + } from '@/api/api' + + export default { + name: 'DeviceRepairModel', + components: {DeviceRepairListModel,JDate}, + props: {}, + data() { + return { + mesag:21, + readOnly:true, + title: '', + visible: false, + show: false, + model: {}, + checked: false, + startData:"", + endData:"", + labelCol: { + xs: { + span: 24 + }, + sm: { + span: 6 + } + }, + wrapperCol: { + xs: { + span: 24 + }, + sm: { + span: 18 + } + }, + labelColLong: { + xs: { + span: 24 + }, + sm: { + span: 3 + } + }, + wrapperColLong: { + xs: { + span: 24 + }, + sm: { + span: 21 + } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + equipmentId:{ + rules:[ + { + required:true, + message: "" + }, + ], + }, + equipmentName:{ + rules:[ + { + required:true, + message: "" + }, + ], + }, + mdcRepairType:{ + rules:[ + { + required:true, + message: "" + }, + ], + initialValue: 2 + } + }, + + url: { + add: '/mdc/mdcEquipmentRepair/add', + edit: '/mdc/mdcEquipmentRepair/edit' + }, + + disableSubmit: true, + partCategoryCascade: [], + cascadeDefaultValue: [] + } + }, + created() { + }, + + methods: { + disabledDate(current){ + //Can not slect days before today and today + // return current && current < moment().endOf("day"); + return current < moment().subtract(+1, 'day')//浠婂ぉ涔嬪墠鐨勫勾鏈堟棩涓嶅彲閫夛紝涓嶅寘鎷粖澶� + }, + moment, + onChange(dates) { + // console.log(111) + // console.log(dates,dateStrings) + // console.log('From: ', dates[0], ', to: ', dates[1]); + // console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]); + // this.startTime = dateStrings[0]; + // this.endData = dateStrings[1]; + // console.log(this.startData,this.endData); + }, + onChangeEnd(dates, dateStrings){ + this.endTime = dateStrings[0]; + }, + // getDeviceRows(val) { + // this.form.setFieldsValue({ + // equipmentId: val.equipmentId, + // equipmentName: val.equipmentName, + // // equipmentModel: val.equipmentModel, + // // equipmentIp: val.equipmentIp, + // // dataPort: val.dataPort, + // // driveType: val.driveType + // }) + // }, + getDeviceRows(val) { + var equipmentIds; + // var equipmentNames; + for(var i = 0;i<val.length;i++){ + if (i == 0) { + equipmentIds = val[i].equipmentId; + // equipmentNames = val[i].equipmentName; + } else { + equipmentIds = equipmentIds + "," + val[i].equipmentId; + // equipmentNames = equipmentNames + ',' + val[i].equipmentName + } + } + // console.log("========",equipmentIds); + this.form.setFieldsValue({ + equipmentIds: equipmentIds, + // equipmentName:equipmentNames + }) + }, + deviceSearch() { + this.$refs.deviceRepairListModel.openPage() + this.$refs.deviceRepairListModel.title = '閫夋嫨璁惧' + this.$refs.deviceRepairListModel.disableSubmit = false + }, + //绾ц仈妗唎nChange浜嬩欢 + onChange(value) { + + }, + getParentIdsById(id) { + let that = this + getAction(this.url.getParentIdsById, { + id: id + }).then((res) => { + if (res.success) { + that.form.setFieldsValue({ + partCategoryId: res.result + }) + } + }) + }, + add(node) { + let _this = this + this.visible = true + this.form.resetFields() + this.model = {} + this.$nextTick(() => { + // _this.form.setFieldsValue({ 'tierType': node.entity.tierType + 1, 'parentName': node.title }) + // _this.model.parentId = node.key + }) + }, + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'tierType', 'parentName', 'equipmentId', 'equipmentName', 'mdcRepairType', 'startTime', 'endTime', + )) + }) + }, + close() { + this.$emit('close') + this.visible = false + this.show = false + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + let start = moment(formData.startTime).format('YYYY-MM-DD HH:mm:ss'); + let end = moment(formData.endTime).format('YYYY-MM-DD HH:mm:ss'); + let startOne = start.replace(/:/g,''); + let endOne = end.replace(/:/g,''); + var data = new Date(); + let stertDate = moment(data).format("YYYY-MM-DD HH:mm:ss"); + let dataStart = stertDate.replace(/:/g,''); + if(startOne < dataStart) { + // that.$message.warning("寮�濮嬫椂闂翠笉鑳藉皬浜庡綋鍓嶆椂闂�") + that.$notification.warning({ + message:'娑堟伅', + description:"寮�濮嬫椂闂翠笉鑳藉皬浜庡綋鍓嶆椂闂�" + }); + that.confirmLoading = false + }else{ + if(startOne>=endOne){ + // that.$message.warning("缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�"); + that.$notification.warning({ + message:'娑堟伅', + description:"缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�" + }); + // console.log(this.model) + // this.endTime = '' + that.confirmLoading = false + }else{ + let obj + if (!this.model.id) { + obj = postAction(this.url.add, formData) + } else { + obj = requestPut(this.url.edit, formData, { + id: this.model.id + }) + } + obj.then((res) => { + if (res.success) { + // that.$message.success("娣诲姞鎴愬姛") + that.$notification.success({ + message:'娑堟伅', + description:"娣诲姞鎴愬姛" + }); + // that.$message.success(res.message) + that.$emit('ok', res.result) + } else { + // that.$message.warning(res.message) + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } + } + + + } + }) + }, + handleCancel() { + this.close() + }, + loadCascade() { + getAction(this.url.loadCascadeData).then((res) => { + if (res.success) { + this.partCategoryCascade = res.result + } + }) + }, + onCascadeChange(value, selectedOptions) { + this.cascadeDefaultValue = [...value] + }, + filter(inputValue, path) { + return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) + }, + //楠岃瘉 缂栫爜 + validateNum(rule, value, callback) { + var params = { + tableName: 'lxmes_base_part', + fieldName: 'num', + fieldVal: value, + dataId: this.model.id, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true' + } + duplicateCheck(params).then((res) => { + if (res.success) { + callback() + } else { + callback('瀛樿揣缂栫爜宸插瓨鍦�!') + } + }) + }, + checkboxChange(e) { + this.checked = e.target.checked + } + } + } +</script> + +<style scoped> + .ant-btn { + padding: 0 10px; + margin-left: 3px; + } + + .ant-form-item-control { + line-height: 0px; + } + + /** 涓昏〃鍗曡闂磋窛 */ + .ant-form .ant-form-item { + margin-bottom: 10px; + } + + /** Tab椤甸潰琛岄棿璺� */ + .ant-tabs-content .ant-form-item { + margin-bottom: 0px; + } +</style> diff --git a/src/views/mdc/base/modules/deviceRepair/DeviceRepairModelEdit.vue b/src/views/mdc/base/modules/deviceRepair/DeviceRepairModelEdit.vue new file mode 100644 index 0000000..adac88d --- /dev/null +++ b/src/views/mdc/base/modules/deviceRepair/DeviceRepairModelEdit.vue @@ -0,0 +1,485 @@ +<template> + <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="寮�濮嬫椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="{hideDisabledOptions:true}" date-format="YYYY-MM-DD HH:mm:ss" + placeholder="璇烽�夋嫨寮�濮嬫椂闂�" :disabledDate="disabledDate" + class="query-group-cust" v-decorator="['startTime', validatorRules.startTime]" + :disabledTime="disabledDateTime" :showToday="false"></j-date> + </a-form-item> + + </a-col> + <a-col :span="12"> + <a-form-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�" + v-decorator="['equipmentName',validatorRules.equipmentName]"/> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item label="缁撴潫鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="{hideDisabledOptions:true}" date-format="YYYY-MM-DD HH:mm:ss" + placeholder="璇烽�夋嫨缁撴潫鏃堕棿" + :disabledDate="disabledDate" + class="query-group-cust" v-decorator="['endTime', validatorRules.endTime]" + :disabledTime="disabledDateTime" :showToday="false"></j-date> + </a-form-item> + </a-col> + <a-col :span="12"> + + <a-form-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�" + v-decorator="['equipmentId',validatorRules.equipmentId]"/> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <!--<device-repair-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-repair-list-model>--> + <device-repair-edit-list-model ref="deviceRepairListModel" + @sendSelectionRows="getDeviceRows"></device-repair-edit-list-model> + </a-modal> +</template> + +<script> + import moment from 'moment' + import pick from 'lodash.pick' + import DeviceRepairListModel from './DeviceRepairListModel' + import DeviceRepairEditListModel from './DeviceRepairEditListModel' + import JDate from './JDate' + import { + getAction, + postAction, + requestPut + } from '@/api/manage' + import { + duplicateCheck + } from '@/api/api' + + export default { + name: 'DeviceRepairModelEdit', + components: { DeviceRepairListModel, JDate, DeviceRepairEditListModel }, + props: {}, + data() { + return { + readOnly: true, + title: '', + visible: false, + show: false, + model: {}, + checked: false, + startData: '', + endData: '', + labelCol: { + xs: { + span: 24 + }, + sm: { + span: 6 + } + }, + wrapperCol: { + xs: { + span: 24 + }, + sm: { + span: 18 + } + }, + labelColLong: { + xs: { + span: 24 + }, + sm: { + span: 3 + } + }, + wrapperColLong: { + xs: { + span: 24 + }, + sm: { + span: 21 + } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + equipmentId: { + rules: [ + { + required: true, + message: '' + } + ] + }, + equipmentName: { + rules: [ + { + required: true, + message: '' + } + ] + }, + startTime: { + rules: [ + { + required: true, + message: '璇烽�夋嫨寮�濮嬫椂闂�' + } + ] + }, + endTime: { + rules: [ + { + required: true, + message: '璇烽�夋嫨缁撴潫鏃堕棿' + } + ] + } + // mdcRepairType:{ + // rules:[ + // { + // required:true, + // message: "" + // }, + // ], + // initialValue: '浼戠彮' + // } + }, + + url: { + add: '/mdc/mdcEquipmentRepair/add', + edit: '/mdc/mdcEquipmentRepair/edit' + }, + + disableSubmit: true, + partCategoryCascade: [], + cascadeDefaultValue: [], + editStart: '' + } + }, + created() { + }, + + methods: { + disabledDate(current) { + //Can not slect days before today and today + // return current && current < moment().endOf("day"); + return current < moment().subtract(+2, 'day').endOf('day')//鍓嶄竴澶╀箣鍓嶇殑骞存湀鏃ヤ笉鍙�夛紝涓嶅寘鎷墠涓�澶� + }, + moment, + // onChange(dates) { + // console.log(111) + // console.log(dates,dateStrings) + // // console.log('From: ', dates[0], ', to: ', dates[1]); + // // console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]); + // // this.startTime = dateStrings[0]; + // // this.endData = dateStrings[1]; + // // console.log(this.startData,this.endData); + // }, + onChangeEnd(dates, dateStrings) { + this.endTime = dateStrings[0] + }, + getDeviceRows(val) { + this.form.setFieldsValue({ + equipmentId: val.equipmentId, + equipmentName: val.equipmentName + // // equipmentModel: val.equipmentModel, + // // equipmentIp: val.equipmentIp, + // // dataPort: val.dataPort, + // // driveType: val.driveType + }) + // var equipmentIds; + // for(var i = 0;i<val.length;i++){ + // if (i == 0) { + // equipmentIds = val[i].equipmentId; + // } else { + // equipmentIds = equipmentIds + "," + val[i].equipmentId; + // } + // } + // console.log("========",equipmentIds); + // this.form.setFieldsValue({ + // equipmentId: equipmentIds, + // }) + }, + deviceSearch() { + this.$refs.deviceRepairListModel.openPage() + this.$refs.deviceRepairListModel.title = '閫夋嫨璁惧' + this.$refs.deviceRepairListModel.disableSubmit = false + }, + //绾ц仈妗唎nChange浜嬩欢 + // onChange(value) { + // + // }, + getParentIdsById(id) { + let that = this + getAction(this.url.getParentIdsById, { + id: id + }).then((res) => { + if (res.success) { + that.form.setFieldsValue({ + partCategoryId: res.result + }) + } + }) + }, + add(node) { + let _this = this + this.visible = true + this.form.resetFields() + this.model = {} + this.$nextTick(() => { + // _this.form.setFieldsValue({ 'tierType': node.entity.tierType + 1, 'parentName': node.title }) + // _this.model.parentId = node.key + }) + }, + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + this.editStart = (this.model.startTime).replace(/:/g, '') + this.visible = true + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'tierType', 'parentName', 'equipmentId', 'equipmentName', 'startTime', 'endTime' + )) + }) + }, + close() { + this.$emit('close') + this.visible = false + this.show = false + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + let start = moment(formData.startTime).format('YYYY-MM-DD HH:mm:ss') + let end = moment(formData.endTime).format('YYYY-MM-DD HH:mm:ss') + let startOne = start.replace(/:/g, '') + let endOne = end.replace(/:/g, '') + var data = new Date() + let stertDate = moment(data).format('YYYY-MM-DD HH:mm:ss') + let dataStart = stertDate.replace(/:/g, '') + // if (this.editStart != startOne) { + // if (startOne < dataStart) { + // // that.$message.warning("寮�濮嬫椂闂翠笉鑳藉皬浜庡綋鍓嶆椂闂�") + // that.$notification.warning({ + // message: '娑堟伅', + // description: '寮�濮嬫椂闂翠笉鑳藉皬浜庡綋鍓嶆椂闂�' + // }) + // that.confirmLoading = false + // } else { + // if (startOne >= endOne) { + // // that.$message.warning("缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�"); + // that.$notification.warning({ + // message: '娑堟伅', + // description: '缁撴潫鏃堕棿涓嶈兘灏忎簬褰撳墠鏃堕棿' + // }) + // // console.log(this.model) + // // this.endTime = '' + // that.confirmLoading = false + // + // } else { + // let obj + // if (!this.model.id) { + // obj = postAction(this.url.add, formData) + // } else { + // + // obj = requestPut(this.url.edit, formData, { + // id: this.model.id + // }) + // let shijian = startOne + // } + // obj.then((res) => { + // if (res.success) { + // // that.$message.success("淇敼鎴愬姛") + // // that.$message.success(res.message) + // that.$notification.success({ + // message: '娑堟伅', + // description: res.message + // }) + // that.$emit('ok', res.result) + // } else { + // // that.$message.warning(res.message) + // that.$notification.warning({ + // message: '娑堟伅', + // description: res.message + // }) + // } + // }).finally(() => { + // that.confirmLoading = false + // that.close() + // }) + // } + // } + // } else { + // if (startOne >= endOne) { + // // that.$message.warning("缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�"); + // that.$notification.warning({ + // message: '娑堟伅', + // description: '缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�' + // }) + // // console.log(this.model) + // // this.endTime = '' + // that.confirmLoading = false + // + // } else { + // let obj + // if (!this.model.id) { + // obj = postAction(this.url.add, formData) + // } else { + // + // obj = requestPut(this.url.edit, formData, { + // id: this.model.id + // }) + // let shijian = startOne + // } + // obj.then((res) => { + // if (res.success) { + // // that.$message.success("淇敼鎴愬姛") + // // that.$message.success(res.message) + // that.$notification.success({ + // message: '娑堟伅', + // description: res.message + // }) + // that.$emit('ok', res.result) + // } else { + // // that.$message.warning(res.message) + // that.$notification.warning({ + // message: '娑堟伅', + // description: res.message + // }) + // } + // }).finally(() => { + // that.confirmLoading = false + // that.close() + // }) + // } + // } + if (startOne >= endOne) { + // that.$message.warning("缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�"); + that.$notification.warning({ + message: '娑堟伅', + description: '缁撴潫鏃堕棿涓嶈兘灏忎簬寮�濮嬫椂闂�' + }) + // console.log(this.model) + // this.endTime = '' + that.confirmLoading = false + } else { + let obj + if (!this.model.id) { + obj = postAction(this.url.add, formData) + } else { + obj = requestPut(this.url.edit, formData, { + id: this.model.id + }) + } + obj.then((res) => { + if (res.success) { + // that.$message.success("娣诲姞鎴愬姛") + that.$notification.success({ + message: '娑堟伅', + description: '淇敼鎴愬姛' + }) + // that.$message.success(res.message) + that.$emit('ok', res.result) + } else { + // that.$message.warning(res.message) + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } + } + }) + }, + handleCancel() { + this.close() + }, + loadCascade() { + getAction(this.url.loadCascadeData).then((res) => { + if (res.success) { + this.partCategoryCascade = res.result + } + }) + }, + onCascadeChange(value, selectedOptions) { + this.cascadeDefaultValue = [...value] + }, + filter(inputValue, path) { + return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) + }, + //楠岃瘉 缂栫爜 + validateNum(rule, value, callback) { + var params = { + tableName: 'lxmes_base_part', + fieldName: 'num', + fieldVal: value, + dataId: this.model.id, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true' + } + duplicateCheck(params).then((res) => { + if (res.success) { + callback() + } else { + callback('瀛樿揣缂栫爜宸插瓨鍦�!') + } + }) + }, + checkboxChange(e) { + this.checked = e.target.checked + }, + range(start, end) { + const result = [] + for (let i = start; i < end; i++) { + result.push(i) + } + return result + }, + /** + * 绂佺敤鏃ユ湡閫夋嫨鍣ㄤ腑鐨勬椂闂撮�夋嫨 + * @returns {{disabledSeconds: (function(): number[])}} 杩斿洖鍊间负涓�涓璞★紝鍙互绂佹灏忔椂銆佸垎閽熴�佺锛岀洰鍓嶄粎绂佹鎵�鏈夌鏁�,鏈�浣庝粠1寮�濮嬶紝浠�0寮�濮嬬‘瀹氭寜閽皢琚鐢� + */ + disabledDateTime() { + return { + disabledSeconds: () => this.range(1, 60) + } + } + } + } +</script> + +<style scoped> + .ant-btn { + padding: 0 10px; + margin-left: 3px; + } + + .ant-form-item-control { + line-height: 0px; + } + + /** 涓昏〃鍗曡闂磋窛 */ + .ant-form .ant-form-item { + margin-bottom: 10px; + } + + /** Tab椤甸潰琛岄棿璺� */ + .ant-tabs-content .ant-form-item { + margin-bottom: 0px; + } +</style> diff --git a/src/views/mdc/base/modules/deviceRepair/JDate.vue b/src/views/mdc/base/modules/deviceRepair/JDate.vue new file mode 100644 index 0000000..803ea19 --- /dev/null +++ b/src/views/mdc/base/modules/deviceRepair/JDate.vue @@ -0,0 +1,86 @@ +<template> + <a-date-picker + dropdownClassName="j-date-picker" + :disabled="disabled || readOnly" + :placeholder="placeholder" + @change="handleDateChange" + :value="momVal" + :showTime="showTime" + :format="dateFormat" + :getCalendarContainer="getCalendarContainer" + v-bind="$attrs"/> +</template> +<script> +import moment from 'moment' +export default { + name: 'JDate', + props: { + placeholder:{ + type: String, + default: '', + required: false + }, + value:{ + type: String, + required: false + }, + dateFormat:{ + type: String, + default: 'YYYY-MM-DD', + required: false + }, + //姝ゅ睘鎬у彲浠ヨ搴熷純浜� + triggerChange:{ + type: Boolean, + required: false, + default: false + }, + readOnly:{ + type: Boolean, + required: false, + default: false + }, + disabled:{ + type: Boolean, + required: false, + default: false + }, + showTime:{ + type: Object, + required: {}, + default: {} + }, + getCalendarContainer: { + type: Function, + default: (node) => node.parentNode + } + }, + data () { + let dateStr = this.value; + return { + decorator:"", + momVal:!dateStr?null:moment(dateStr,this.dateFormat) + } + }, + watch: { + value (val) { + if(!val){ + this.momVal = null + }else{ + this.momVal = moment(val,this.dateFormat) + } + } + }, + methods: { + moment, + handleDateChange(mom,dateStr){ + this.$emit('change', dateStr); + } + }, + //2.2鏂板 鍦ㄧ粍浠跺唴瀹氫箟 鎸囧畾鐖剁粍浠惰皟鐢ㄦ椂鍊欑殑浼犲�煎睘鎬у拰浜嬩欢绫诲瀷 杩欎釜鐗涢�� + model: { + prop: 'value', + event: 'change' + } +} +</script> diff --git a/src/views/mdc/base/modules/mdcUtilizationRate/MdcUtilizationRateModel.vue b/src/views/mdc/base/modules/mdcUtilizationRate/MdcUtilizationRateModel.vue new file mode 100644 index 0000000..a9059be --- /dev/null +++ b/src/views/mdc/base/modules/mdcUtilizationRate/MdcUtilizationRateModel.vue @@ -0,0 +1,204 @@ +<template> + <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="绫诲埆"> + <a-input :disabled="true" v-decorator="['rateParameterCategory', validatorRules.rateParameterCategory]"/> + </a-form-item> + </a-col> + <a-col :span="12"> + <a-form-item label="绛夌骇" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="true" v-decorator="['rateParameterLevel', validatorRules.rateParameterLevel]"/> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item label="鏈�灏忚寖鍥达紙鍗曚綅锛�%锛�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ユ渶灏忚寖鍥�" + v-decorator="['minimumRange',validatorRules.minimumRange]"/> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item label="鏈�澶ц寖鍥达紙鍗曚綅锛�%锛�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ユ渶澶ц寖鍥�" + v-decorator="['maximumRange',validatorRules.maximumRange]"/> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item label="棰滆壊" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input type="color" v-decorator="['rateParameterColor',validatorRules.rateParameterColor]"></a-input> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + </a-modal> +</template> + +<script> + import pick from 'lodash.pick' + import { + getAction, + postAction, + requestPut + } from '@/api/manage' + import { + duplicateCheck + } from '@/api/api' + + export default { + name: 'MdcUtilizationRateModel', + props: {}, + data() { + return { + title: '', + visible: false, + show: false, + model: {}, + checked: false, + labelCol: { + xs: { + span: 24 + }, + sm: { + span: 6 + } + }, + wrapperCol: { + xs: { + span: 24 + }, + sm: { + span: 18 + } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: {}, + url: { + edit: '/mdc/MdcUtilizationRate/editUtilization' + }, + disableSubmit: true + } + }, + created() { + }, + methods: { + //绾ц仈妗唎nChange浜嬩欢 + onChange(value) { + + }, + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'rateParameterCategory', 'rateParameterLevel', 'minimumRange', 'maximumRange', 'rateParameterColor')) + }) + }, + close() { + this.$emit('close') + this.visible = false + this.show = false + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + requestPut(this.url.edit, formData, { + id: this.model.id + }).then((res) => { + if (res.success) { + // that.$message.success("淇濆瓨鎴愬姛") + that.$notification.success({ + message: '娑堟伅', + description: '淇濆瓨鎴愬姛' + }) + that.$emit('ok', res.result) + } else { + // that.$message.warning(res.message) + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + loadCascade() { + getAction(this.url.loadCascadeData).then((res) => { + if (res.success) { + this.partCategoryCascade = res.result + } + }) + }, + onCascadeChange(value, selectedOptions) { + this.cascadeDefaultValue = [...value] + }, + filter(inputValue, path) { + return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) + }, + //楠岃瘉 缂栫爜 + validateNum(rule, value, callback) { + var params = { + tableName: 'lxmes_base_part', + fieldName: 'num', + fieldVal: value, + dataId: this.model.id, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true' + } + duplicateCheck(params).then((res) => { + if (res.success) { + callback() + } else { + callback('瀛樿揣缂栫爜宸插瓨鍦�!') + } + }) + }, + checkboxChange(e) { + this.checked = e.target.checked + } + } + } +</script> + +<style scoped> + .ant-btn { + padding: 0 10px; + margin-left: 3px; + } + + .ant-form-item-control { + line-height: 0px; + } + + /** 涓昏〃鍗曡闂磋窛 */ + .ant-form .ant-form-item { + margin-bottom: 10px; + } + + /** Tab椤甸潰琛岄棿璺� */ + .ant-tabs-content .ant-form-item { + margin-bottom: 0px; + } +</style> diff --git a/src/views/system/modules/UserModal.vue b/src/views/system/modules/UserModal.vue index cc451b0..0a8a3aa 100644 --- a/src/views/system/modules/UserModal.vue +++ b/src/views/system/modules/UserModal.vue @@ -150,66 +150,66 @@ ></j-select-production> </a-form-model-item> - <a-form-model-item - label="閫夋嫨璁惧" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - v-show="!productionDisabled" - > - <a-input-search :readOnly="true" v-model="model.equipmentIds" @search="deviceSearch" enter-button - placeholder="璇烽�夋嫨璁惧" :disabled="!model.selectedProduction"/> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="閫夋嫨璁惧"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--v-show="!productionDisabled"--> + <!-->--> + <!--<a-input-search :readOnly="true" v-model="model.equipmentIds" @search="deviceSearch" enter-button--> + <!--placeholder="璇烽�夋嫨璁惧" :disabled="!model.selectedProduction"/>--> + <!--</a-form-model-item>--> - <a-form-model-item label="棣栭〉鏉冮檺" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-radio-group v-model="model.userType" :defaultValue="0"> - <a-radio :value="4">鍏徃绾�</a-radio> - <a-radio :value="3">杞﹂棿绾�</a-radio> - <a-radio :value="2">宸ユ绾�</a-radio> - <a-radio :value="1">鎿嶄綔宸�</a-radio> - <a-radio :value="0">鏃�</a-radio> - </a-radio-group> - </a-form-model-item> + <!--<a-form-model-item label="棣栭〉鏉冮檺" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<a-radio-group v-model="model.userType" :defaultValue="0">--> + <!--<a-radio :value="4">鍏徃绾�</a-radio>--> + <!--<a-radio :value="3">杞﹂棿绾�</a-radio>--> + <!--<a-radio :value="2">宸ユ绾�</a-radio>--> + <!--<a-radio :value="1">鎿嶄綔宸�</a-radio>--> + <!--<a-radio :value="0">鏃�</a-radio>--> + <!--</a-radio-group>--> + <!--</a-form-model-item>--> - <a-form-model-item - label="鐝粍鍒嗛厤" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - prop="teamId" - > - <j-dict-select-tag - v-model="model.teamId" - :triggerChange="true" - dictCode="mom_base_team,name,id,del_flag = 0" - placeholder="璇风淮鎶ょ彮缁�" - ></j-dict-select-tag> - </a-form-model-item> - <a-form-model-item - label="涓績鍒嗛厤" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - prop="areaId" - > - <j-dict-select-tag - v-model="model.areaId" - :triggerChange="true" - dictCode="mom_base_area,name,id,del_flag = 0" - placeholder="璇风淮鎶や腑蹇�" - ></j-dict-select-tag> - </a-form-model-item> - <a-form-model-item - label="璐熻矗閮ㄩ棬" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - v-if="departIdShow==true" - > - <j-multi-select-tag - :disabled="disableSubmit" - v-model="model.departIds" - :options="nextDepartOptions" - placeholder="璇烽�夋嫨璐熻矗閮ㄩ棬" - > - </j-multi-select-tag> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="鐝粍鍒嗛厤"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--prop="teamId"--> + <!-->--> + <!--<j-dict-select-tag--> + <!--v-model="model.teamId"--> + <!--:triggerChange="true"--> + <!--dictCode="mom_base_team,name,id,del_flag = 0"--> + <!--placeholder="璇风淮鎶ょ彮缁�"--> + <!--></j-dict-select-tag>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item--> + <!--label="涓績鍒嗛厤"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--prop="areaId"--> + <!-->--> + <!--<j-dict-select-tag--> + <!--v-model="model.areaId"--> + <!--:triggerChange="true"--> + <!--dictCode="mom_base_area,name,id,del_flag = 0"--> + <!--placeholder="璇风淮鎶や腑蹇�"--> + <!--></j-dict-select-tag>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item--> + <!--label="璐熻矗閮ㄩ棬"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--v-if="departIdShow==true"--> + <!-->--> + <!--<j-multi-select-tag--> + <!--:disabled="disableSubmit"--> + <!--v-model="model.departIds"--> + <!--:options="nextDepartOptions"--> + <!--placeholder="璇烽�夋嫨璐熻矗閮ㄩ棬"--> + <!-->--> + <!--</j-multi-select-tag>--> + <!--</a-form-model-item>--> <!--<a-form-model-item--> <!--label="澶村儚"--> diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 6eb8ab0..670c46a 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -5,8 +5,8 @@ <div class="top"> <div class="header"> <a href="/"> - <img src="~@/assets/lxzn.png" class="logo" alt="logo"> - <span class="title">MDC鏅烘収杞﹂棿</span> + <img src="~@/assets/logo-yt.jpg" class="logo" alt="logo"> + <span class="title">涓浗涓�鎷栫鐞嗙郴缁�</span> </a> </div> </div> -- Gitblit v1.9.3