From 1ad4dd1d9a1a521980ce2cfeae4208b1873c7c9a Mon Sep 17 00:00:00 2001 From: Fixiaobai <fixiaobai@163.com> Date: 星期三, 08 十一月 2023 15:06:03 +0800 Subject: [PATCH] modified: src/views/basic/param/index.vue --- src/views/basic/part/index.vue | 69 ++++++++++++++++++++++++---------- 1 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/views/basic/part/index.vue b/src/views/basic/part/index.vue index 1e00afc..b545774 100644 --- a/src/views/basic/part/index.vue +++ b/src/views/basic/part/index.vue @@ -5,6 +5,10 @@ :prelang="prelang" :options="options" :bottomOffset="125" :ajaxFun="ajaxFun" ref="partTable"> <template #toolbar></template> </ttable> + <el-upload :headers="{'Authorization': 'Bearer ' + yourToken}" class="upload-demo" action="/mes/part/uploadExcel" :on-preview="handlePreview" + :on-remove="handleRemove" :file-list="fileList" :on-success="fileUpload" :limit="1"> + <el-button size="small" type="primary">鐐瑰嚮Excel瀵煎叆</el-button> + </el-upload> <!-- 寮圭獥, 鏂板 / 淇敼 --> <table-form v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getData"></table-form> <PrintLabelForm :currshowlist.sync="showPrintLabelForm" :printLabelInfo="printLabelInfo" /> @@ -33,16 +37,18 @@ import { mapGetters } from 'vuex' import ttable from '@/views/common/ztt-table.vue' import { remote } from '../../../api/admin/dict' -import { dateFormat,dateFormatYearMonthDate,dateFormatPlus } from '@/util/date' +import { dateFormat, dateFormatYearMonthDate, dateFormatPlus } from '@/util/date' import PrintLabelForm from './print-label-form.vue' export default { data() { return { + fileList: [], selectDate: "", dialogVisible: false, ajaxFun: fetchList, addOrUpdateVisible: false, multipleSelection: [], + yourToken: "", uploadInfo: { // 鏄惁灞曠ず涓婁紶EXCEL浠ュ強瀵瑰簲鐨剈rl isShow: true, @@ -357,23 +363,29 @@ } ], toolbar: [ - { - text: '鏂板', - type: 'primary', - fun: this.addOrUpdateHandle - }, - { - text: '鑾峰彇IFS闆朵欢', - type: 'primary', - fun: this.syncISDate, - loading: false - }, - { - text: '澶ф爣绛�', - type: 'primary', - fun: this.printLabel, - loading: false - } + // { + // text: '鏂板', + // type: 'primary', + // fun: this.addOrUpdateHandle + // }, + // { + // text: '鑾峰彇IFS闆朵欢', + // type: 'primary', + // fun: this.syncISDate, + // loading: false + // }, + // { + // text: '澶ф爣绛�', + // type: 'primary', + // fun: this.printLabel, + // loading: false + // }, + // { + // text: 'Excel瀵煎叆', + // type: 'primary', + // fun: this.uploadPartExcel, + // loading: false + // }, ], operator: [ { @@ -412,6 +424,8 @@ PrintLabelForm }, created() { + let token=JSON.parse(sessionStorage.getItem("ztt-access_token")).content + this.yourToken=token this.table.column.find((e) => e.label === 'IFS鍚敤鎵规绠$悊').isTrue = false this.table.column.find((e) => e.label === '璁″垝鏂规硶').isTrue = false this.getUnitType('unit') @@ -427,6 +441,16 @@ ...mapGetters(['permissions']) }, methods: { + handleRemove(file, fileList) { + console.log(file, fileList); + }, + handlePreview(file) { + + }, + fileUpload(){ + this.$message.success('鍚庡彴姝e湪瀵煎叆涓紝璇风◢鍚庡埛鏂帮紒') + this.fileList=[] + }, handleClose() { this.selectDate = ""; this.dialogVisible = false @@ -650,9 +674,9 @@ let datas = new FormData() let times = null; if (this.selectDate != '' && this.selectDate != null) { - times=dateFormatPlus(this.selectDate) - }else{ - times=null + times = dateFormatPlus(this.selectDate) + } else { + times = null } datas.set("date", times) // console.log(datas.get("date")); @@ -683,6 +707,9 @@ // this.$message.error('鍚屾ERP澶辫触:' + e) }) }, + uploadPartExcel() { + + }, printLabel() { if (this.multipleSelection && this.multipleSelection.length > 0) { if (this.multipleSelection && this.multipleSelection.length === 1) { -- Gitblit v1.9.3