From 840de9662167b1d7758208b9c88adda806ed8fec Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期一, 03 三月 2025 16:47:25 +0800 Subject: [PATCH] 删除导出成功提示,统一提示了 --- src/views/CNAS/resourceDemand/standardMaterial/index.vue | 68 +++++++++------------------------- 1 files changed, 18 insertions(+), 50 deletions(-) diff --git a/src/views/CNAS/resourceDemand/standardMaterial/index.vue b/src/views/CNAS/resourceDemand/standardMaterial/index.vue index 6483368..2ad23f6 100644 --- a/src/views/CNAS/resourceDemand/standardMaterial/index.vue +++ b/src/views/CNAS/resourceDemand/standardMaterial/index.vue @@ -5,11 +5,11 @@ <el-form :model="searchForm" ref="searchForm" size="small" :inline="true"> <el-form-item label="鏍囧噯鐗╄川鍚嶇О" prop="name"> <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="searchForm.name" - @keyup.enter.native="searchList"></el-input> + @keyup.enter.native="searchList"></el-input> </el-form-item> <el-form-item label="鐢熶骇鍘傚" prop="factoryManufacturer"> <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="searchForm.factoryManufacturer" - @keyup.enter.native="searchList"></el-input> + @keyup.enter.native="searchList"></el-input> </el-form-item> <el-form-item> <el-button type="primary" icon="el-icon-search" size="mini" @click="searchList">鏌� 璇�</el-button> @@ -24,7 +24,7 @@ </div> <div class="table"> <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination" - :page="page" :tableLoading="tableLoading"></lims-table> + :page="page" :tableLoading="tableLoading"></lims-table> </div> <form-dia v-if="formDia" ref="formDia" @closeYearDia="closeYearDia"></form-dia> <borrow-dia v-if="borrowDia" ref="borrowDia" @closeYearDia="closeBorrowDia"></borrow-dia> @@ -35,9 +35,6 @@ <script> -// import FormDia from '../do/a6-standard-material-list/formDia.vue'; -// import BorrowDia from '../do/a6-standard-material-list/borrowDia.vue'; -// import ReturnDia from '../do/a6-standard-material-list/returnDia.vue'; import limsTable from '@/components/Table/lims-table.vue' import { getPageStandardSubstance, @@ -121,11 +118,6 @@ prop: 'remark', minWidth: '100' }, - // { - // label: '鍒涘缓浜�', - // prop: 'createUser', - // minWidth: '100' - // }, { label: '鍒涘缓鏃堕棿', prop: 'createTime', @@ -185,62 +177,38 @@ mounted() { this.searchList() }, - methods :{ + methods: { exportFun() { this.outLoading = true - exportOfStandardSubstanceList(this.searchForm).then(res =>{ + exportOfStandardSubstanceList(this.searchForm).then(res => { this.outLoading = false - const blob = new Blob([res], {type: 'application/octet-stream'},false); - let reader = new FileReader(); - reader.readAsText(blob, 'utf-8'); - reader.onload = () => { - try { - let result = JSON.parse(reader.result); - if (result.message) { - this.$message.error(result.message); - } else { - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鏍囧噯鐗╄川娓呭崟.xlsx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } catch (err) { - console.log(err); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鏍囧噯鐗╄川娓呭崟.xlsx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } + const blob = new Blob([res], { type: 'application/octet-stream' }, false); + this.$download.saveAs(blob, '鏍囧噯鐗╄川娓呭崟.xlsx') }) }, // 鏌ヨ鍒楄〃 - searchList () { + searchList() { this.tableLoading = true getPageStandardSubstance({ ...this.page, ...this.searchForm }).then(res => { this.tableLoading = false - if (res.code === 200){ + if (res.code === 200) { this.tableData = res.data.records this.page.total = res.data.total } }) }, // 鍒犻櫎 - delPlan (row) { + delPlan(row) { this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { this.tableLoading = true - removeStandardSubstance({id:row.id}).then(res => { + removeStandardSubstance({ id: row.id }).then(res => { this.tableLoading = false if (res.code === 200) { this.$message.success('鍒犻櫎鎴愬姛') @@ -257,40 +225,40 @@ }); }, // 鏂板锛岀紪杈戯紝鎵瑰噯寮规 - openFormDia (type, row) { + openFormDia(type, row) { this.formDia = true this.$nextTick(() => { this.$refs.formDia.openDia(type, row) }) }, - closeYearDia () { + closeYearDia() { this.formDia = false this.searchList() }, // 鍊熺敤 - borrow (row) { + borrow(row) { this.borrowDia = true this.$nextTick(() => { this.$refs.borrowDia.openDia(row) }) }, - closeBorrowDia () { + closeBorrowDia() { this.borrowDia = false this.searchList() }, // 褰掕繕 - return (row) { + return(row) { this.returnDia = true this.$nextTick(() => { this.$refs.returnDia.openDia(row) }) }, - closeReturnDia () { + closeReturnDia() { this.returnDia = false this.searchList() }, // 閲嶇疆鏌ヨ鏉′欢 - resetSearchForm () { + resetSearchForm() { this.searchForm.name = ''; this.searchForm.factoryManufacturer = ''; this.searchList() -- Gitblit v1.9.3