From 66b3c4c129b05b634d37ac7eac63eff0f0b9f426 Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期四, 27 二月 2025 10:11:52 +0800 Subject: [PATCH] 修改体系管理要求bug --- src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue | 72 ++++++------------------------------ 1 files changed, 12 insertions(+), 60 deletions(-) diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue index b6bb91f..241a3c0 100644 --- a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue +++ b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue @@ -19,34 +19,10 @@ </div> <div class="table"> <lims-table :tableData="tableData" :column="columns" :height="'calc(100vh - 250px)'" @pagination="pagination" - :page="page" :tableLoading="tableLoading"></lims-table> + :page="page" :tableLoading="tableLoading"></lims-table> </div> <AddRecord ref="addRecordRef" @submit="submit"></AddRecord> </div> - -<!-- <div class="tables">--> -<!-- <ZTTable--> -<!-- :column="columns"--> -<!-- :table-data="tableData"--> -<!-- >--> -<!-- <template slot="action" slot-scope="{ row }">--> -<!-- <el-button type="text" @click="edit(row)">缂栬緫</el-button>--> -<!-- </template>--> -<!-- </ZTTable>--> -<!-- <div class="pagination">--> -<!-- <div></div>--> -<!-- <el-pagination--> -<!-- :page-size="pagination.pageSize"--> -<!-- :page-sizes="[10, 20, 30, 40]"--> -<!-- :total="pagination.total"--> -<!-- layout="total, sizes, prev, pager, next, jumper"--> -<!-- @current-change="handleCurrent"--> -<!-- @size-change="handleSize"--> -<!-- >--> -<!-- </el-pagination>--> -<!-- </div>--> -<!-- </div>--> -<!-- <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>--> </template> <script> @@ -56,6 +32,7 @@ // import AddRecord from './components/AddRecord.vue'; import limsTable from '@/components/Table/lims-table.vue' +import AddRecord from './component/AddRecord.vue'; import { getPageAcceptance, updateAcceptanc, @@ -63,8 +40,8 @@ } from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept' export default { components: { - limsTable - + limsTable, + AddRecord }, data() { return { @@ -138,8 +115,8 @@ }, methods: { async getTableData() { - const res = await getPageAcceptance(this.form); - if(res.code === 200){ + const res = await getPageAcceptance(this.form); + if (res.code === 200) { this.tableData = res.data.records; this.page.total = res.data.total; } @@ -150,9 +127,9 @@ }, async submit(form) { - const {code} = await form.acceptance.id ? updateAcceptanc(this.form):addAcceptance((this.form)); - if(code == 200) { - this.$message.success(`${form.acceptance.id ? '缂栬緫':'娣诲姞'}鎴愬姛`) + const { code } = await form.acceptance.id ? updateAcceptanc(this.form) : addAcceptance((this.form)); + if (code == 200) { + this.$message.success(`${form.acceptance.id ? '缂栬緫' : '娣诲姞'}鎴愬姛`) this.getTableData() } }, @@ -169,7 +146,7 @@ url: getAcceptanceDetails, params: { id } }) - if(code == 200) { + if (code == 200) { return data; } }, @@ -183,33 +160,8 @@ url: `${exportAcceptance}`, responseType: "blob" }) - const blob = new Blob([res], {type: 'application/octet-stream'}); - //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆 - 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' }); + this.$download.saveAs(blob, '鏍囧噯鐗╄川楠屾敹.xlsx'); }, // 鍒嗛〉鍒囨崲 -- Gitblit v1.9.3