| | |
| | | labelWidth: 120, |
| | | emptyBtn: false, |
| | | searchSpan: 8, |
| | | selection: true, |
| | | menu: false, |
| | | column: [ |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-form v-model="searchForm" :option="serachOption" @submit="searchSubmit"></avue-form> |
| | | <avue-crud |
| | | :addBtn="false" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model:search="search" |
| | | v-model:page="mypage" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template #menu-left> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">导åº</el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" icon="el-icon-document-delete" @click.stop="handView(scope.row, scope.index)">详æ
</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { exportBlob } from '@/api/common'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import { getToken } from '@/utils/auth'; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | searchForm: {}, |
| | | serachOption: { |
| | | labelWidth: 130, |
| | | submitText: "æ¥è¯¢", |
| | | emptyBtn: false, |
| | | menuPosition: 'center', |
| | | menuSpan: 8, |
| | | column: [ |
| | | { |
| | | label: 'åä¼ æ¶é´', |
| | | prop: 'distributeTime', |
| | | type: "daterange", |
| | | format: 'YYYY-MM-DD', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | search: true, |
| | | hide: true, |
| | | span: 8 |
| | | }, |
| | | { |
| | | label: 'æºåºï¼å¯å¤éï¼', |
| | | prop: 'machineCodes', |
| | | search: true, |
| | | hide: true, |
| | | type: 'select', |
| | | dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | }, |
| | | span: 8 |
| | | } |
| | | ] |
| | | }, |
| | | search: {}, |
| | | loading: true, |
| | | mypage: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | option: { |
| | | index: true, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | labelWidth: 120, |
| | | emptyBtn: false, |
| | | menu: true, |
| | | column: [ |
| | | { |
| | | label: 'æºåºç¼å·', |
| | | prop: 'code' |
| | | }, |
| | | { |
| | | label: 'åä¼ æ°é', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: '彿¡£æ°é', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: 'åä¼ ç¨åºå æ¯', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: '彿¡£ç¨åºå æ¯', |
| | | prop: '', |
| | | } |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | methods: { |
| | | searchSubmit(params,done) { |
| | | this.onLoad(params); |
| | | done(); |
| | | }, |
| | | handView(row) { |
| | | |
| | | }, |
| | | handleExport(row,index) { //å¯¼åº |
| | | // this.$confirm('æ¯å¦å¯¼åºæºåºåä¼ æä»¶æ°æ®?', 'æç¤º', { |
| | | // confirmButtonText: 'ç¡®å®', |
| | | // cancelButtonText: 'åæ¶', |
| | | // type: 'warning', |
| | | // }).then(() => { |
| | | // NProgress.start(); |
| | | // exportBlob( |
| | | // `/blade-mdm/machineback/file/export-excel?${this.website.tokenHeader}=${getToken()}` |
| | | // ).then(res => { |
| | | // downloadXls(res.data, `æºåºåä¼ æä»¶æ°æ®${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | // NProgress.done(); |
| | | // }); |
| | | // }); |
| | | }, |
| | | searchReset() { |
| | | //this.onLoad(this.mypage); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.mypage.current = 1; |
| | | this.onLoad(); |
| | | done(); |
| | | }, |
| | | currentChange(current) { |
| | | this.mypage.current = current; |
| | | }, |
| | | sizeChange(size) { |
| | | this.mypage.size = size; |
| | | }, |
| | | refreshChange() { |
| | | |
| | | }, |
| | | onLoad() { |
| | | this.loading = true; |
| | | if(this.searchForm.distributeTime == undefined) { |
| | | this.searchForm.distributeTimeBegin = ""; |
| | | this.searchForm.distributeTimeEnd = ""; |
| | | }else if(this.searchForm.distributeTime.length == 1) { |
| | | this.searchForm.distributeTimeBegin = this.searchForm.distributeTime[0]; |
| | | }else if(this.searchForm.distributeTime.length == 2) { |
| | | this.searchForm.distributeTimeBegin = this.searchForm.distributeTime[0]; |
| | | this.searchForm.distributeTimeEnd = this.searchForm.distributeTime[1]; |
| | | } |
| | | var obj = { |
| | | distributeTimeBegin: this.searchForm.distributeTimeBegin, |
| | | distributeTimeEnd: this.searchForm.distributeTimeEnd, |
| | | machineCodes: this.searchForm.machineCodes, |
| | | current: this.mypage.current, |
| | | size: this.mypage.size, |
| | | } |
| | | axios({ |
| | | url: '/blade-mdm/program/stat/page', |
| | | method: 'get', |
| | | params: obj, |
| | | }).then( |
| | | res => { |
| | | const data = res.data.data; |
| | | this.mypage.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }, |
| | | error => { |
| | | |
| | | } |
| | | ); |
| | | |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | </style> |