From 1d1df3fc69758076af297c6bc45a7a93d2c2fe42 Mon Sep 17 00:00:00 2001 From: 李喆(开发组) <lzhe@yxqiche.com> Date: 星期二, 24 六月 2025 15:06:35 +0800 Subject: [PATCH] 1 --- src/views/flowmgr/backImport.vue | 1 src/views/flowmgr/statistics.vue | 193 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+), 1 deletions(-) diff --git a/src/views/flowmgr/backImport.vue b/src/views/flowmgr/backImport.vue index b95a1e8..64a2d08 100644 --- a/src/views/flowmgr/backImport.vue +++ b/src/views/flowmgr/backImport.vue @@ -41,7 +41,6 @@ labelWidth: 120, emptyBtn: false, searchSpan: 8, - selection: true, menu: false, column: [ { diff --git a/src/views/flowmgr/statistics.vue b/src/views/flowmgr/statistics.vue new file mode 100644 index 0000000..f61bf12 --- /dev/null +++ b/src/views/flowmgr/statistics.vue @@ -0,0 +1,193 @@ +<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> \ No newline at end of file -- Gitblit v1.9.3