¶Ô±ÈÐÂÎļþ |
| | |
| | | <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">ç»´æ¤è´£ä»»äººç¾å</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">æ´æ¹è´£ä»»äººï¼</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> |