From a20bf71a183e02d3f01826152df9061855bc39e8 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期一, 26 五月 2025 18:00:37 +0800 Subject: [PATCH] 设备管理新增生产设备自主维护点检表页面 --- src/views/eam/SelfMaintenanceAndInspectionList.vue | 266 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 266 insertions(+), 0 deletions(-) diff --git a/src/views/eam/SelfMaintenanceAndInspectionList.vue b/src/views/eam/SelfMaintenanceAndInspectionList.vue new file mode 100644 index 0000000..dfc9a75 --- /dev/null +++ b/src/views/eam/SelfMaintenanceAndInspectionList.vue @@ -0,0 +1,266 @@ +<template> + <a-card :border="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + + <a-col :md="4" :sm="4"> + <a-form-item label="璁惧缂栧彿"> + <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.num" :allow-clear="false"/> + </a-form-item> + </a-col> + + <a-col :md="4" :sm="4"> + <a-form-item label="鏈堜唤"> + <a-month-picker style="width: 100%" value-format="YYYY-MM" placeholder="璇烽�夋嫨鏈堜唤" + v-model="queryParam.dataTime" :allow-clear="false"/> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button @click="searchReset" icon="reload">閲嶇疆</a-button> + <a-button type="primary" icon="download" @click="exportExcel">瀵煎嚭</a-button> + </a-space> + </a-col> + </a-row> + </a-form> + </div> + + <a-spin :spinning="loading"> + <table id="dataTable" v-if="dataSource.list1&&dataSource.list1.length>0"> + <thead> + <tr style="height: 48px"> + <th colspan="42">鐢熶骇璁惧鑷富缁存姢鐐规琛�</th> + </tr> + + <tr style="height: 48px"> + <th colspan="6">璁惧鍚嶇О锛歿{dataSource.equipentName}}</th> + <th colspan="3"></th> + <th colspan="6">璁惧鍨嬪彿锛歿{dataSource.equipmentModel}}</th> + <th colspan="3"></th> + <th colspan="6">缁熶竴缂栧彿锛歿{dataSource.equipentNum}}</th> + <th colspan="3"></th> + <th colspan="6">{{queryParam.dataTime.split('-')[0]}} 骞� {{queryParam.dataTime.split('-')[1]}} 鏈�</th> + <th colspan="6">鍗曚綅锛歿{dataSource.workCenterName}}</th> + <th colspan="3"></th> + </tr> + </thead> + + <tbody> + <tr> + <td rowspan="2">搴忓彿</td> + <td rowspan="2" colspan="5">鐐规椤圭洰</td> + <td rowspan="2" colspan="5">瀹屾垚鏁版嵁/瑕佹眰</td> + <td colspan="31">鏃ユ湡</td> + </tr> + + <tr> + <td v-for="item in 31">{{item}}</td> + </tr> + + <tr v-for="(item,index) in dataSource.list1"> + <td>{{index+1}}</td> + <td colspan="5">{{item.name}}</td> + <td colspan="5">{{item.detectionStandard}}</td> + <td v-for="childItem in 31"> + {{item.dataList&&item.dataList.find(item=>+item.dayTime===childItem)?item.dataList.find(item=>+item.dayTime===childItem).insResult:''}} + </td> + </tr> + + <tr> + <td colspan="11">缁存姢璐d换浜虹瀛�</td> + <td v-for="childItem in 31"> + {{dataSource.list2&&dataSource.list2[0].dataList&&dataSource.list2[0].dataList.find(item=>+item.dayTime===childItem)?dataSource.list2[0].dataList.find(item=>+item.dayTime===childItem).inspectionUserName:''}} + </td> + </tr> + + <tr> + <td colspan="11">妫�鏌ヨ矗浠讳汉绛惧瓧</td> + <td v-for="childItem in 31"> + {{dataSource.list3&&dataSource.list3[0].dataList&&dataSource.list3[0].dataList.find(item=>+item.dayTime===childItem)?dataSource.list3[0].dataList.find(item=>+item.dayTime===childItem).repairConfirmPerson:''}} + </td> + </tr> + + <tr style="height: 48px"> + <td>搴忓彿</td> + <td colspan="5">鍛ㄤ繚鍏婚」鐩�</td> + <td colspan="5">妫�鏌ユ爣鍑�</td> + <td colspan="31">鍛ㄦ姤鎵ц璁板綍</td> + </tr> + + <tr v-for="(item,index) in dataSource.list4"> + <td>{{index+1}}</td> + <td colspan="5">{{item.name}}</td> + <td colspan="5">{{item.detectionStandard}}</td> + <td v-for="childItem in 4" colspan="6"> + {{item.dataList&&item.dataList[childItem-1]?item.dataList[childItem-1].insResult:''}} + </td> + <td colspan="7"> + {{item.dataList&&item.dataList[4]?item.dataList[4].insResult:''}} + </td> + </tr> + + <tr> + <td colspan="11">鍛ㄤ繚鍏绘搷浣滆�呮墽琛岋紙鎿嶄綔鑰呯瀛楋級</td> + <td v-for="childItem in 4" colspan="6"> + {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList[childItem-1]?dataSource.list5[0].dataList[childItem-1].inspectionUserName:''}} + </td> + <td colspan="7"> + {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList[4]?dataSource.list5[0].dataList[4].inspectionUserName:''}} + </td> + </tr> + + <tr> + <td colspan="11">闂翠繚鍏绘鏌ヤ汉纭锛堢淮淇汉鍛樼瀛楋級</td> + <td v-for="childItem in 4" colspan="6"> + {{dataSource.list6&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList[childItem-1]?dataSource.list6[0].dataList[childItem-1].repairConfirmPerson:''}} + </td> + <td colspan="7"> + {{dataSource.list6&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList[4]?dataSource.list6[0].dataList[4].repairConfirmPerson:''}} + </td> + </tr> + + <tr> + <td colspan="42" style="text-align: left"> + 濉啓瑕佹眰锛氭甯革紳/锛屽紓甯革紳x锛屾晠闅滃仠鏈猴紳鈻筹紝娌″紑鏈猴紳T锛氳澶囨棩甯哥偣妫�璁板綍鐢辨搷浣滀汉鍛樻墽琛屽苟璁板綍銆傛墽琛屾儏鍐垫鏌ョ敱缁翠慨浜哄憳璐熻矗鎵ц骞惰褰曪紝瀵瑰彂鐜伴棶棰樿褰曡嚦鐐规琛ㄨ儗闈㈠悇娉ㄦ爮锛屽鍙戠幇闂杩涜鍏ㄧ▼闂幆璁板綍銆� + </td> + </tr> + + <!--<tr>--> + <!--<td colspan="42" style="text-align: left">澶囨敞锛�</td>--> + <!--</tr>--> + + <!--<tr>--> + <!--<th colspan="7">鍙戠敓鏃堕棿锛�</th>--> + <!--<th colspan="7">闂鎻忚堪锛�</th>--> + <!--<th colspan="7">鏁存敼 / 鏀瑰杽鎯呭喌锛�</th>--> + <!--<th colspan="7">鏁存敼瀹屾垚鏃堕棿</th>--> + <!--<th colspan="7">鏁存敼璐d换浜猴細</th>--> + <!--<th colspan="7">缁翠慨妫�鏌ヤ汉锛�</th>--> + <!--</tr>--> + </tbody> + </table> + </a-spin> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { getAction } from '@/api/manage' + import $ from 'jquery' + import '@/components/table2excel/table2excel' + + export default { + name: 'SelfMaintenanceAndInspectionList', + mixins: [JeecgListMixin], + data() { + return { + disableMixinCreated: true, + dataSource: {}, + tableElement: null, + url: { + list: '/eam/inspectionOrder/findInspectionForms' + } + } + }, + methods: { + searchQuery() { + const { num, dataTime } = this.queryParam + if (!num || !dataTime) { + this.$message.warning('璇烽�夋嫨璁惧缂栧彿鍙婃湀浠斤紒') + return + } + this.loadData() + }, + + loadData() { + this.dataSource = {} + this.loading = true + const { dataTime, num } = this.queryParam + + const that = this + getAction(this.url.list, this.queryParam) + .then(res => { + if (res.success) { + if (res.result.list1.length === 0) { + that.$message.warning(`${dataTime.split('-')[0]}骞�${dataTime.split('-')[1]}鏈� 璁惧缂栧彿涓�${num}璁惧 鏃犵偣妫�璁板綍`) + return + } + + that.dataSource = res.result + + for (let index = 4; index <= 6; index++) { + that.dataSource[`list${index}`] = that.dataSource[`list${index}`].map(item => { + return { + ...item, + dataList: item.dataList.sort((x, y) => x.dayTime - y.dayTime) + } + }) + } + + this.$nextTick(() => this.tableElement = document.getElementById('dataTable')) + } + else that.$message.warning(res.message) + }) + .finally(() => { + that.loading = false + }) + }, + + exportExcel() { + if (!this.tableElement) this.$message.warning('璇锋煡璇㈠悗鍐嶈繘琛屽鍑�') + + $('#dataTable').table2excel({ + exclude: '.noExl', + name: 'Excel Document Name', + filename: '鐢熶骇璁惧鑷富缁存姢鐐规琛�', + exclude_img: true, + fileext: '.xls', + exclude_links: true, + exclude_inputs: false + }) + }, + + searchReset() { + this.queryParam = this.dataSource = {} + this.tableElement = null + } + } + } +</script> + +<style scoped lang="less"> + table { + width: 100%; + text-align: center; + table-layout: fixed; + + td, th { + border: 1px solid #000; + } + + tr:first-child th { + border-bottom: 0; + } + + tr:nth-child(2) th { + border-top: 0; + } + + tr:nth-child(2) th { + border-left: 0; + border-right: 0; + } + + tr:nth-child(2) th:first-child { + border-left: 1px solid #000; + } + + tr:nth-child(2) th:last-child { + border-right: 1px solid #000; + } + } +</style> \ No newline at end of file -- Gitblit v1.9.3