| | |
| | | this.$message({type: 'error',message: res.data.msg}); |
| | | } |
| | | done(); |
| | | }).catch(e=>{ |
| | | done(); |
| | | }); |
| | | }, |
| | | handleView() { |
| | |
| | | <!-- <el-button type="primary" plain @click="exportWebSite">导åºåä¼ æ¶å¯ç½</el-button> --> |
| | | <!-- <el-button type="primary" plain @click="reassign">æè½½è½¦åºç¨åºåº</el-button> --> |
| | | <!-- <el-button type="primary" plain @click="exportExcel">导åºå°EXCEL</el-button> --> |
| | | <el-button type="primary" plain @click="reassign">éæ°ææ´¾ |
| | | </el-button> |
| | | <!-- <el-button type="primary" plain @click="reassign">éæ°ææ´¾</el-button>--> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" @click.stop="customView(scope.row, scope.index, 0)">æ¥ç |
| | |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" @click.stop="customView(scope.row, scope.index, 0)">æ¥ç |
| | | </el-button> |
| | | <!-- |
| | | <el-button type="primary" text size="default" v-if="scope.row.processDefinitionKey === 'dispatch'" |
| | | @click.stop="handleApproveTable(scope.row, scope.index)">审æ¹è¡¨ |
| | | </el-button> |
| | | <!-- |
| | | v-if="scope.row.processDefinitionKey === 'program-cure'" |
| | | --> |
| | | <el-button type="primary" text size="default" v-if="scope.row.processDefinitionKey === 'program-cure'" |
| | | @click.stop="handleConfirmTable(scope.row, scope.index)">确认表 |
| | | </el-button> |
| | | --> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="ææ´¾" append-to-body v-model="reassignBox" width="30%"> |
| | |
| | | type: 'success', |
| | | message: 'æä½æå!', |
| | | }); |
| | | //this.$refs.form.resetForm(); |
| | | this.$refs.form.resetForm(); |
| | | this.attachForm = this.defaultForm; |
| | | done(); |
| | | }, |
| | |
| | | type: 'success', |
| | | message: 'æä½æå!', |
| | | }); |
| | | //this.$refs.form.resetForm(); |
| | | this.$refs.form.resetForm(); |
| | | this.attachForm = this.defaultForm; |
| | | done(); |
| | | }, |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | <basic-container> |
| | | <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 #search="{ disabled, size }"> |
| | | |
| | | </template> |
| | | <template #menu-left> |
| | | <div class="menuLeft"> |
| | | <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">导åº</el-button> |
| | | <el-button type="primary" size="default" icon="el-icon-compass" plain @click="preMonth">䏿</el-button> |
| | | <el-button type="primary" size="default" icon="el-icon-aim" plain @click="thisMonth">æ¬æ</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { exportBlob } from '@/api/common'; |
| | | import { getToken } from '@/utils/auth'; |
| | | import NProgress from 'nprogress'; |
| | | import dayjs from 'dayjs'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | import { getDeptLazyTree } from '@/api/system/dept'; |
| | | export default { |
| | | data() { |
| | | var that = this; |
| | | return { |
| | | /* |
| | | treeOption: { |
| | | nodeKey: 'id', |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId).then(res => { |
| | | resolve( |
| | | res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | ); |
| | | }); |
| | | }, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: 'small', |
| | | props: { |
| | | labelText: 'æ é¢', |
| | | label: 'title', |
| | | value: 'value', |
| | | children: 'children', |
| | | }, |
| | | },*/ |
| | | treeData: [], |
| | | treePropsConfig: { |
| | | value: 'id', |
| | | label: 'title', |
| | | children: 'children' |
| | | }, |
| | | organizationTreeList: [], |
| | | search: { |
| | | |
| | | }, |
| | | loading: true, |
| | | mypage: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | |
| | | option: { |
| | | index: true, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | labelWidth: 120, |
| | | emptyBtn: false, |
| | | searchSpan: 8, |
| | | searchEnter:true, |
| | | menu:false, |
| | | column: [ |
| | | |
| | | { |
| | | label: 'ç¨åºåç§°', |
| | | search: true, |
| | | prop: 'name', |
| | | }, |
| | | { |
| | | label: 'æºåºç¼å·', |
| | | prop: 'machineCode' |
| | | }, |
| | | { |
| | | label: 'ä¸å人å', |
| | | prop: 'createUserName', |
| | | }, |
| | | { |
| | | label: 'ä¸åæ¶é´', |
| | | prop: 'createTime', |
| | | type: "datetime", |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | { |
| | | label: 'ä¸åæ¶é´', |
| | | prop: 'createTime', |
| | | type: "datetime", |
| | | format: 'YYYY-MM-DD', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | hide:true, |
| | | search: true, |
| | | searchRange: true, |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | data: [], |
| | | }; |
| | | }, |
| | | methods: { |
| | | |
| | | handleChange(a,b,c) { |
| | | console.log(a,b,c); |
| | | }, |
| | | nodeClick(data) { |
| | | //this.treeDeptId = data.id; |
| | | this.mypage.current = 1; |
| | | this.onLoad(this.page); |
| | | }, |
| | | getQueryObj(){ |
| | | let param = this.search; |
| | | |
| | | if(param.createTime){ |
| | | param.createTimeBegin = param.createTime[0]; |
| | | param.createTimeEnd = param.createTime[1]; |
| | | } |
| | | return param; |
| | | }, |
| | | handleExport() { |
| | | this.$confirm('æ¯å¦å¯¼åº?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | let q = this.getQueryObj(); |
| | | let param = this.search; |
| | | |
| | | if(param.createTime){ |
| | | param.createTimeBegin = param.createTime[0]; |
| | | param.createTimeEnd = param.createTime[1]; |
| | | } |
| | | exportBlob( |
| | | `/blade-mdm/machinefile/sendrecord/export-excel?${this.website.tokenHeader}=${getToken()}`, |
| | | q |
| | | ).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() { |
| | | |
| | | }, |
| | | preMonth(){ |
| | | let now = dayjs(); |
| | | let prevMonthstart = now.subtract(1,'month').startOf( 'month').format('YYYY-MM-DD'); |
| | | let prevMonthEnd = now.subtract(1,'month').endOf('month').format('YYYY-MM-DD'); |
| | | this.search.createTime = [prevMonthstart,prevMonthEnd]; |
| | | }, |
| | | thisMonth(){ |
| | | let now = dayjs(); |
| | | let start = now.startOf( 'month').format('YYYY-MM-DD'); |
| | | let end = now.endOf('month').format('YYYY-MM-DD'); |
| | | this.search.createTime = [start,end]; |
| | | }, |
| | | onLoad() { |
| | | let q = this.getQueryObj(); |
| | | axios({ |
| | | url: '/blade-mdm/machinefile/sendrecord/page', |
| | | method: 'get', |
| | | params: q, |
| | | }).then( |
| | | res => { |
| | | const data = res.data.data; |
| | | this.mypage.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }, |
| | | error => { |
| | | |
| | | } |
| | | ); |
| | | }, |
| | | traversalLabelValueToTree(tree) { //éåæ°ç» |
| | | return tree.map(node => { |
| | | // 1. æ·»å label å value åæ®µ |
| | | const newNode = { |
| | | ...node, |
| | | label: node.fullName, |
| | | value: node.id, |
| | | }; |
| | | // 2. 妿æ childrenï¼éå½å¤ç |
| | | if (node.children && node.children.length > 0) { |
| | | newNode.children = this.traversalLabelValueToTree(node.children); |
| | | } |
| | | return newNode; |
| | | }); |
| | | } |
| | | }, |
| | | mounted() { |
| | | //æå±ç»ç» /api/blade-system/dept/tree |
| | | axios({url: '/blade-system/dept/tree',method: 'get'}).then(resp => { |
| | | this.organizationTreeList = this.traversalLabelValueToTree(resp.data.data); |
| | | }) |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .upload-demo { |
| | | display: inline-block; |
| | | margin-left: 6px; |
| | | margin-right: 6px; |
| | | } |
| | | .menuLeft { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | </style> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="treecFileData" style="width: 100%"> |
| | | <el-table-column prop="name" label="åç§°" /> |
| | | <el-table-column prop="fileModifyTime" label="åå»ºæ¥æ" /> |
| | | <el-table-column prop="fileModifyTime" label="ä¿®æ¹æ¥æ" /> |
| | | <el-table-column prop="fileSizeDisplay" label="大å°" /> |
| | | <el-table-column fixed="right" label="æä½" min-width="120"> |
| | | <el-table-column prop="name" label="åç§°"/> |
| | | <el-table-column prop="fileModifyTime" label="åå»ºæ¥æ" width="160"/> |
| | | <el-table-column prop="fileModifyTime" label="ä¿®æ¹æ¥æ" width="160"/> |
| | | <el-table-column prop="fileSizeDisplay" label="大å°" width="80"/> |
| | | <el-table-column fixed="right" label="æä½" min-width="110"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="fileView(scope.row)">æ¥ç</el-button> |
| | | <el-button link type="primary" size="small" @click="fileEdit(scope.row)">ç¼è¾</el-button> |