1、新增设备类型管理、效率段管理、设备开动率等页面
2、修改项目名称和logo
| | |
| | | <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 ä¼ä¸çº§ä½ä»£ç å¹³å°</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, |
| | |
| | | } |
| | | /* æ»å¨æ¡ä¼å start */ |
| | | ::-webkit-scrollbar{ |
| | | width:8px; |
| | | width:0; |
| | | height:8px; |
| | | } |
| | | ::-webkit-scrollbar-track{ |
| | |
| | | <div id="loader"></div> |
| | | <div class="loader-section section-left"></div> |
| | | <div class="loader-section section-right"></div> |
| | | <div class="load_title">æ£å¨å è½½ JeecgBoot ä½ä»£ç å¹³å°,请èå¿çå¾
|
| | | <div class="load_title">æ£å¨å è½½MDCæºæ
§è½¦é´,请èå¿çå¾
|
| | | |
| | | </div> |
| | | </div> |
| | |
| | | * @param title è¦ä¿®æ¹çæ°æ é¢ |
| | | */ |
| | | changeTitle(title) { |
| | | let projectTitle = "Jeecg-Boot ä¼ä¸çº§ä½ä»£ç å¹³å°" |
| | | let projectTitle = "MDCæºæ
§è½¦é´" |
| | | // é¦é¡µç¹æ®å¤ç |
| | | if (this.$route.path === indexKey) { |
| | | document.title = projectTitle |
| | |
| | | <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> |
| | |
| | | props: { |
| | | title: { |
| | | type: String, |
| | | default: 'Jeecg-Boot Pro', |
| | | default: 'MDCæºæ
§è½¦é´', |
| | | required: false |
| | | }, |
| | | showTitle: { |
| | |
| | | <!-- update-end author:sunjianlei date:20200219 for: èåæç´¢æ¹ä¸ºå¨æç»ä»¶ï¼å¨ææºç«¯åç°åºå¼¹åºæ¡ --> |
| | | <!-- update-end author:sunjianlei date:20191220 for: è§£å³å
¨å±æ ·å¼å²çªçé®é¢ --> |
| | | <!-- 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"> |
| | |
| | | <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> |
| | |
| | | <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() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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çwatchæ¹æ³') |
| | | // 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("请设置url.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); //éæ¾æblob对象 |
| | | } |
| | | }) |
| | | }, |
| | | loadData(arg) { |
| | | if(!this.url.list){ |
| | | this.$message.error("请设置url.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("请设置url.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("请设置url.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 |
| | | } |
| | | // /** |
| | | // * 车é´éä¸é¡¹åæ¶åè§¦åæ¤äºä»¶ï¼ç±BaseTreeç»ä»¶ç±äºä»¶æ»çº¿è§¦å |
| | | // * @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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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(',') : [] |
| | | }, |
| | | //çº§èæ¡onChangeäºä»¶ |
| | | // 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 |
| | | }, |
| | | //çº§èæ¡onChangeäºä»¶ |
| | | // 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <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("请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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("请设置url.list屿§!") |
| | | this.$notification.error({ |
| | | message:'æ¶æ¯', |
| | | description:"请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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("请设置url.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("请设置url.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("请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <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("请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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(',') : [] |
| | | }, |
| | | //çº§èæ¡onChangeäºä»¶ |
| | | // 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 |
| | | }, |
| | | //çº§èæ¡onChangeäºä»¶ |
| | | 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 |
| | | }, |
| | | //çº§èæ¡onChangeäºä»¶ |
| | | // 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 å¨indeces䏿°ç»ç䏿 |
| | | 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 å¨indeces䏿°ç»ç䏿 |
| | | 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 å¨indeces䏿°ç»ç䏿 |
| | | 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() |
| | | // æ¤å¤ä¸ºä¿è¯æ¥å£åæ°ä¸å¤ä½ï¼å¯çç¥ |
| | | 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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: { |
| | | //çº§èæ¡onChangeäºä»¶ |
| | | 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> |