From 7de835dea145fe8229f5f0100e2a90094e6d5b22 Mon Sep 17 00:00:00 2001 From: MrShi <1878285526@qq.com> Date: 星期五, 07 二月 2025 18:49:38 +0800 Subject: [PATCH] 改bug --- admin/src/views/stock/components/inventoryDetails.vue | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 deletions(-) diff --git a/admin/src/views/stock/components/inventoryDetails.vue b/admin/src/views/stock/components/inventoryDetails.vue index c5b03c4..b5e7a9b 100644 --- a/admin/src/views/stock/components/inventoryDetails.vue +++ b/admin/src/views/stock/components/inventoryDetails.vue @@ -39,7 +39,7 @@ <el-input v-model="form.materialCode" style="width: 200px; margin-right: 10px;" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�/缂栫爜"></el-input> <el-select v-model="form.status" style="width: 150px; margin-right: 10px;" placeholder="鐩樼偣鐘舵��"> <el-option label="宸茬洏" :value="1"></el-option> - <el-option label="鏈洏" :value="0"></el-option> + <el-option label="鏈洏" :value="2"></el-option> </el-select> <el-select v-model="form.type" style="width: 150px; margin-right: 10px;" placeholder="鐩樼偣缁撴灉"> <el-option label="璐﹀疄鐩哥" :value="0"></el-option> @@ -48,7 +48,7 @@ </el-select> <el-button type="primary" @click="getList">鏌ヨ</el-button> <el-button @click="clear">娓呯┖</el-button> - <el-button>瀵煎嚭</el-button> + <el-button @click="exportExcel">瀵煎嚭</el-button> </div> <div class="list_search_right"> <span>宸茬洏:{{info.finishAmount || 0}}</span> @@ -60,8 +60,8 @@ </div> <div style="width: 100%; margin: 20px 0;"> <el-table :data="list" stripe> - <el-table-column prop="materialCode" label="璧勪骇缂栫爜" show-overflow-tooltip /> - <el-table-column prop="materialName" label="璧勪骇鍚嶇О" show-overflow-tooltip /> + <el-table-column prop="materialCode" label="鐗╂枡缂栫爜" show-overflow-tooltip /> + <el-table-column prop="materialName" label="鐗╂枡鍚嶇О" show-overflow-tooltip /> <el-table-column prop="materialQrcode" label="鏉$爜" show-overflow-tooltip /> <el-table-column prop="materialBrand" label="鍝佺墝" show-overflow-tooltip /> <el-table-column prop="materialAttr" label="瑙勬牸鍨嬪彿" show-overflow-tooltip /> @@ -70,8 +70,8 @@ <el-table-column prop="stock" label="璐﹂潰鏁伴噺" show-overflow-tooltip /> <el-table-column label="鐩樼偣鏁伴噺" show-overflow-tooltip> <template slot-scope="{row}"> - <span style="color: red;" v-if="row.type === 1">{{row.actStock}}</span> - <span style="color: green;" v-else-if="row.type === 2">{{row.actStock}}</span> + <span style="color: green;" v-if="row.type === 1">{{row.actStock}}</span> + <span style="color: red;" v-else-if="row.type === 2">{{row.actStock}}</span> <span v-else>{{row.actStock}}</span> </template> </el-table-column> @@ -97,7 +97,7 @@ <script> import GlobalWindow from '@/components/common/GlobalWindow' import BaseOpera from '@/components/base/BaseOpera' - import { ywStocktakingRecordPage, getById } from '@/api/ywStocktaking' + import { ywStocktakingRecordPage, getById, exportExcel } from '@/api/ywStocktaking' export default { name: "inventoryDetails", components: { @@ -120,6 +120,26 @@ } }, methods: { + exportExcel () { + this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵') + .then(() => { + exportExcel({ + page: this.page, + capacity: 1000000, + model: { + ...this.form, + stocktakingId: this.id + } + }) + .then(response => { + this.download(response) + }) + .catch(e => { + this.$tip.apiFailed(e) + }) + }) + .catch(() => {}) + }, handleSizeChange(size) { this.pageSize = size this.getList() -- Gitblit v1.9.3