From 53eddb53e948a6de63ecb9e845440c89219b2390 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期三, 31 七月 2024 14:21:05 +0800 Subject: [PATCH] 1、新增设备类型管理、效率段管理、设备开动率等页面 2、修改项目名称和logo --- src/views/mdc/base/modules/deviceRepair/JDate.vue | 86 src/views/mdc/base/modules/deviceRepair/DeviceRepairModel.vue | 519 ++++ src/components/tools/UserMenu.vue | 45 src/views/mdc/base/MdcUtilizationRateList.vue | 209 + src/components/tools/Logo.vue | 6 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/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeForm.vue | 126 src/views/mdc/base/modules/deviceRepair/DeviceRepairEditListModel.vue | 238 + src/views/dashboard/Analysis.vue | 22 public/lxzn.png | 0 src/components/layouts/TabLayout.vue | 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 ++ src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue | 727 +++++ public/index.html | 8 src/assets/lxzn_white.png | 0 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 ++ /dev/null | 372 -- src/views/mdc/base/modules/EquipmentTypeList/MdcEquipmentTypeModal.Style#Drawer.vue | 84 src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue | 372 ++ src/views/mdc/base/EfficiencyPOReport.vue | 140 + src/views/mdc/base/MdcEquipmentTypeList.vue | 218 + 32 files changed, 7,285 insertions(+), 424 deletions(-) diff --git a/public/index.html b/public/index.html index a58c86b..918da5d 100644 --- a/public/index.html +++ b/public/index.html @@ -5,8 +5,8 @@ <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> - <link rel="icon" href="<%= BASE_URL %>logo.png"> + <title>MDC鏅烘収杞﹂棿</title> + <link rel="icon" href="<%= BASE_URL %>lzxn.png"> <script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script> <style> html, @@ -220,7 +220,7 @@ } /* 婊氬姩鏉′紭鍖� start */ ::-webkit-scrollbar{ - width:8px; + width:0; height:8px; } ::-webkit-scrollbar-track{ @@ -249,7 +249,7 @@ <div id="loader"></div> <div class="loader-section section-left"></div> <div class="loader-section section-right"></div> - <div class="load_title">姝e湪鍔犺浇 JeecgBoot 浣庝唬鐮佸钩鍙�,璇疯�愬績绛夊緟 + <div class="load_title">姝e湪鍔犺浇MDC鏅烘収杞﹂棿,璇疯�愬績绛夊緟 </div> </div> diff --git a/public/lxzn.png b/public/lxzn.png new file mode 100644 index 0000000..4631add --- /dev/null +++ b/public/lxzn.png Binary files differ diff --git a/src/assets/lxzn_white.png b/src/assets/lxzn_white.png new file mode 100644 index 0000000..b1a06bf --- /dev/null +++ b/src/assets/lxzn_white.png Binary files differ diff --git a/src/components/layouts/TabLayout.vue b/src/components/layouts/TabLayout.vue index 4249c19..b70473d 100644 --- a/src/components/layouts/TabLayout.vue +++ b/src/components/layouts/TabLayout.vue @@ -183,7 +183,7 @@ * @param title 瑕佷慨鏀圭殑鏂版爣棰� */ changeTitle(title) { - let projectTitle = "Jeecg-Boot 浼佷笟绾т綆浠g爜骞冲彴" + let projectTitle = "MDC鏅烘収杞﹂棿" // 棣栭〉鐗规畩澶勭悊 if (this.$route.path === indexKey) { document.title = projectTitle diff --git a/src/components/tools/Logo.vue b/src/components/tools/Logo.vue index 7808fba..08e69d6 100644 --- a/src/components/tools/Logo.vue +++ b/src/components/tools/Logo.vue @@ -3,8 +3,8 @@ <router-link :to="routerLinkTo"> <!-- 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-if="navTheme === 'dark'" src="~@/assets/lxzn_white.png" alt="logo"> + <img v-else src="~@/assets/lxzn.png" 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: 'MDC鏅烘収杞﹂棿', required: false }, showTitle: { diff --git a/src/components/tools/UserMenu.vue b/src/components/tools/UserMenu.vue index f8e3d4e..a2a5cc6 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> diff --git a/src/views/dashboard/Analysis.vue b/src/views/dashboard/Analysis.vue index 2e16b22..1503277 100644 --- a/src/views/dashboard/Analysis.vue +++ b/src/views/dashboard/Analysis.vue @@ -1,34 +1,18 @@ <template> <div> - <index-chart v-if="indexStyle==1"></index-chart> - <index-bdc v-if="indexStyle==2"></index-bdc> - <index-task v-if="indexStyle==3"></index-task> - <div style="width: 100%;text-align: right;margin-top: 20px"> - 璇烽�夋嫨棣栭〉鏍峰紡锛� - <a-radio-group v-model="indexStyle"> - <a-radio :value="1">缁熻鍥捐〃</a-radio> - <a-radio :value="2">缁熻鍥捐〃2</a-radio> - <a-radio :value="3">浠诲姟琛ㄦ牸</a-radio> - </a-radio-group> - </div> + </div> </template> <script> - import IndexChart from './IndexChart' - import IndexTask from "./IndexTask" - import IndexBdc from './IndexBdc' - export default { name: "Analysis", components: { - IndexChart, - IndexTask, - IndexBdc + }, data() { return { - indexStyle:1 + } }, created() { diff --git a/src/views/dashboard/IndexBdc.vue b/src/views/dashboard/IndexBdc.vue deleted file mode 100644 index fa8edea..0000000 --- a/src/views/dashboard/IndexBdc.vue +++ /dev/null @@ -1,519 +0,0 @@ -<template> - <div class="page-header-index-wide"> - <a-row :gutter="24"> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鍙楃悊閲�" :total="cardCount.sll | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-area :data-source="chartData.sll" /> - </div> - <template slot="footer">浠婃棩鍙楃悊閲忥細<span>{{ todaySll }}</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鍔炵粨閲�" :total="cardCount.bjl | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-area :data-source="chartData.bjl"/> - </div> - <template slot="footer">浠婃棩鍔炵粨閲忥細<span>{{ todayBjl }}</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鐢ㄦ埛鍙楃悊閲�" :total="cardCount.isll | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-bar :datasource="chartData.isll" :height="50"/> - </div> - <template slot="footer">鐢ㄦ埛浠婃棩鍙楃悊閲忥細<span>{{ todayISll }}</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鐢ㄦ埛鍔炵粨閲�" :total="cardCount.ibjl | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-bar :datasource="chartData.ibjl" :height="50"/> - </div> - <template slot="footer">鐢ㄦ埛浠婃棩鍔炵粨閲忥細<span>{{ todayIBjl }}</span></template> - </chart-card> - </a-col> - </a-row> - - <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}"> - <div class="salesCard"> - <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}"> - <div class="extra-wrapper" slot="tabBarExtraContent"> - <div class="extra-item"> - <a>浠婃棩</a> - <a>鏈懆</a> - <a>鏈湀</a> - <a>鏈勾</a> - </div> - <a-range-picker :style="{width: '256px'}" /> - </div> - - <a-tab-pane loading="true" tab="鍙楃悊鐩戠" key="1"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <index-bar title="鍙楃悊閲忕粺璁�" /> - </a-col> - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - - <a-card title="蹇�熷紑濮� / 渚挎嵎瀵艰埅" style="margin-bottom: 24px" :bordered="false" :body-style="{padding: 0}"> - <div class="item-group"> - <a-row> - <a-col :class="'more-btn'" :span="12" v-for="(item,index) in registerTypeList" :key=" 'registerType'+index "> - <a-button @click="goPage(index)" style="margin-bottom:10px" size="small" type="primary" ghost>{{ item.text }}</a-button> - </a-col> - </a-row> - </div> - </a-card> - - </a-col> - </a-row> - </a-tab-pane> - - <a-tab-pane tab="浜や簰鐩戠" key="2"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <bar-multid :sourceData="jhjgData" :fields="jhjgFields" title="骞冲彴涓庨儴闂ㄤ氦浜掗噺缁熻"></bar-multid> - </a-col> - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - - <a-card title="蹇�熷紑濮� / 渚挎嵎瀵艰埅" style="margin-bottom: 24px" :bordered="false" :body-style="{padding: 0}"> - <div class="item-group"> - <a-row> - <a-col :class="'more-btn'" :span="12" v-for="(item,index) in registerTypeList" :key=" 'registerType'+index "> - <a-button @click="goPage(index)" style="margin-bottom:10px" size="small" type="primary" ghost>{{ item.text }}</a-button> - </a-col> - </a-row> - </div> - </a-card> - - </a-col> - </a-row> - </a-tab-pane> - - <a-tab-pane tab="瀛樺偍鐩戠" key="4"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <a-row> - <template v-if="diskInfo && diskInfo.length>0"> - <a-col :span="12" v-for="(item,index) in diskInfo" :key=" 'diskInfo'+index "> - <dash-chart-demo :title="item.name" :datasource="item.restPPT"></dash-chart-demo> - </a-col> - </template> - </a-row> - </a-col> - - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - - <a-card title="蹇�熷紑濮� / 渚挎嵎瀵艰埅" style="margin-bottom: 24px" :bordered="false" :body-style="{padding: 0}"> - <div class="item-group"> - <a-row> - <a-col :class="'more-btn'" :span="10" v-for="(item,index) in registerTypeList" :key=" 'registerType'+index "> - <a-button @click="goPage(index)" style="margin-bottom:10px" size="small" type="primary" ghost>{{ item.text }}</a-button> - </a-col> - </a-row> - </div> - </a-card> - - </a-col> - </a-row> - </a-tab-pane> - - </a-tabs> - - </div> - </a-card> - - <a-row :gutter="12"> - <a-card :loading="loading" :class="{ 'anty-list-cust':true }" :bordered="false" :style="{ marginTop: '24px' }"> - - <a-tabs v-model="indexBottomTab" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}"> - <div class="extra-wrapper" slot="tabBarExtraContent"> - <a-radio-group v-model="indexRegisterType" @change="changeRegisterType"> - <a-radio-button value="杞Щ鐧昏">杞Щ鐧昏</a-radio-button> - <a-radio-button value="鎶垫娂鐧昏">鎶垫娂鐧昏</a-radio-button> - <a-radio-button value="">鎵�鏈�</a-radio-button> - </a-radio-group> - </div> - - <a-tab-pane loading="true" tab="涓氬姟娴佺▼闄愭椂鐩戠" key="1"> - - <a-table :dataSource="dataSource1" size="default" rowKey="id" :columns="columns" :pagination="ipagination1" @change="tableChange1"> - <template slot="flowRate" slot-scope="text, record, index"> - <a-progress :strokeColor="getPercentColor(record.flowRate)" :format="getPercentFormat" :percent="getFlowRateNumber(record.flowRate)" style="width:80px" /> - </template> - </a-table> - </a-tab-pane> - - <a-tab-pane loading="true" tab="涓氬姟鑺傜偣闄愭椂鐩戠" key="2"> - <a-table :dataSource="dataSource2" size="default" rowKey="id" :columns="columns2" :pagination="ipagination2" @change="tableChange2"> - <template slot="flowRate" slot-scope="text, record, index"> - <span style="color: red;">{{ record.flowRate }}灏忔椂</span> - </template> - </a-table> - </a-tab-pane> - - </a-tabs> - - - </a-card> - </a-row> - - </div> -</template> - -<script> - - import ACol from "ant-design-vue/es/grid/Col" - import ATooltip from "ant-design-vue/es/tooltip/Tooltip" - import ChartCard from '@/components/ChartCard' - import MiniBar from '@/components/chart/MiniBar' - import MiniArea from '@/components/chart/MiniArea' - import IndexBar from '@/components/chart/IndexBar' - import BarMultid from '@/components/chart/BarMultid' - import DashChartDemo from '@/components/chart/DashChartDemo' - - const jhjgData = [ - { type: '鎴跨', '1鏈�': 900, '2鏈�': 1120, '3鏈�': 1380, '4鏈�': 1480, '5鏈�': 1450, '6鏈�': 1100, '7鏈�':1300, '8鏈�':900,'9鏈�':1000 ,'10鏈�':1200 ,'11鏈�':600 ,'12鏈�':900 }, - { type: '绋庡姟', '1鏈�':1200, '2鏈�': 1500, '3鏈�': 1980, '4鏈�': 2000, '5鏈�': 1000, '6鏈�': 600, '7鏈�':900, '8鏈�':1100,'9鏈�':1300 ,'10鏈�':2000 ,'11鏈�':900 ,'12鏈�':1100 }, - { type: '涓嶅姩浜�', '1鏈�':2000, '2鏈�': 1430, '3鏈�': 1300, '4鏈�': 1400, '5鏈�': 900, '6鏈�': 500, '7鏈�':600, '8鏈�':1000,'9鏈�':600 ,'10鏈�':1000 ,'11鏈�':1500 ,'12鏈�':1200 } - ] - - const jhjgFields=[ - '1鏈�','2鏈�','3鏈�','4鏈�','5鏈�','6鏈�', - '7鏈�','8鏈�','9鏈�','10鏈�','11鏈�','12鏈�' - ] - - const xljgData = [ - {type:'涓�鏈�',"鎴跨":1.12,"绋庡姟":1.55,"涓嶅姩浜�":1.2}, - {type:'浜屾湀',"鎴跨":1.65,"绋庡姟":1.32,"涓嶅姩浜�":1.42}, - {type:'涓夋湀',"鎴跨":1.85,"绋庡姟":1.1,"涓嶅姩浜�":1.5}, - - {type:'鍥涙湀',"鎴跨":1.33,"绋庡姟":1.63,"涓嶅姩浜�":1.4}, - {type:'浜旀湀',"鎴跨":1.63,"绋庡姟":1.8,"涓嶅姩浜�":1.7}, - {type:'鍏湀',"鎴跨":1.85,"绋庡姟":1.98,"涓嶅姩浜�":1.8}, - - {type:'涓冩湀',"鎴跨":1.98,"绋庡姟":1.5,"涓嶅姩浜�":1.76}, - {type:'鍏湀',"鎴跨":1.48,"绋庡姟":1.2,"涓嶅姩浜�":1.3}, - {type:'涔濇湀',"鎴跨":1.41,"绋庡姟":1.9,"涓嶅姩浜�":1.6}, - - {type:'鍗佹湀',"鎴跨":1.1,"绋庡姟":1.1,"涓嶅姩浜�":1.4}, - {type:'鍗佷竴鏈�',"鎴跨":1.85,"绋庡姟":1.6,"涓嶅姩浜�":1.5}, - {type:'鍗佷簩鏈�',"鎴跨":1.5,"绋庡姟":1.4,"涓嶅姩浜�":1.3} - ] - const xljgFields=["鎴跨","绋庡姟","涓嶅姩浜�"] - - const dataCol1 = [{ - title: '涓氬姟鍙�', - align:"center", - dataIndex: 'reBizCode' - },{ - title: '涓氬姟绫诲瀷', - align:"center", - dataIndex: 'type' - },{ - title: '鍙楃悊浜�', - align:"center", - dataIndex: 'acceptBy' - },{ - title: '鍙楃悊鏃堕棿', - align:"center", - dataIndex: 'acceptDate' - },{ - title: '褰撳墠鑺傜偣', - align:"center", - dataIndex: 'curNode' - },{ - title: '鍔炵悊鏃堕暱', - align:"center", - dataIndex: 'flowRate', - scopedSlots: { customRender: 'flowRate' } - }]; - const dataSource1=[ - {reBizCode:"1",type:"杞Щ鐧昏",acceptBy:'寮犱笁',acceptDate:"2019-01-22",curNode:"浠诲姟鍒嗘淳",flowRate:60}, - {reBizCode:"2",type:"鎶垫娂鐧昏",acceptBy:'鏉庡洓',acceptDate:"2019-01-23",curNode:"棰嗗瀹℃牳",flowRate:30}, - {reBizCode:"3",type:"杞Щ鐧昏",acceptBy:'鐜嬫',acceptDate:"2019-01-25",curNode:"浠诲姟澶勭悊",flowRate:20}, - {reBizCode:"4",type:"杞Щ鐧昏",acceptBy:'璧垫ゼ',acceptDate:"2019-11-22",curNode:"閮ㄩ棬瀹℃牳",flowRate:80}, - {reBizCode:"5",type:"杞Щ鐧昏",acceptBy:'閽卞氨',acceptDate:"2019-12-12",curNode:"浠诲姟鍒嗘淳",flowRate:90}, - {reBizCode:"6",type:"杞Щ鐧昏",acceptBy:'瀛欏惂',acceptDate:"2019-03-06",curNode:"浠诲姟澶勭悊",flowRate:10}, - {reBizCode:"7",type:"鎶垫娂鐧昏",acceptBy:'鍛ㄥぇ',acceptDate:"2019-04-13",curNode:"浠诲姟鍒嗘淳",flowRate:100}, - {reBizCode:"8",type:"鎶垫娂鐧昏",acceptBy:'鍚翠簩',acceptDate:"2019-05-09",curNode:"浠诲姟涓婃姤",flowRate:50}, - {reBizCode:"9",type:"鎶垫娂鐧昏",acceptBy:'閮戠埥',acceptDate:"2019-07-12",curNode:"浠诲姟澶勭悊",flowRate:63}, - {reBizCode:"20",type:"鎶垫娂鐧昏",acceptBy:'鏋楁湁',acceptDate:"2019-12-12",curNode:"浠诲姟鎵撳洖",flowRate:59}, - {reBizCode:"11",type:"杞Щ鐧昏",acceptBy:'鐮佷簯',acceptDate:"2019-09-10",curNode:"浠诲姟绛炬敹",flowRate:87}, - ] - - const dataCol2 = [{ - title: '涓氬姟鍙�', - align:"center", - dataIndex: 'reBizCode' - },{ - title: '鍙楃悊浜�', - align:"center", - dataIndex: 'acceptBy' - },{ - title: '鍙戣捣鏃堕棿', - align:"center", - dataIndex: 'acceptDate' - },{ - title: '褰撳墠鑺傜偣', - align:"center", - dataIndex: 'curNode' - },{ - title: '瓒呮椂鏃堕棿', - align:"center", - dataIndex: 'flowRate', - scopedSlots: { customRender: 'flowRate' } - }]; - const dataSource2=[ - {reBizCode:"A001",type:"杞Щ鐧昏",acceptBy:'寮犲洓',acceptDate:"2019-01-22",curNode:"浠诲姟鍒嗘淳",flowRate:12}, - {reBizCode:"A002",type:"鎶垫娂鐧昏",acceptBy:'鏉庡惂',acceptDate:"2019-01-23",curNode:"浠诲姟绛炬敹",flowRate:3}, - {reBizCode:"A003",type:"杞Щ鐧昏",acceptBy:'鐜嬩笁',acceptDate:"2019-01-25",curNode:"浠诲姟澶勭悊",flowRate:24}, - {reBizCode:"A004",type:"杞Щ鐧昏",acceptBy:'璧典簩',acceptDate:"2019-11-22",curNode:"閮ㄩ棬瀹℃牳",flowRate:10}, - {reBizCode:"A005",type:"杞Щ鐧昏",acceptBy:'閽卞ぇ',acceptDate:"2019-12-12",curNode:"浠诲姟绛炬敹",flowRate:8}, - {reBizCode:"A006",type:"杞Щ鐧昏",acceptBy:'瀛欏氨',acceptDate:"2019-03-06",curNode:"浠诲姟澶勭悊",flowRate:10}, - {reBizCode:"A007",type:"鎶垫娂鐧昏",acceptBy:'鍛ㄦ檿',acceptDate:"2019-04-13",curNode:"閮ㄩ棬瀹℃牳",flowRate:24}, - {reBizCode:"A008",type:"鎶垫娂鐧昏",acceptBy:'鍚存湁',acceptDate:"2019-05-09",curNode:"閮ㄩ棬瀹℃牳",flowRate:30}, - {reBizCode:"A009",type:"鎶垫娂鐧昏",acceptBy:'閮戞',acceptDate:"2019-07-12",curNode:"浠诲姟鍒嗘淳",flowRate:1}, - {reBizCode:"A0010",type:"鎶垫娂鐧昏",acceptBy:'鏋楃埥',acceptDate:"2019-12-12",curNode:"閮ㄩ棬瀹℃牳",flowRate:16}, - {reBizCode:"A0011",type:"杞Щ鐧昏",acceptBy:'鐮佹ゼ',acceptDate:"2019-09-10",curNode:"閮ㄩ棬瀹℃牳",flowRate:7}, - ] - - export default { - name: "IndexBdc", - components: { - ATooltip, - ACol, - ChartCard, - MiniArea, - MiniBar, - DashChartDemo, - BarMultid, - IndexBar - }, - data() { - return { - loading: true, - cardCount:{ - sll:100, - bjl:87, - isll:15, - ibjl:9 - }, - - todaySll:60, - todayBjl:54, - todayISll:13, - todayIBjl:7, - - chartData:{ - sll:[], - bjl:[], - isll:[], - ibjl:[] - }, - jhjgFields, - jhjgData, - - xljgData, - xljgFields, - - diskInfo:[ - {name:"C鐩�",restPPT:7}, - {name:"D鐩�",restPPT:5} - ], - - registerTypeList:[{ - text:"涓氬姟鍙楃悊" - },{ - text:"涓氬姟绠$悊" - },{ - text:"鏂囦欢绠$悊" - },{ - text:"淇℃伅鏌ヨ" - }], - - dataSource1:[], - dataSource2:[], - columns:dataCol1, - columns2:dataCol2, - ipagination1:{ - current: 1, - pageSize: 5, - pageSizeOptions: ['10', '20', '30'], - showTotal: (total, range) => { - return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0, - - }, - ipagination2:{ - current: 1, - pageSize: 5, - pageSizeOptions: ['10', '20', '30'], - showTotal: (total, range) => { - return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0, - }, - indexRegisterType:"杞Щ鐧昏", - indexBottomTab:"1" - - } - }, - methods:{ - goPage(){ - this.$message.success("鏍规嵁涓氬姟鑷澶勭悊璺宠浆椤甸潰!") - }, - changeRegisterType(e){ - this.indexRegisterType = e.target.value - if(this.indexBottomTab=="1"){ - this.loadDataSource1() - }else{ - this.loadDataSource2() - } - }, - tableChange1(pagination){ - this.ipagination1.current = pagination.current - this.ipagination1.pageSize = pagination.pageSize - this.queryTimeoutInfo() - }, - tableChange2(pagination){ - this.ipagination2.current = pagination.current - this.ipagination2.pageSize = pagination.pageSize - this.queryNodeTimeoutInfo() - }, - getFlowRateNumber(value){ - return Number(value) - }, - getPercentFormat(value){ - if(value==100){ - return "瓒呮椂" - }else{ - return value+"%" - } - }, - getPercentColor(value){ - let p = Number(value) - if(p>=90 && p<100){ - return 'rgb(244, 240, 89)' - }else if(p>=100){ - return 'red' - }else{ - return 'rgb(16, 142, 233)' - } - }, - - loadDataSource1(){ - this.dataSource1 = dataSource1.filter(item=>{ - if(!this.indexRegisterType){ - return true - } - return item.type==this.indexRegisterType - }) - }, - loadDataSource2(){ - this.dataSource2 = dataSource2.filter(item=>{ - if(!this.indexRegisterType){ - return true - } - return item.type==this.indexRegisterType - }) - } - }, - created() { - this.loadDataSource1() - this.loadDataSource2() - setTimeout(() => { - this.loading = !this.loading - }, 1000) - } - } -</script> - -<style lang="less" scoped> - .extra-wrapper { - line-height: 55px; - padding-right: 24px; - - .extra-item { - display: inline-block; - margin-right: 24px; - - a { - margin-left: 24px; - } - } - } - - .item-group { - padding: 20px 0 8px 24px; - font-size: 0; - a { - color: rgba(0, 0, 0, 0.65); - display: inline-block; - font-size: 14px; - margin-bottom: 13px; - width: 25%; - } - } - - .item-group { - .more-btn { - margin-bottom: 13px; - text-align: center; - } - } - - .list-content-item { - color: rgba(0, 0, 0, .45); - display: inline-block; - vertical-align: middle; - font-size: 14px; - margin-left: 40px; - } - - @media only screen and (min-width: 1600px) { - .list-content-item{ - margin-left:60px; - } - } - - @media only screen and (max-width: 1300px) { - .list-content-item{ - margin-left:20px; - } - .width-hidden4{ - display:none - } - } - .list-content-item{ - span{line-height: 20px;} - } - .list-content-item{ - p{margin-top: 4px;margin-bottom:0;line-height:22px;} - } - .anty-list-cust { - .ant-list-item-meta{flex: 0.3 !important;} - } - .anty-list-cust { - .ant-list-item-content{flex:1 !important; justify-content:flex-start !important;margin-left: 20px;} - } - - -</style> \ No newline at end of file diff --git a/src/views/dashboard/IndexChart.vue b/src/views/dashboard/IndexChart.vue deleted file mode 100644 index 60ac1f5..0000000 --- a/src/views/dashboard/IndexChart.vue +++ /dev/null @@ -1,268 +0,0 @@ -<template> - <div class="page-header-index-wide"> - <a-row :gutter="24"> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鎬婚攢鍞" total="锟�126,560"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <trend flag="up" style="margin-right: 16px;"> - <span slot="term">鍛ㄥ悓姣�</span> - 12% - </trend> - <trend flag="down"> - <span slot="term">鏃ュ悓姣�</span> - 11% - </trend> - </div> - <template slot="footer">鏃ュ潎閿�鍞<span>锟� 234.56</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="璁㈠崟閲�" :total="8846 | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-area /> - </div> - <template slot="footer">鏃ヨ鍗曢噺<span> {{ '1234' | NumberFormat }}</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鏀粯绗旀暟" :total="6560 | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-bar :height="40" /> - </div> - <template slot="footer">杞寲鐜� <span>60%</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="杩愯惀娲诲姩鏁堟灉" total="78%"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-progress color="rgb(19, 194, 194)" :target="80" :percentage="78" :height="8" /> - </div> - <template slot="footer"> - <trend flag="down" style="margin-right: 16px;"> - <span slot="term">鍚屽懆姣�</span> - 12% - </trend> - <trend flag="up"> - <span slot="term">鏃ョ幆姣�</span> - 80% - </trend> - </template> - </chart-card> - </a-col> - </a-row> - - <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}"> - <div class="salesCard"> - <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}"> - <div class="extra-wrapper" slot="tabBarExtraContent"> - <div class="extra-item"> - <a>浠婃棩</a> - <a>鏈懆</a> - <a>鏈湀</a> - <a>鏈勾</a> - </div> - <a-range-picker :style="{width: '256px'}" /> - </div> - <a-tab-pane loading="true" tab="閿�鍞" key="1"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <bar title="閿�鍞鎺掕" :dataSource="barData"/> - </a-col> - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - <rank-list title="闂ㄥ簵閿�鍞帓琛屾" :list="rankList"/> - </a-col> - </a-row> - </a-tab-pane> - <a-tab-pane tab="閿�鍞秼鍔�" key="2"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <bar title="閿�鍞瓒嬪娍" :dataSource="barData"/> - </a-col> - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - <rank-list title="闂ㄥ簵閿�鍞帓琛屾" :list="rankList"/> - </a-col> - </a-row> - </a-tab-pane> - </a-tabs> - </div> - </a-card> - - <a-row> - <a-col :span="24"> - <a-card :loading="loading" :bordered="false" title="鏈�杩戜竴鍛ㄨ闂噺缁熻" :style="{ marginTop: '24px' }"> - <a-row> - <a-col :span="6"> - <head-info title="浠婃棩IP" :content="loginfo.todayIp"></head-info> - </a-col> - <a-col :span="2"> - <a-spin class='circle-cust'> - <a-icon slot="indicator" type="environment" style="font-size: 24px" /> - </a-spin> - </a-col> - <a-col :span="6"> - <head-info title="浠婃棩璁块棶" :content="loginfo.todayVisitCount"></head-info> - </a-col> - <a-col :span="2"> - <a-spin class='circle-cust'> - <a-icon slot="indicator" type="team" style="font-size: 24px" /> - </a-spin> - </a-col> - <a-col :span="6"> - <head-info title="鎬昏闂噺" :content="loginfo.totalVisitCount"></head-info> - </a-col> - <a-col :span="2"> - <a-spin class='circle-cust'> - <a-icon slot="indicator" type="rise" style="font-size: 24px" /> - </a-spin> - </a-col> - </a-row> - <line-chart-multid :fields="visitFields" :dataSource="visitInfo"></line-chart-multid> - </a-card> - </a-col> - </a-row> - </div> -</template> - -<script> - import ChartCard from '@/components/ChartCard' - import ACol from "ant-design-vue/es/grid/Col" - import ATooltip from "ant-design-vue/es/tooltip/Tooltip" - import MiniArea from '@/components/chart/MiniArea' - import MiniBar from '@/components/chart/MiniBar' - import MiniProgress from '@/components/chart/MiniProgress' - import RankList from '@/components/chart/RankList' - import Bar from '@/components/chart/Bar' - import LineChartMultid from '@/components/chart/LineChartMultid' - import HeadInfo from '@/components/tools/HeadInfo.vue' - - import Trend from '@/components/Trend' - import { getLoginfo,getVisitInfo } from '@/api/api' - - const rankList = [] - for (let i = 0; i < 7; i++) { - rankList.push({ - name: '鐧介弓宀� ' + (i+1) + ' 鍙峰簵', - total: 1234.56 - i * 100 - }) - } - const barData = [] - for (let i = 0; i < 12; i += 1) { - barData.push({ - x: `${i + 1}鏈坄, - y: Math.floor(Math.random() * 1000) + 200 - }) - } - export default { - name: "IndexChart", - components: { - ATooltip, - ACol, - ChartCard, - MiniArea, - MiniBar, - MiniProgress, - RankList, - Bar, - Trend, - LineChartMultid, - HeadInfo - }, - data() { - return { - loading: true, - center: null, - rankList, - barData, - loginfo:{}, - visitFields:['ip','visit'], - visitInfo:[], - indicator: <a-icon type="loading" style="font-size: 24px" spin /> - } - }, - created() { - setTimeout(() => { - this.loading = !this.loading - }, 1000) - this.initLogInfo(); - }, - methods: { - initLogInfo () { - getLoginfo(null).then((res)=>{ - if(res.success){ - Object.keys(res.result).forEach(key=>{ - res.result[key] =res.result[key]+"" - }) - this.loginfo = res.result; - } - }) - getVisitInfo().then(res=>{ - if(res.success){ - this.visitInfo = res.result; - } - }) - }, - } - } -</script> - -<style lang="less" scoped> - .circle-cust{ - position: relative; - top: 28px; - left: -100%; - } - .extra-wrapper { - line-height: 55px; - padding-right: 24px; - - .extra-item { - display: inline-block; - margin-right: 24px; - - a { - margin-left: 24px; - } - } - } - - /* 棣栭〉璁块棶閲忕粺璁� */ - .head-info { - position: relative; - text-align: left; - padding: 0 32px 0 0; - min-width: 125px; - - &.center { - text-align: center; - padding: 0 32px; - } - - span { - color: rgba(0, 0, 0, .45); - display: inline-block; - font-size: .95rem; - line-height: 42px; - margin-bottom: 4px; - } - p { - line-height: 42px; - margin: 0; - a { - font-weight: 600; - font-size: 1rem; - } - } - } -</style> \ No newline at end of file diff --git a/src/views/dashboard/IndexTask.vue b/src/views/dashboard/IndexTask.vue deleted file mode 100644 index 8e9d84b..0000000 --- a/src/views/dashboard/IndexTask.vue +++ /dev/null @@ -1,372 +0,0 @@ -<template> - <div class="index-container-ty"> - <a-spin :spinning="loading"> - <a-row type="flex" justify="start" :gutter="3"> - <a-col :sm="24" :lg="12"> - <a-card> - <div slot="title" class="index-md-title"> - <img src="../../assets/daiban.png"/> - 鎴戠殑寰呭姙銆恵{ dataSource1.length }}銆� - </div> - <div slot="extra"> - <a v-if="dataSource1 && dataSource1.length>0" slot="footer" @click="goPage">鏇村 <a-icon type="double-right" /></a> - </div> - <a-table - :class="'my-index-table tytable1'" - ref="table1" - size="small" - rowKey="id" - :columns="columns" - :dataSource="dataSource1" - :pagination="false"> - <template slot="ellipsisText" slot-scope="text"> - <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis> - </template> - - <template slot="dayWarnning" slot-scope="text,record"> - <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleData">鍔炵悊</a> - </span> - - </a-table> - </a-card> - </a-col> - - <a-col :sm="24" :lg="12"> - <a-card> - <div slot="title" class="index-md-title"> - <img src="../../assets/zaiban.png"/> - 鎴戠殑鍦ㄥ姙銆恵{ dataSource2.length }}銆� - </div> - <div slot="extra"> - <a v-if="dataSource2 && dataSource2.length>0" slot="footer" @click="goPage">鏇村 <a-icon type="double-right" /></a> - </div> - <a-table - :class="'my-index-table tytable2'" - ref="table2" - size="small" - rowKey="id" - :columns="columns" - :dataSource="dataSource2" - :pagination="false"> - <template slot="ellipsisText" slot-scope="text"> - <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis> - </template> - - <template slot="dayWarnning" slot-scope="text,record"> - <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleData">鍔炵悊</a> - </span> - - </a-table> - </a-card> - </a-col> - - <a-col :span="24"> - <div style="height: 5px;"></div> - </a-col> - - <a-col :sm="24" :lg="12"> - <a-card> - <div slot="title" class="index-md-title"> - <img src="../../assets/guaz.png"/> - 鎴戠殑鎸傝处銆恵{ dataSource4.length }}銆� - </div> - <a-table - :class="'my-index-table tytable4'" - ref="table4" - size="small" - rowKey="id" - :columns="columns" - :dataSource="dataSource4" - :pagination="false"> - <template slot="ellipsisText" slot-scope="text"> - <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis> - </template> - - <template slot="dayWarnning" slot-scope="text,record"> - <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleData">鍔炵悊</a> - </span> - - </a-table> - </a-card> - </a-col> - - <a-col :sm="24" :lg="12"> - <a-card> - <div slot="title" class="index-md-title"> - <img src="../../assets/duban.png"/> - 鎴戠殑鐫e姙銆恵{ dataSource3.length }}銆� - </div> - <a-table - :class="'my-index-table tytable3'" - ref="table3" - size="small" - rowKey="id" - :columns="columns" - :dataSource="dataSource3" - :pagination="false"> - <template slot="ellipsisText" slot-scope="text"> - <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis> - </template> - - <template slot="dayWarnning" slot-scope="text,record"> - <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleData">鍔炵悊</a> - </span> - - </a-table> - </a-card> - </a-col> - - </a-row> - </a-spin> - - </div> -</template> - -<script> - import noDataPng from '@/assets/nodata.png' - import JEllipsis from '@/components/jeecg/JEllipsis' - - const tempSs1=[{ - id:"001", - orderNo:"鐢礫1]1267102", - orderTitle:"鑽搧鍑洪棶棰樹簡", - restDay:1 - },{ - id:"002", - orderNo:"鐢礫4]5967102", - orderTitle:"鍚冧簡xxx鍖婚櫌鐨勮嵂锛岀梾鎯呰秺鏉ヨ秺涓ラ噸", - restDay:0 - },{ - id:"003", - orderNo:"鐢礫3]5988987", - orderTitle:"浠婂ぉ鍘昏秴甯備拱楦¤泲锛岄浮铔嬮兘鏄潖鐨�", - restDay:7 - },{ - id:"004", - orderNo:"鐢礫2]5213491", - orderTitle:"xx瀹濆疄浣撳簵楂樹环鍞崠xx", - restDay:5 - },{ - id:"005", - orderNo:"鐢礫1]1603491", - orderTitle:"浠ョ孩鍒╃浉璇憋紝绛斿簲閫�淇濆悗鎵d竴骞磋垂鐢�", - restDay:0 - }] - - const tempSs2=[{ - id:"001", - orderTitle:"鎴戣鎶曡瘔杩欎釜澶ц秴甯�", - orderNo:"鐢礫1]10299456", - restDay:6 - },{ - id:"002", - orderTitle:"xxx鍖婚櫌涔卞紑鑽柟,鍞崠鍋囪嵂", - orderNo:"鐢礫2]20235691", - restDay:0 - },{ - id:"003", - orderTitle:"鎴戞兂闂棶杩欏搴楁槸骞插暐鐨�", - orderNo:"鐢礫3]495867322", - restDay:7 - },{ - id:"004", - orderTitle:"鎴戣涓炬姤鏈濋槼鍖哄ゥ妫叕鍥厭搴�", - orderNo:"鐢礫2]1193849", - restDay:3 - },{ - id:"005", - orderTitle:"鎴戜粖澶╁悆楗悆鍒颁竴涓煶澶村瓙", - orderNo:"鐢礫4]56782344", - restDay:9 - }] - - //4-7澶� - const tip_green = "rgba(0, 255, 0, 1)" - //1-3澶� - const tip_yellow = "rgba(255, 255, 0, 1)" - //瓒呮湡 - const tip_red = "rgba(255, 0, 0, 1)" - - export default { - name: "IndexTask", - components:{ JEllipsis }, - data() { - return { - loading:false, - textMaxLength:8, - dataSource1:[], - dataSource2:[], - dataSource3:[], - dataSource4:[], - columns: [ - { - title: '', - dataIndex: '', - key:'rowIndex', - width:50, - fixed:'left', - align:"center", - scopedSlots: {customRender: "dayWarnning"} - }, - { - title:'鍓╀綑澶╂暟', - align:"center", - dataIndex: 'restDay', - width:80 - }, - { - title:'宸ュ崟鏍囬', - align:"center", - dataIndex: 'orderTitle', - scopedSlots: {customRender: "ellipsisText"} - }, - { - title:'宸ュ崟缂栧彿', - align:"center", - dataIndex: 'orderNo', - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - scopedSlots: { customRender: 'action' } - } - ] - - } - }, - created() { - this.mock(); - }, - mounted(){ - - }, - methods: { - getTipColor(rd){ - let num = rd.restDay - if(num<=0){ - return tip_red - }else if(num>=1 && num<4){ - return tip_yellow - }else if(num>=4){ - return tip_green - } - }, - goPage(){ - this.$message.success("璇锋牴鎹叿浣撲笟鍔¤烦杞〉闈�") - //this.$router.push({ path: '/comp/mytask' }) - }, - mock(){ - this.dataSource1=tempSs1 - this.dataSource2=tempSs2 - this.dataSource3=tempSs1 - this.dataSource4=[] - this.ifNullDataSource(this.dataSource4,'.tytable4') - }, - - ifNullDataSource(ds,tb){ - this.$nextTick(()=>{ - if(!ds || ds.length==0){ - var tmp = document.createElement('img'); - tmp.src=noDataPng - tmp.width=300 - let tbclass=`${tb} .ant-table-placeholder` - document.querySelector(tbclass).innerHTML="" - document.querySelector(tbclass).appendChild(tmp) - } - }) - }, - handleData(){ - this.$message.success("鍔炵悊瀹屾垚") - } - - - - - } - } -</script> - -<style> - .my-index-table{height:270px} - .my-index-table table{font-size: 14px !important;} - - .index-container-ty .ant-card-head-title{padding-top: 6px;padding-bottom: 6px;} - .index-container-ty .ant-card-extra{padding:0} - .index-container-ty .ant-card-extra a{color:#fff} - .index-container-ty .ant-card-extra a:hover{color:#152ede} - .index-container-ty .ant-card-head-wrapper,.index-container-ty .ant-card-head{ - line-height:24px; - min-height:24px; - /*background: #90aeff;*/ - background: #7196fb; - } - .index-container-ty .ant-card-body{padding: 10px 12px 0px 12px} - - /* .index-container-ty .ant-card-actions{background: #fff} - .index-container-ty .ant-card-actions li {margin:2px 0;} - .index-container-ty .ant-card-actions > li > span{width: 100%}*/ - - - .index-container-ty .ant-table-footer{text-align: right;padding:6px 12px 6px 6px;background: #fff;border-top: 2px solid #f7f1f1;} - - .index-md-title{ - postion:relative; - padding-left:24px; - width: 100%; - color: #fff; - font-size: 21px; - font-family: cursive; - } - .index-md-title img{ - position: absolute; - height:32px; - top: 2px; - left:14px; - } - - .index-container-ty .ant-card-body{ - /*border-left:1px solid #90aeff; - /*border-right:1px solid #90aeff; - border-bottom:1px solid #90aeff;*/ - } - - - .index-container-ty .ant-table-thead > tr > th, - .index-container-ty .ant-table-tbody > tr > td{ - border-bottom: 1px solid #90aeff; - } - - .index-container-ty .ant-table-small > .ant-table-content > .ant-table-fixed-left > .ant-table-body-outer > .ant-table-body-inner > table > .ant-table-thead > tr > th, - .index-container-ty .ant-table-small > .ant-table-content > .ant-table-fixed-right > .ant-table-body-outer > .ant-table-body-inner > table > .ant-table-thead > tr > th{ - border-bottom: 1px solid #90aeff; - } - - .index-container-ty .ant-table-small > .ant-table-content > .ant-table-scroll > .ant-table-body > table > .ant-table-thead > tr > th{ - border-bottom: 1px solid #90aeff; - } - - .index-container-ty .ant-table-small{ - border: 1px solid #90aeff; - } - - .index-container-ty .ant-table-placeholder { - padding: 0 - } -</style> \ No newline at end of file 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/EfficiencyPOReport.vue b/src/views/mdc/base/EfficiencyPOReport.vue new file mode 100644 index 0000000..b9749d0 --- /dev/null +++ b/src/views/mdc/base/EfficiencyPOReport.vue @@ -0,0 +1,140 @@ +<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"> + <efficiencyPO-list ref="EfficiencyPOList" :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 EfficiencyPOList from './modules/efficiencyPOReport/EfficiencyPOList' +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: 'EfficiencyPOReport', + components: { + JThirdAppButton, + JInput, + BaseTree, + JSuperQuery, + DepartTree, + EfficiencyPOList + }, + 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/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/efficiencyPOReport/EfficiencyPOList.vue b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue new file mode 100644 index 0000000..8253a9b --- /dev/null +++ b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue @@ -0,0 +1,727 @@ +<template> + <div style="width: 100%;"> + <div :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="5" :sm="5"> + <a-form-item label="璁惧绫诲瀷"> + <a-select + :value="queryParams.equipmentType" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'equipmentType')" + > + <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5"> + <a-form-item label="椹卞姩绫诲瀷"> + <a-select + :value="queryParams.driveType" + mode="multiple" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'driveType')" + > + <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :md="4" :sm="4"> + <a-form-item label="鏃堕棿"> + <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates" :allowClear="false"/> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="璁惧绾у埆"> + <a-select + :value="queryParams.deviceLevel" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绾у埆" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'deviceLevel')" + > + <a-select-option v-for="(item,index) in device_level_list" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :md="4" :sm="4" :xs="4"> + <a-form-item label="璁惧绉嶇被"> + <a-select + :value="queryParams.deviceCategory" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绉嶇被" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'deviceCategory')" + > + <a-select-option v-for="(item,index) in device_category_list" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24" type="flex" align="middle"> + <a-col :md="24" :sm="24" :xs="24" + style="display: flex;justify-content: space-between;align-items: flex-start"> + <div> + <a-space style="margin-right: 20px"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + <a-button type="primary" @click="exportExcel" icon="download">瀵煎嚭</a-button> + <a-button type="primary" icon="printer" v-print="'#EfficiencyPO'" + v-has="'EfficiencyPO:print'">鎵撳嵃 + </a-button> + </a-space> + <a-checkbox-group :value="checkedList" :default-value="['lyl']" :options="efficiencyOptions" + @change="efficiencyOptionsOnChange"/> + </div> + <table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;"> + <tr> + <td v-for="(item, index) in identifying">{{item.title}}</td> + </tr> + <tr> + <td style="text-align:center;" v-for="(item, index) in identifying"> + <div class="identifyingclass" :style="{background: item.color}"></div> + </td> + </tr> + </table> + </a-col> + </a-row> + </a-form> + </div> + <a-spin :spinning="spinning"> + <div class="container" id="EfficiencyPO" style="margin-top: 20px;" > + <div class="table2"> + <table class="dataContent table" border="1" cellspacing="0" cellpadding="0" style="white-space: nowrap" v-if="dataList.length>0"> + <thead> + <tr class="thead fixed equipname"> + <th class="thgu dong1 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;height: 66px">鍏徃</th> + <th class="thgu dong2 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;">杞﹂棿</th> + <th class="thgu dong3 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;">宸ユ</th> + <th class="thgu dong4 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧缂栧彿</th> + <th class="thgu dong5 name" rowspan="2" style="min-width: 162px; max-width: 162px;width: 162px;">璁惧鍚嶇О</th> + <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧绫诲瀷</th> + <!--<th rowspan="2">缁勫埆</th>--> + <template v-for="(tableHead, index) in tableHeads"> + <th class="timeth" :colspan="checkedList.length">{{tableHead}}</th> + </template> + </tr> + <tr class="thead notfixed gudingth"> + <template v-for="(tableHead, index) in tableHeads"> + <th v-if="checkedList.indexOf('lyl') > -1">寮�鍔ㄧ巼(%)</th> + <th v-if="checkedList.indexOf('kjl') > -1">寮�鏈虹巼(%)</th> + <th v-if="checkedList.indexOf('kjsj') > -1">寮�鏈烘椂闂�(灏忔椂)</th> + <th v-if="checkedList.indexOf('jgsj') > -1">鍔犲伐鏃堕棿(灏忔椂)</th> + <th v-if="checkedList.indexOf('djsj') > -1">寰呮満鏃堕棿(灏忔椂)</th> + <th v-if="checkedList.indexOf('gjsj') > -1">鍏虫満鏃堕棿(灏忔椂)</th> + </template> + </tr> + </thead> + <tbody> + <tr class="mathData" v-for="(item, index) in dataList"> + <template v-if="item.level1!=='鍚堣'&&item.level1!=='骞冲潎鍊�'"> + <td class="tdgu kaitou" :rowspan="item.level1span" :class="{hidden: item.level1dis,noExl:item.level1dis}" v-show="!item.level1dis"> + <div class="wenzi"> + {{item.level1}} + </div> + </td> + <td class="tdgu1 kaitou" :rowspan="item.level2span" :class="{hidden: item.level2dis,noExl:item.level2dis}" v-show="!item.level2dis"> + <div class="wenzi"> + {{item.level2}} + </div> + </td> + <td class="tdgu2 kaitou" :rowspan="item.level3span" :class="{hidden: item.level3dis,noExl:item.level3dis}" v-show="!item.level3dis"> + <div class="wenzi"> + {{item.level3}} + </div> + </td> + <td class="tdgu3 kaitou">{{item.equipmentId}}</td> + <td style="min-width: 162px; max-width: 162px;width: 162px;" class="tdgu4 kaitou">{{item.equipmentName}}</td> + <td class="tdgu5 kaitou">{{item.equipmentType}}</td> + </template> + + <template v-else> + <td colspan="6" class="tdgu kaitou">{{item.level1}}</td> + </template> + <template v-for="(tableHead, index) in item.dataList"> + <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('lyl') > -1">{{tableHead.startRate | numFilter}}</td> + <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('kjl') > -1"> + {{tableHead.openRate | numFilter}} + </td> + <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('kjsj') > -1"> + {{tableHead.openLong | getFormattedTime}} + </td> + <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('jgsj') > -1"> + {{tableHead.processLong | getFormattedTime}} + </td> + <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('djsj') > -1"> + {{tableHead.waitLong | getFormattedTime}} + </td> + <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('gjsj') > -1"> + {{tableHead.closeLong | getFormattedTime}} + </td> + </template> + </tr> + </tbody> + </table> + </div> + </div> + </a-spin> + </div> + </div> +</template> + +<script> +import moment from 'moment' +import { putAction, getAction } from '@/api/manage' +import $ from 'jquery' +import '@/components/table2excel/table2excel' +import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' +import api from '@/api/mdc' + +export default { + name: 'EfficiencyPOList', + components: {}, + data() { + return { + typeTree:"", + typeParent:1, + typeEquipment:1, + dates: [], + equipmentTypeList:[], + driveTypeList:[], + device_level_list: [], + device_category_list: [], + queryParam: {}, + queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [], + deviceCategory: [] + }, + queryParamEquip:{}, + queryParamPeople:{}, + identifying: [], + efficiencyOptions: [ + { label: '寮�鍔ㄧ巼', value: 'lyl' }, + { label: '寮�鏈虹巼', value: 'kjl' }, + { label: '寮�鏈烘椂闂�', value: 'kjsj' }, + { label: '鍔犲伐鏃堕棿', value: 'jgsj' }, + { label: '寰呮満鏃堕棿', value: 'djsj' }, + { label: '鍏虫満鏃堕棿', value: 'gjsj' } + ], + checkedList: ['lyl'], + dataList: [], + url: { + list: '/mdc/efficiencyReport/efficiencyPOList', + listByType: '/mdc/MdcUtilizationRate/getByType', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' + }, + tableHeads: [], + spinning:false + } + }, + props: { nodeTree: '', Type:'',nodePeople: ''}, + created() { + this.showIdentifying() + this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] + this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') + this.queryParam.typeTree = "1" + this.loadData() + this.queryGroup() + this.getDriveTypeByApi() + this.initDictData('device_level') + this.initDictData('device_category') + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + this.handleWindowResize() + }, + watch: { + Type(valmath){ + this.dataList = []; + this.queryParam.typeTree = valmath + }, + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + if (JSON.stringify(val) != '{}') { + if (val.equipmentId != null) { + this.queryParamEquip.parentId = '' + this.queryParamEquip.equipmentId = val.equipmentId + } else { + this.queryParamEquip.parentId = val.key + this.queryParamEquip.equipmentId = '' + } + this.searchQuery() + } + }, + nodePeople(val){ + if (JSON.stringify(val) != '{}') { + if (val.equipmentId != null) { + this.queryParamPeople.parentId = val.equipmentId + this.queryParamPeople.equipmentId = '' + } else { + this.queryParamPeople.parentId = val.key + this.queryParamPeople.equipmentId = '' + } + this.searchQuery() + } + } + }, + filters: { + numFilter(value) { + if (value) { + return parseFloat((value * 100).toFixed(2)) + } else { + return '0' + } + }, + + /** + * 鏍煎紡鍖栨椂闂� + * @param seconds 绉掓暟 + * @returns '' 鏍煎紡鍖栧悗鏃堕棿瀛楃涓� + */ + getFormattedTime(seconds) { + if (seconds) { + return parseFloat((seconds / 3600).toFixed(2)) + } else { + return '0' + } + }, + }, + methods: { + initDictData(dictCode) { + // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 + if (getDictItemsFromCache(dictCode)) { + this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + return + } + //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + this[dictCode + '_list'] = res.result + return + } + }) + }, + selectChange(value, key) { + this.queryParams[key] = value + }, + checkSameData(dataList){ + let cache = {}; //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 + let indices = []; //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� + dataList.map((item,index)=>{ + let level1 = item.level1; + let _index = cache[level1]; + if(_index!==undefined){ + indices[_index].push(index) + }else{ + cache[level1] = indices.length + indices.push([index]) + } + }) + let result = []; + indices.map((item)=>{ + item.map((index)=>{ + result.push(dataList[index]) + }) + }) + this.dataList = result + }, + checkSameData1(dataList){ + let cache = {}; //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 + let indices = []; //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� + dataList.map((item,index)=>{ + let level2 = item.level2; + let _index = cache[level2]; + if(_index!==undefined){ + indices[_index].push(index) + }else{ + cache[level2] = indices.length + indices.push([index]) + } + }) + let result = []; + indices.map((item)=>{ + item.map((index)=>{ + result.push(dataList[index]) + }) + }) + this.dataList = result + }, + checkSameData2(dataList){ + let cache = {}; //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 + let indices = []; //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� + dataList.map((item,index)=>{ + let level3 = item.level3; + let _index = cache[level3]; + if(_index!==undefined){ + indices[_index].push(index) + }else{ + cache[level3] = indices.length + indices.push([index]) + } + }) + let result = []; + indices.map((item)=>{ + item.map((index)=>{ + result.push(dataList[index]) + }) + }) + this.dataList = result + }, + // 鍚堝苟 + combineCell() { + console.log(this.dataList) + let list =this.dataList; + for (let field in list[0]) { + var k = 0; + while (k < list.length) { + list[k][field + 'span'] = 1; + list[k][field + 'dis'] = false; + for (var i = k + 1; i <= list.length - 1; i++) { + if (list[k][field] == list[i][field] && list[k][field] != '') { + list[k][field + 'span']++; + list[k][field + 'dis'] = false; + list[i][field + 'span'] = 1; + list[i][field + 'dis'] = true; + } else { + break; + } + } + k = i; + } + } + return list; + }, + disabledDate(current){ + //Can not slect days before today and today + return current && current > moment().subtract('days', 1); + }, + initDeviceType(deviceList) { + let dictCode = 'mdc_equipmentType' + let items = [] + items = getDictItemsFromCache(dictCode) + if (deviceList && items.length > 0) { + for (let a = 0; a < deviceList.length; a++) { + if (items && items.length > 0) { + for (let i = 0; i < items.length; i++) { + if (deviceList[a].equipmentType == items[i].value) { + deviceList[a].equipmentType = items[i].title + } + } + } else { + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + let items = res.result + for (let i = 0; i < items.length; i++) { + if (deviceList[a].equipmentType == items[i].value) { + deviceList[a].equipmentType = items[i].title + } + } + } + }) + } + } + } + }, + exportExcel() { + $("#EfficiencyPO").table2excel({ + exclude: ".noExl", + name: "Excel Document Name", + filename: "璁惧寮�鍔ㄧ巼", + exclude_img: true, + fileext: ".xls", + exclude_links: true, + exclude_inputs: true + }); + }, + showIdentifying() { + getAction(this.url.listByType, { type: 'kdl' }).then(res => { + if (res.success) { + this.identifying = res.result + } + }) + }, + dateParamChange(v1, v2) { + this.queryParam.startTime = v2[0] + this.queryParam.endTime = v2[1] + // 鐐瑰嚮鏃堕棿閫夋嫨鍣ㄧ殑娓呯┖鎸夐挳鏃朵細瑙﹀彂姝ゅ垽鏂�(鐐瑰嚮閲嶇疆鎸夐挳涓嶄細瑙﹀彂)锛屽疄鐜伴噸缃垪琛ㄥ姛鑳斤紝鍒囧疄鏀瑰彉鍒楄〃鏄剧ず鏁堟灉 + if(!this.queryParam.startTime&&!this.queryParam.endTime)this.searchReset() + }, + efficiencyOptionsOnChange(checkedList) { + // let index = checkedList.indexOf('lyl') + // if (index < 0) { + // // this.$message.warn('涓嶈兘鍙栨秷鏌ヨ鍒╃敤鐜�') + // this.$notification.warning({ + // message:'娑堟伅', + // description:"涓嶈兘鍙栨秷鏌ヨ鍒╃敤鐜�" + // }) + // return false + // } + this.checkedList = checkedList + }, + searchQuery() { + if(this.queryParam.typeTree == "1"){ + this.queryParam.parentId = this.queryParamEquip.parentId + this.queryParam.equipmentId = this.queryParamEquip.equipmentId + }else{ + this.queryParam.parentId = this.queryParamPeople.parentId + this.queryParam.equipmentId = "" + } + Object.keys(this.queryParams).forEach(item => { + this.queryParam[item] = this.queryParams[item].join() + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + if (this.queryParams[item].length === 0) delete this.queryParam[item] + }) + this.loadData() + }, + searchReset() { + this.typeTree = this.queryParam.typeTree + this.typeParent = this.queryParam.parentId + this.typeEquipment = this.queryParam.equipmentId + this.queryParam = {} + this.queryParam.typeTree = this.typeTree + this.queryParam.parentId = this.typeParent + this.queryParam.equipmentId = this.typeEquipment + this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] + this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') + // this.ipagination.current = 1 + this.queryParams = { + equipmentType: [], + driveType: [], + deviceLevel: [], + deviceCategory: [] + } + this.loadData(); + }, + loadData() { + this.spinning=true + this.tableHeads = [] + this.dataList = [] + getAction(this.url.list, this.queryParam).then(res => { + if (res.success) { + // console.log(res.result) + this.tableHeads = res.result.dates + this.dataList = res.result.mdcEfficiencyList + if (res.result.mdcEfficiencyList && !res.result.mdcEfficiencyList.length) { + this.$notification.info({ + message: '娑堟伅', + description: '鏆傛棤璇ヨ澶囩被鍨嬫暟鎹�' + }) + } + this.checkSameData(this.dataList) + this.checkSameData1(this.dataList) + this.checkSameData2(this.dataList) + this.combineCell(); + // this.initDeviceType(this.dataList) + } + }).finally(()=>{ + this.spinning=false + }) + }, + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName + } + }) + } else { + // this.$message.warning(res.message) + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + this.loading = false + }) + }, + + /** + * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + */ + getDriveTypeByApi(){ + api.getDriveTypeApi().then((res)=>{ + if (res.success) this.driveTypeList = res.result + }) + }, + + /** + * 鍒嗚鲸鐜囨敼鍙樻椂鍚屾椂鏀瑰彉琛ㄦ牸楂樺害宸蹭繚璇侀椤典竴杩涘叆涓嶆嫋鍔ㄥ瀭鐩存粴鍔ㄦ潯鏃跺嵆鍙嫋鍔ㄨ〃鏍兼按骞虫粴鍔ㄦ潯 + */ + handleWindowResize() { + const tableContainer = document.getElementById('EfficiencyPO') // 琛ㄦ牸瀹瑰櫒 + const clientHeight = document.documentElement.clientHeight || document.body.clientHeight // 娴忚鍣ㄥ彲瑙嗗尯鍩熼珮搴� + const containerTopToClientTopHeight = tableContainer.getBoundingClientRect().top // 琛ㄦ牸瀹瑰櫒椤堕儴鍒版祻瑙堝櫒鍙鍖哄煙椤堕儴鐨勯棿璺� + tableContainer.style.height = (clientHeight - containerTopToClientTopHeight - 32) + 'px' + } + } +} +</script> +<style scoped> +/*table鏍峰紡*/ +.table2{ + width: 100%; + height: 100%; + overflow: auto; +} + +.table2 thead tr th:first-child, +.table tbody tr .tdgu{ + position: sticky; + left: 0; + z-index: 1; +} + +.table tbody tr .wenzi{ + /*writing-mode: vertical-lr;*/ + /*text-orientation: upright;*/ + transform: rotate(360deg); + writing-mode: vertical-lr; + letter-spacing: 2px; +} + +.table tbody tr .kaitou{ + z-index: 1; + background-color: white; +} + +.table tbody tr .tdgu1{ + position: sticky; + left: 50px; + z-index: 2; +} + +.table tbody tr .tdgu2{ + position: sticky; + left: 100px; + z-index: 2; +} + +.table tbody tr .tdgu3{ + position: sticky; + left: 150px; + z-index: 2; +} + +.table tbody tr .tdgu4{ + position: sticky; + left: 250px; + z-index: 2; +} + +.table tbody tr .tdgu5{ + position: sticky; + left: 412px; + z-index: 2; +} + +.table2 thead tr .timeth, +.table2 thead tr .thgu { + position: sticky; + top:0; + z-index: 3; +} + +.table2 thead .gudingth th{ + position: sticky; + top: 32px; + z-index: 2; +} + +.table2 thead .equipname .name{ + z-index: 3; +} + +.table2 thead .equipname .dong1{ + z-index: 4; + left: 0; +} + +.table2 thead .equipname .dong2{ + z-index: 5; + left: 50px; +} + + +.table2 thead .equipname .dong3{ + z-index: 5; + left: 100px; +} + +.table2 thead .equipname .dong4{ + z-index: 5; + left: 150px; +} + +.table2 thead .equipname .dong5{ + z-index: 5; + left: 250px; +} + +.table2 thead .equipname .dong6{ + z-index: 5; + left: 412px; +} + +#EfficiencyPO{ + overflow: hidden; +} + +.identifyingclass { + width: 55px; + height: 15px; + display: inline-block +} + +.dataContent { + white-space: nowrap; + /*margin: 0;*/ + border-collapse: separate; + border-spacing: 0; + /*table-layout: fixed;*/ + border: 1px solid #ccc; + /*border: 1px solid #ccc;*/ + width: 100%; + /*height: 100%;*/ + /*overflow: hidden;*/ + /*overflow-y: auto;*/ + text-align: center; +} + +.dataContent .thead th { + background-color: #fafafa; + text-align: center; + height: 30px; + padding: 5px; +} + +.dataContent .notfixed th { + width: auto; +} + +.dataContent .mathData td { + padding: 10px; +} +</style> \ No newline at end of file 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> -- Gitblit v1.9.3