From 5edf2b3a4b820c3540a23ae4d700a53f5c71d73f Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期三, 27 十一月 2024 14:20:11 +0800 Subject: [PATCH] 1、调整设备利用率等报表页面样式 2、新增MDC设备实施台账页面及功能 --- src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue | 17 src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue | 15 src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue | 22 src/mixins/JeecgListMixin.js | 2 src/views/system/MdcEquipmentImplementLedger.vue | 418 ++++++++++++++++++++++ src/views/system/modules/MdcEquipmentImplementLedger/MdcImplementLedgersModal.vue | 318 ++++++++++++++++ src/views/system/modules/MdcEquipmentImplementLedger/MdcImplementLedgersSubModal.vue | 307 ++++++++++++++++ 7 files changed, 1,088 insertions(+), 11 deletions(-) diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js index f0153a1..2883b4b 100644 --- a/src/mixins/JeecgListMixin.js +++ b/src/mixins/JeecgListMixin.js @@ -131,7 +131,7 @@ sqp['superQueryMatchType'] = this.superQueryMatchType } var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); - param.field = this.getQueryField(); + if(this.columns) param.field = this.getQueryField(); param.pageNo = this.ipagination.current; param.pageSize = this.ipagination.pageSize; //鑾峰彇鐢ㄦ埛瀹氬埗鐨勫弬鏁板睘鎬� diff --git a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue index 6f0de45..a280450 100644 --- a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue +++ b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue @@ -156,7 +156,7 @@ </th> <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧绫诲瀷 </th> - <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧鍨嬪彿 + <th class="thgu dong7 name" rowspan="2" style="min-width: 120px; max-width: 120px;width: 120px;">璁惧鍨嬪彿 </th> <!--<th rowspan="2">缁勫埆</th>--> <template v-for="(tableHead, index) in tableHeads"> @@ -200,11 +200,11 @@ {{item.equipmentName}} </td> <td class="tdgu5 kaitou">{{item.equipmentType}}</td> - <td class="tdgu5 kaitou">{{item.equipmentModel}}</td> + <td class="tdgu6 kaitou">{{item.equipmentModel}}</td> </template> <template v-else> - <td colspan="6" class="tdgu kaitou">{{item.level1}}</td> + <td colspan="7" 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"> @@ -690,6 +690,12 @@ z-index: 2; } + .table tbody tr .tdgu6 { + position: sticky; + left: 512px; + z-index: 2; + } + .table2 thead tr .timeth, .table2 thead tr .thgu { position: sticky; @@ -737,6 +743,11 @@ left: 412px; } + .table2 thead .equipname .dong7 { + z-index: 5; + left: 512px; + } + #EfficiencyPO { overflow: hidden; } diff --git a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue index b2f0ebf..faa9c8b 100644 --- a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue +++ b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue @@ -144,7 +144,7 @@ </th> <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧绫诲瀷 </th> - <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧鍨嬪彿 + <th class="thgu dong7 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;">璁惧鍨嬪彿 </th> <!--<th rowspan="2">缁勫埆</th>--> <template v-for="(tableHead, index) in tableHeads"> @@ -190,7 +190,7 @@ {{item.equipmentName}} </td> <td class="tdgu5 kaitou">{{item.equipmentType}}</td> - <td class="tdgu5 kaitou">{{item.equipmentModel}}</td> + <td class="tdgu6 kaitou">{{item.equipmentModel}}</td> </template> <!--鍚堣涓庡钩鍧囧�煎尯鍩�--> @@ -698,6 +698,12 @@ z-index: 2; } + .table tbody tr .tdgu6 { + position: sticky; + left: 512px; + z-index: 2; + } + .table2 thead tr .timeth, .table2 thead tr .thgu { position: sticky; @@ -745,6 +751,11 @@ left: 412px; } + .table2 thead .equipname .dong7 { + z-index: 5; + left: 512px; + } + #Efficiency { overflow: hidden; } diff --git a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue index 3d09bf0..58abebf 100644 --- a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue +++ b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue @@ -177,9 +177,9 @@ </th> <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧绫诲瀷 </th> - <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧鍨嬪彿 + <th class="thgu dong7 name" rowspan="2" style="min-width: 120px; max-width: 120px;width: 120px;">璁惧鍨嬪彿 </th> - <th class="thgu dong7 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">鐝</th> + <th class="thgu dong8 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">鐝</th> <template v-for="(tableHead, index) in tableHeads"> <th class="timeth" :colspan="checkedList.length">{{tableHead}}</th> </template> @@ -221,12 +221,12 @@ {{item.equipmentName}} </td> <td class="tdgu5 kaitou">{{item.equipmentType}}</td> - <td class="tdgu5 kaitou">{{item.equipmentModel}}</td> - <td class="tdgu6 kaitou">{{item.shiftSubName}}</td> + <td class="tdgu6 kaitou">{{item.equipmentModel}}</td> + <td class="tdgu7 kaitou">{{item.shiftSubName}}</td> </template> <template v-else> - <td colspan="7" class="tdgu kaitou">{{item.level1}}</td> + <td colspan="8" class="tdgu kaitou">{{item.level1}}</td> </template> <!--<td>{{item.tierType}}</td>--> <template v-for="(tableHead, index) in item.dataList"> @@ -748,6 +748,12 @@ z-index: 2; } + .table tbody tr .tdgu7 { + position: sticky; + left: 632px; + z-index: 2; + } + .table2 thead tr .timeth, .table2 thead tr .thgu { position: sticky; @@ -800,6 +806,12 @@ left: 512px; } + .table2 thead .equipname .dong8 { + z-index: 6; + left: 632px; + } + + #EfficiencyShift { overflow: hidden; } diff --git a/src/views/system/MdcEquipmentImplementLedger.vue b/src/views/system/MdcEquipmentImplementLedger.vue new file mode 100644 index 0000000..be03875 --- /dev/null +++ b/src/views/system/MdcEquipmentImplementLedger.vue @@ -0,0 +1,418 @@ +<template> + <a-card :bordered="false"> + <div :bordered="false" style="height: 100%"> + <!-- 鏌ヨ鍖哄煙 --> + <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-input v-model="queryParam.equipmentId" allowClear></a-input> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5"> + <a-form-item label="璁惧鍚嶇О"> + <a-input v-model="queryParam.equipmentName" allowClear></a-input> + </a-form-item> + </a-col> + <a-col :lg="5" :md="5" :sm="5" :xs="5"> + <a-space> + <a-button type="primary" @click="loadData" 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" 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> + + <a-table :columns="columns" :data-source="dataList" bordered :pagination="false" :scroll="{x:'max-content'}" + :expandRowByClick="true" + rowKey="id" @expand="handleExpandChange" :loading="outerDataLoading" + > + <span slot="isMdcInstall" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="isMdcHardwareInstall" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="isDncInstall" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="isDncHardwareInstall" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="action" slot-scope="text, record"> + <a @click.stop="handleAdd(record.id,'sub_')">鏂板璁板綍</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="handleEdit(record)">缂栬緫鍙拌处</a> + </a-menu-item> + + <a-menu-item> + <a href="javascript:;" @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 + slot="expandedRowRender" + slot-scope="row" + :columns="innerColumns" + :data-source="row.innerDataList" + :pagination="false" + rowKey="id" + :loading="innerDataLoading" + > + <span slot="mdcFunctionStatus" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="mdcModuleStatus" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="dncFunctionStatus" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="dncModuleStatus" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="maintenanceResult" slot-scope="text">{{text | formatIsInstallAndStatus}}</span> + <span slot="innerAction" slot-scope="text, record"> + <a @click="handleEdit(record,'sub_')">缂栬緫璁板綍</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 href="javascript:;" @click="handleDetail(record,'sub_')">璁板綍璇︽儏</a> + </a-menu-item> + + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎姝ゅ彉鏇磋褰曞悧?" @confirm="() => handleDelete(record.id,'sub')"> + <a>鍒犻櫎璁板綍</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + </a-table> + </a-table> + </div> + + <MdcImplementLedgersModal ref="modalForm" @ok="loadData"/> + <MdcImplementLedgersSubModal ref="sub_modalForm" @ok="loadData"/> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { putAction, getAction } from '@/api/manage' + import MdcImplementLedgersModal from './modules/MdcEquipmentImplementLedger/MdcImplementLedgersModal' + import MdcImplementLedgersSubModal from './modules/MdcEquipmentImplementLedger/MdcImplementLedgersSubModal' + import { deleteAction } from '@/api/manage' + + const columns = [ + { title: '鍏徃', dataIndex: 'companyName', key: 'companyName', align: 'center', width: 100 }, + { title: '杞﹂棿', dataIndex: 'productionName', key: 'productionName', align: 'center', width: 100 }, + { title: '宸ユ', dataIndex: 'sectionName', key: 'sectionName', align: 'center', width: 100 }, + { title: '璁惧缂栧彿', dataIndex: 'equipmentId', key: 'equipmentId', align: 'center', width: 100 }, + { title: '璁惧鍚嶇О', dataIndex: 'equipmentName', key: 'equipmentName', align: 'center', width: 100 }, + { title: '璁惧鍨嬪彿', dataIndex: 'equipmentModel', key: 'equipmentModel', align: 'center', width: 100 }, + { title: '璁惧绯荤粺绫诲瀷', dataIndex: 'controlSystem', key: 'controlSystem', align: 'center', width: 150 }, + { title: '璁惧璐d换浜�', dataIndex: 'responsible', key: 'responsible', align: 'center', width: 150 }, + { title: '璁惧瀹夋斁浣嶇疆', dataIndex: 'equipmentPosition', key: 'equipmentPosition', align: 'center', width: 150 }, + { title: '璁惧瀹夋斁鏃堕棿', dataIndex: 'placementTime', key: 'placementTime', align: 'center', width: 150 }, + { + title: 'MDC瀹夎鎯呭喌', + dataIndex: 'isMdcInstall', + key: 'isMdcInstall', + align: 'center', + width: 150, + scopedSlots: { customRender: 'isMdcInstall' } + }, + { + title: 'MDC纭欢瀹夎', + dataIndex: 'isMdcHardwareInstall', + key: 'isMdcHardwareInstall', + align: 'center', + width: 150, + scopedSlots: { customRender: 'isMdcHardwareInstall' } + }, + { title: '瀹夎鏃堕棿', dataIndex: 'mdcInstallTime', key: 'mdcInstallTime', align: 'center', width: 150 }, + { + title: 'DNC瀹夎鎯呭喌', + dataIndex: 'isDncInstall', + key: 'isDncInstall', + align: 'center', + width: 150, + scopedSlots: { customRender: 'isDncInstall' } + }, + { + title: 'DNC纭欢瀹夎', + dataIndex: 'isDncHardwareInstall', + key: 'isDncHardwareInstall', + align: 'center', + width: 150, + scopedSlots: { customRender: 'isDncHardwareInstall' } + }, + { title: '瀹夎鏃堕棿', dataIndex: 'dncInstallTime', key: 'dncInstallTime', align: 'center', width: 150 }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 200 + } + ] + + const innerColumns = [ + { + title: '鍙樻洿璁板綍', + dataIndex: 'rowIndex', + key: 'rowIndex', + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { title: '鍙樻洿鏃堕棿', dataIndex: 'alterTime', key: 'alterTime', align: 'center' }, + { title: '鍙樻洿鍘熷洜', dataIndex: 'alterReason', key: 'alterReason', align: 'center ' }, + { title: '璁惧浣嶇疆纭', dataIndex: 'locationStatus', key: 'locationStatus', align: 'center' }, + { title: '璁惧缃戠粶纭', dataIndex: 'networkStatus', key: 'networkStatus', align: 'center' }, + { + title: 'MDC鍔熻兘纭', + dataIndex: 'mdcFunctionStatus', + key: 'mdcFunctionStatus', + scopedSlots: { customRender: 'mdcFunctionStatus' }, + align: 'center' + }, + { + title: 'MDC妯″潡纭', + dataIndex: 'mdcModuleStatus', + key: 'mdcModuleStatus', + scopedSlots: { customRender: 'mdcModuleStatus' }, + align: 'center' + }, + { + title: 'DNC鍔熻兘纭', + dataIndex: 'dncFunctionStatus', + key: 'dncFunctionStatus', + scopedSlots: { customRender: 'dncFunctionStatus' }, + align: 'center' + }, + { + title: 'DNC妯″潡纭', + dataIndex: 'dncModuleStatus', + key: 'dncModuleStatus', + scopedSlots: { customRender: 'dncModuleStatus' }, + align: 'center' + }, + { title: '鍙嶉浜�', dataIndex: 'feedbackBy', key: 'feedbackBy', align: 'center' }, + { title: '鍙嶉鏃堕棿', dataIndex: 'feedbackTime', key: 'feedbackTime', align: 'center' }, + { title: '缁存姢浜哄憳', dataIndex: 'maintenanceBy', key: 'maintenanceBy', align: 'center' }, + { title: '澶勭悊鏃堕棿', dataIndex: 'maintenanceTime', key: 'maintenanceTime', align: 'center' }, + { title: '澶勭悊杩囩▼鎻忚堪', dataIndex: 'maintenanceRemark', key: 'maintenanceRemark', align: 'center' }, + { + title: '澶勭悊缁撴灉', + dataIndex: 'maintenanceResult', + key: 'maintenanceResult', + scopedSlots: { customRender: 'maintenanceResult' }, + align: 'center' + }, + { + title: '鎿嶄綔', + dataIndex: 'innerAction', + scopedSlots: { customRender: 'innerAction' }, + align: 'center', + width: 200 + } + ] + + export default { + name: 'MdcEquipmentImplementLedger', + components: { MdcImplementLedgersModal, MdcImplementLedgersSubModal }, + mixins: [JeecgListMixin], + data() { + return { + // 绂佺敤mixins涓殑create閽╁瓙 + disableMixinCreated: true, + /* table鍔犺浇鐘舵�� */ + outerDataLoading: false, + innerDataLoading: false, + queryParam: {}, + dataList: [], + url: { + mdcImplementLedgersList: '/mdc/mdcImplementLedgers/list', + mdcImplementLedgersSubList: '/mdc/mdcImplementLedgersSub/list' + }, + columns, + innerColumns, + hasRequestAlarmCodeList: [] + } + }, + /** + * 鐢熷懡鍛ㄦ湡 鎸傝浇鍓� + * */ + created() { + this.loadData() + }, + filters: { + numFilter(value) { + if (value) { + return parseFloat((value * 100).toFixed(2)) + } else { + return '0' + } + }, + + formatIsInstallAndStatus(value) { + return value === 'Y' ? '鏄�' : '鍚�' + }, + + /** + * 鏍煎紡鍖栨椂闂� + * @param seconds 绉掓暟 + * @returns '' 鏍煎紡鍖栧悗鏃堕棿瀛楃涓� + */ + getFormattedTime(seconds) { + var hours = Math.floor(seconds / 3600) + var minutes = Math.floor((seconds % 3600) / 60) + var secs = seconds % 60 + + if (hours === 0) { + if (minutes === 0) { + return secs === 0 ? 0 : `${secs}绉抈 + } else { + if (secs === 0) { + return `${minutes}鍒哷 + } + return `${minutes}鍒� ${secs}绉抈 + } + } else { + if (minutes === 0 && secs === 0) { + return `${hours}灏忔椂` + } else if (minutes !== 0 && secs === 0) { + return `${hours}灏忔椂 ${minutes}鍒哷 + } + } + return `${hours}灏忔椂 ${minutes}鍒� ${secs}绉抈 + } + }, + methods: { + loadData() { + this.outerDataLoading = true + this.dataList = [] + getAction(this.url.mdcImplementLedgersList, this.queryParam).then(res => { + if (res.success) { + this.dataList = res.result.records + this.hasRequestAlarmCodeList = [] + } + }).finally(() => { + this.outerDataLoading = false + }) + }, + + handleAdd: function(implementId = '', param = '') { + this.$refs[param + 'modalForm'].add(implementId) + this.$refs[param + 'modalForm'].title = '鏂板' + this.$refs[param + 'modalForm'].disableSubmit = false + }, + + handleEdit: function(record, param = '') { + this.$refs[param + 'modalForm'].edit(record) + this.$refs[param + 'modalForm'].title = '缂栬緫' + this.$refs[param + 'modalForm'].disableSubmit = false + }, + + /** + * 鐐瑰嚮琛ㄦ牸涓鎯呮寜閽簨浠� + * @param record 閫変腑鐨勫綋鍓嶈鏁版嵁 + */ + handleDetail: function(record, param = '') { + console.log(this.$refs[param + 'modalForm']) + this.$refs[param + 'modalForm'].edit(record) + this.$refs[param + 'modalForm'].title = '璇︽儏' + this.$refs[param + 'modalForm'].disableSubmit = true + // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶 + // this.$refs[param + 'modalForm'].removeValidate() + }, + + handleDelete: function(id, param) { + var that = this + let url + if (param != 'sub') { + url = '/mdc/mdcImplementLedgers/delete' + } else { + url = '/mdc/mdcImplementLedgersSub/delete' + } + deleteAction(url, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + + /** + * 鑷畾涔夎〃鏍艰瑙﹀彂 + * @param expanded 褰撳墠琛屾槸鍚︿负灞曞紑鐘舵�� + * @param record 褰撳墠琛屼俊鎭� + */ + handleExpandChange(expanded, record) { + let _this = this + // 褰撳睍寮�鏃惰嫢璇ヨ鏈灞曞紑杩囨墠浼氳姹傚悗鍙版暟鎹紝灞曞紑杩囩殑鏁版嵁浼氳缂撳瓨鏃犻渶閲嶅璇锋眰 + if (expanded && !this.hasRequestAlarmCodeList.includes(record.id)) { + this.innerDataLoading = true + getAction(this.url.mdcImplementLedgersSubList, { implementId: record.id }).then(res => { + if (res.success) { + _this.dataList.forEach(item => { + if (item.id === record.id) { + item.innerDataList = res.result.records + } + }) + _this.hasRequestAlarmCodeList.push(record.id) + } + }) + .finally(() => { + _this.innerDataLoading = false + }) + } + } + } + } +</script> +<style scoped> + /deep/ .ant-table-body tr:not(.ant-table-expanded-row) td { + /*padding-top: 10px;*/ + /*padding-bottom: 10px;*/ + /*cursor: pointer;*/ + } + + /deep/ .ant-table-fixed-right .ant-table-expanded-row { + display: none; + } +</style> \ No newline at end of file diff --git a/src/views/system/modules/MdcEquipmentImplementLedger/MdcImplementLedgersModal.vue b/src/views/system/modules/MdcEquipmentImplementLedger/MdcImplementLedgersModal.vue new file mode 100644 index 0000000..8b3e3a9 --- /dev/null +++ b/src/views/system/modules/MdcEquipmentImplementLedger/MdcImplementLedgersModal.vue @@ -0,0 +1,318 @@ +<template> + <a-modal + :title="title" + :maskClosable="disableSubmit" + :width="drawerWidth" + @cancel="visible=false" + :visible="visible" + :footer="null" + style="height: 100%;overflow: auto;padding-bottom: 53px;"> + + <template slot="title"> + <div style="width: 100%;"> + <span>{{ title }}</span> + <span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right"> + <a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button> + </span> + </div> + + </template> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules"> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="鍏徃" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="companyName"> + <a-input :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ュ叕鍙稿悕绉�" + v-model="model.companyName"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="杞﹂棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionName"> + <a-input :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ溅闂村悕绉�" v-model="model.productionName"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="宸ユ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sectionName"> + <a-input :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ュ伐娈靛悕绉�" + v-model="model.sectionName"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId"> + <a-input :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�" + v-model="model.equipmentId"></a-input> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentName"> + <a-input :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentName"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="璁惧鍨嬪彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentModel"> + <a-input :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧瀷鍙�" + v-model="model.equipmentModel"></a-input> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="璁惧绯荤粺绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囩郴缁熺被鍨�" + v-model="model.controlSystem"/> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item label="璁惧璐d换浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input allow-clear :readOnly="disableSubmit" placeholder="璇疯緭鍏ヨ澶囪矗浠讳汉" + v-model="model.responsible"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="璁惧瀹夋斁浣嶇疆" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input allow-clear :readOnly="disableSubmit" placeholder="璇疯緭鍏ヨ澶囧畨鏀句綅缃�" v-model="model.equipmentPosition"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="璁惧瀹夋斁鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-date-picker allow-clear :disabled="disableSubmit" v-model="model.placementTime" format='YYYY-MM-DD' + value-format="YYYY-MM-DD"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="MDC瀹夎鎯呭喌" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-switch :disabled="disableSubmit" v-model="model.isMdcInstall"></j-switch> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="MDC纭欢瀹夎" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-switch :disabled="disableSubmit" v-model="model.isMdcHardwareInstall"></j-switch> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="MDC瀹夎鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-date-picker allow-clear :disabled="disableSubmit" v-model="model.mdcInstallTime" format='YYYY-MM-DD' + value-format="YYYY-MM-DD"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="DNC瀹夎鎯呭喌" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-switch :disabled="disableSubmit" v-model="model.isDncInstall"></j-switch> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="DNC纭欢瀹夎" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-switch :disabled="disableSubmit" v-model="model.isDncHardwareInstall"></j-switch> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="DNC瀹夎鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-date-picker allow-clear :disabled="disableSubmit" v-model="model.dncInstallTime" format='YYYY-MM-DD' + value-format="YYYY-MM-DD"/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + + <div class="drawer-bottom-button" v-if="!disableSubmit"> + <a-popconfirm title="纭畾鏀惧純鎿嶄綔锛�" @confirm="close" okText="纭畾" cancelText="鍙栨秷"> + <a-button style="margin-right: .8rem">鍙栨秷</a-button> + </a-popconfirm> + <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">鎻愪氦</a-button> + </div> + </a-modal> + +</template> + +<script> + import pick from 'lodash.pick' + import { getAction, postAction } from '@/api/manage' + + export default { + name: 'MdcImplementLedgersModal', + components: {}, + data() { + return { + modalWidth: 800, + drawerWidth: 700, + modalToggleFlag: true, + disableSubmit: true, + form: this.$form.createForm(this), + validatorRules: { + // equipmentId: + // [ + // { + // required: true, message: '璇烽�夋嫨璁惧缂栧彿!' + // } + // ], + // equipmentName: + // [ + // { + // required: true, message: '璇疯緭鍏ヨ澶囧悕绉�!' + // } + // ], + // equipmentModel: + // [ + // { + // required: true, message: '璇疯緭鍏ヨ澶囧瀷鍙�!' + // } + // ] + }, + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 15 } + }, + uploadLoading: false, + confirmLoading: false, + headers: {}, + url: { + add: '/mdc/mdcImplementLedgers/add', + edit: '/mdc/mdcImplementLedgers/edit' + } + } + }, + methods: { + add() { + this.edit({}) + }, + edit(record) { + let that = this + that.visible = true + //鏍规嵁灞忓箷瀹藉害鑷�傚簲鎶藉眽瀹藉害 + this.resetScreenSize() + that.model = Object.assign({}, record) + }, + //绐楀彛鏈�澶у寲鍒囨崲 + toggleScreen() { + if (this.modalToggleFlag) { + this.modalWidth = window.innerWidth + } else { + this.modalWidth = 800 + } + this.modalToggleFlag = !this.modalToggleFlag + }, + // 鏍规嵁灞忓箷鍙樺寲,璁剧疆鎶藉眽灏哄 + resetScreenSize() { + let screenWidth = document.body.clientWidth + if (screenWidth < 500) { + this.drawerWidth = screenWidth + } else { + this.drawerWidth = 700 + } + }, + close() { + this.$emit('close') + this.visible = false + this.disableSubmit = false + }, + handleSubmit() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let url + if (!this.model.id) { + url = that.url.add + } else { + url = that.url.edit + } + console.log('model', that.model) + postAction(url, that.model).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 + that.close() + }) + } else { + return false + } + }) + }, + /** + * 缂栬緫鎴栨煡鐪嬭鎯呮暟鎹椂娓呴櫎鎶藉眽琛ㄥ崟楠岃瘉 + */ + removeValidate() { + this.$refs.form.clearValidate() + } + } + + } +</script> + +<style scoped> + .avatar-uploader > .ant-upload { + width: 104px; + height: 104px; + } + + .ant-upload-select-picture-card i { + font-size: 49px; + color: #999; + } + + .ant-upload-select-picture-card .ant-upload-text { + margin-top: 8px; + color: #666; + } + + .ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; + } + + .drawer-bottom-button { + position: absolute; + bottom: -8px; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: right; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; + } +</style> \ No newline at end of file diff --git a/src/views/system/modules/MdcEquipmentImplementLedger/MdcImplementLedgersSubModal.vue b/src/views/system/modules/MdcEquipmentImplementLedger/MdcImplementLedgersSubModal.vue new file mode 100644 index 0000000..c43895e --- /dev/null +++ b/src/views/system/modules/MdcEquipmentImplementLedger/MdcImplementLedgersSubModal.vue @@ -0,0 +1,307 @@ +<template> + <a-modal + :title="title" + :maskClosable="disableSubmit" + :width="drawerWidth" + @cancel="visible=false" + :visible="visible" + :footer="null" + style="height: 100%;overflow: auto;padding-bottom: 53px;"> + + <template slot="title"> + <div style="width: 100%;"> + <span>{{ title }}</span> + <span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right"> + <a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button> + </span> + </div> + + </template> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules"> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="鍙樻洿鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="alterTime"> + <a-date-picker allow-clear :disabled="disableSubmit" v-model="model.alterTime" format='YYYY-MM-DD' + value-format="YYYY-MM-DD"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍙樻洿鍘熷洜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="alterReason"> + <a-select :disabled="disableSubmit" placeholder="璇烽�夋嫨鍙樻洿鍘熷洜" :triggerChange="true" + v-model="model.alterReason"> + <a-select-option v-for='item in selectList' :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 label="璁惧浣嶇疆纭" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationStatus"> + <a-input :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囦綅缃‘璁�" + v-model="model.locationStatus"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="璁惧缃戠粶纭" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="networkStatus"> + <a-select :disabled="disableSubmit" placeholder="璇烽�夋嫨鍙樻洿鍘熷洜" :triggerChange="true" + v-model="model.networkStatus"> + <a-select-option value='鏈仮澶�'>鏈仮澶�</a-select-option> + <a-select-option value='宸叉仮澶�'>宸叉仮澶�</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 label="MDC鍔熻兘纭" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mdcFunctionStatus"> + <j-switch :disabled="disableSubmit" v-model="model.mdcFunctionStatus"></j-switch> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="MDC妯″潡纭" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mdcModuleStatus"> + <j-switch :disabled="disableSubmit" v-model="model.mdcModuleStatus"></j-switch> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="DNC鍔熻兘纭" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dncFunctionStatus"> + <j-switch :disabled="disableSubmit" v-model="model.dncFunctionStatus"></j-switch> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="DNC妯″潡纭" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dncModuleStatus"> + <j-switch :disabled="disableSubmit" v-model="model.dncModuleStatus"></j-switch> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="鍙嶉浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input allow-clear :readOnly="disableSubmit" placeholder="璇疯緭鍏ュ弽棣堜汉" v-model="model.feedbackBy"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍙嶉鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-date-picker allow-clear :disabled="disableSubmit" v-model="model.feedbackTime" format='YYYY-MM-DD' + value-format="YYYY-MM-DD"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="缁存姢浜哄憳" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input allow-clear :readOnly="disableSubmit" placeholder="璇疯緭鍏ョ淮鎶や汉鍛�" v-model="model.maintenanceBy"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="澶勭悊鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-date-picker allow-clear :disabled="disableSubmit" v-model="model.maintenanceTime" format='YYYY-MM-DD' + value-format="YYYY-MM-DD"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="澶勭悊杩囩▼鎻忚堪" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input allow-clear :readOnly="disableSubmit" placeholder="璇疯緭鍏ュ鐞嗚繃绋嬫弿杩�" v-model="model.maintenanceRemark"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="澶勭悊缁撴灉" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-switch :disabled="disableSubmit" v-model="model.maintenanceResult"></j-switch> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + + <div class="drawer-bottom-button" v-if="!disableSubmit"> + <a-popconfirm title="纭畾鏀惧純鎿嶄綔锛�" @confirm="close" okText="纭畾" cancelText="鍙栨秷"> + <a-button style="margin-right: .8rem">鍙栨秷</a-button> + </a-popconfirm> + <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">鎻愪氦</a-button> + </div> + </a-modal> + +</template> + +<script> + import { getAction, postAction } from '@/api/manage' + + export default { + name: 'MdcImplementLedgersModal', + components: {}, + data() { + return { + modalWidth: 800, + drawerWidth: 700, + modalToggleFlag: true, + disableSubmit: true, + form: this.$form.createForm(this), + validatorRules: {}, + title: '鎿嶄綔', + visible: false, + model: {}, + selectList: [ + { + label: '鎼縼', + value: '鎼縼' + }, + { + label: '缁翠慨', + value: '缁翠慨' + }, + { + label: '澶т慨', + value: '澶т慨' + }, + { + label: '鎶ュ簾', + value: '鎶ュ簾' + }, + { + label: '鍏朵粬', + value: '鍏朵粬' + } + ], + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 15 } + }, + uploadLoading: false, + confirmLoading: false, + headers: {}, + url: { + add: '/mdc/mdcImplementLedgersSub/add', + edit: '/mdc/mdcImplementLedgersSub/edit' + } + } + }, + methods: { + add(implementId) { + this.edit({ implementId }) + }, + edit(record) { + let that = this + that.visible = true + //鏍规嵁灞忓箷瀹藉害鑷�傚簲鎶藉眽瀹藉害 + this.resetScreenSize() + that.model = Object.assign({}, record) + }, + //绐楀彛鏈�澶у寲鍒囨崲 + toggleScreen() { + if (this.modalToggleFlag) { + this.modalWidth = window.innerWidth + } else { + this.modalWidth = 800 + } + this.modalToggleFlag = !this.modalToggleFlag + }, + // 鏍规嵁灞忓箷鍙樺寲,璁剧疆鎶藉眽灏哄 + resetScreenSize() { + let screenWidth = document.body.clientWidth + if (screenWidth < 500) { + this.drawerWidth = screenWidth + } else { + this.drawerWidth = 700 + } + }, + close() { + this.$emit('close') + this.visible = false + this.disableSubmit = false + }, + handleSubmit() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let url + if (!this.model.id) { + url = that.url.add + } else { + url = that.url.edit + } + console.log('model', that.model) + postAction(url, that.model).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 + that.close() + }) + } else { + return false + } + }) + }, + /** + * 缂栬緫鎴栨煡鐪嬭鎯呮暟鎹椂娓呴櫎鎶藉眽琛ㄥ崟楠岃瘉 + */ + removeValidate() { + this.$refs.form.clearValidate() + } + } + + } +</script> + +<style scoped> + .avatar-uploader > .ant-upload { + width: 104px; + height: 104px; + } + + .ant-upload-select-picture-card i { + font-size: 49px; + color: #999; + } + + .ant-upload-select-picture-card .ant-upload-text { + margin-top: 8px; + color: #666; + } + + .ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; + } + + .drawer-bottom-button { + position: absolute; + bottom: -8px; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: right; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; + } +</style> \ No newline at end of file -- Gitblit v1.9.3