From 64253c1ee691739bb4eab685f61e91da84b69938 Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期四, 27 二月 2025 10:11:57 +0800 Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev --- src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue | 71 +++++++++++++---------------------- 1 files changed, 26 insertions(+), 45 deletions(-) diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue index 241a3c0..fe9ee04 100644 --- a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue +++ b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue @@ -19,24 +19,21 @@ </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"> + <template slot="action" slot-scope="{ row }"> + <el-button type="text" @click="edit(row)">缂栬緫</el-button> + </template> + </lims-table> </div> - <AddRecord ref="addRecordRef" @submit="submit"></AddRecord> + <AddRecord ref="addRecordRef" v-if="addRecordRef" @submit="submit"></AddRecord> </div> </template> <script> -// import axios from "axios"; -// import { getPageAcceptance, addAcceptance, updateAcceptance, getAcceptanceDetails, exportAcceptance } from "@/assets/api/api"; -// import ZTTable from '@/components/caorui/ZTTable/index.vue'; -// import AddRecord from './components/AddRecord.vue'; - import limsTable from '@/components/Table/lims-table.vue' import AddRecord from './component/AddRecord.vue'; import { - getPageAcceptance, - updateAcceptanc, - addAcceptance + getPageAcceptance, getAcceptanceDetails, exportFeStandardSubstanceAcceptance, updateAcceptance, addAcceptance } from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept' export default { components: { @@ -48,6 +45,7 @@ form: { search: undefined }, + addRecordRef: false, columns: [ { label: "鍑哄満缂栧彿", @@ -114,56 +112,39 @@ this.getTableData() }, methods: { - async getTableData() { - const res = await getPageAcceptance(this.form); - if (res.code === 200) { + getTableData() { + getPageAcceptance(this.form).then(res => { this.tableData = res.data.records; this.page.total = res.data.total; - } - + }) }, openDialog() { - this.$refs.addRecordRef.openDialog() - }, - async submit(form) { - - const { code } = await form.acceptance.id ? updateAcceptanc(this.form) : addAcceptance((this.form)); - if (code == 200) { - this.$message.success(`${form.acceptance.id ? '缂栬緫' : '娣诲姞'}鎴愬姛`) - this.getTableData() - } - }, - async edit(row) { - const res = await this.getDetail(row.id) - this.$refs.addRecordRef.openDialog({ - acceptance: res.acceptance, - list: res.list + this.addRecordRef = true; + this.$nextTick(() => { + this.$refs.addRecordRef.openDialog() }) }, - async getDetail(id) { - const { code, data } = await axios({ - method: 'get', - url: getAcceptanceDetails, - params: { id } + submit() { + this.addRecordRef = false; + this.getTableData() + }, + edit(row) { + this.addRecordRef = true; + this.$nextTick(() => { + this.$refs.addRecordRef.openDialog(row.id) }) - if (code == 200) { - return data; - } }, reset() { this.form.search = undefined this.getTableData() }, async exportExcel() { - const res = await axios({ - method: "get", - url: `${exportAcceptance}`, - responseType: "blob" + exportFeStandardSubstanceAcceptance().then(res => { + const blob = new Blob([res], { type: 'application/octet-stream' }); + this.$download.saveAs(blob, '鏍囧噯鐗╄川楠屾敹.xlsx'); + this.$message.success('瀵煎嚭鎴愬姛') }) - const blob = new Blob([res], { type: 'application/octet-stream' }); - this.$download.saveAs(blob, '鏍囧噯鐗╄川楠屾敹.xlsx'); }, - // 鍒嗛〉鍒囨崲 pagination(page) { this.page.size = page.limit -- Gitblit v1.9.3