From a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 06 六月 2025 19:19:34 +0800
Subject: [PATCH] 开发更新

---
 admin/src/views/stock/components/inventoryDetails.vue |  142 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 105 insertions(+), 37 deletions(-)

diff --git a/admin/src/views/stock/components/inventoryDetails.vue b/admin/src/views/stock/components/inventoryDetails.vue
index b0c6d1c..b5e7a9b 100644
--- a/admin/src/views/stock/components/inventoryDetails.vue
+++ b/admin/src/views/stock/components/inventoryDetails.vue
@@ -10,62 +10,72 @@
             <div class="list">
                 <div class="item">
                     <div class="la">鐩樼偣鍗曞悕绉�</div>
-                    <div class="val">搴撳瓨鐩樼偣20241212</div>
+                    <div class="val">{{info.name}}</div>
                 </div>
                 <div class="item">
                     <div class="la">鐩樼偣鏃ユ湡</div>
-                    <div class="val">2024-11-17</div>
+                    <div class="val">{{info.planDate}}</div>
                 </div>
                 <div class="item">
                     <div class="la">鐩樼偣浠撳簱</div>
-                    <div class="val">浠撳簱1</div>
+                    <div class="val">{{info.warehouseName}}</div>
                 </div>
                 <div class="item">
                     <div class="la">鐩樼偣鍛�</div>
-                    <div class="val">寮犱笁</div>
+                    <div class="val">{{info.userName}}</div>
                 </div>
                 <div class="item">
                     <div class="la">鐩樼偣鐘舵��</div>
-                    <div class="val">宸插畬鎴�</div>
+                    <div class="val" v-if="info.status === 0">鏈紑濮�</div>
+                    <div class="val" v-if="info.status === 1">杩涜涓�</div>
+                    <div class="val" v-if="info.status === 2">宸插畬鎴�</div>
+                    <div class="val" v-if="info.status === 3">宸插彇娑�</div>
                 </div>
             </div>
             <div class="title">鐩樼偣缁撴灉</div>
             <div class="list">
                 <div class="list_search">
                     <div class="list_search_left">
-                        <el-input v-model="input" style="width: 200px; margin-right: 10px;" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
-                        <el-select v-model="input" style="width: 200px; margin-right: 10px;" placeholder="璇烽�夋嫨">
-                            <el-option
-                                v-for="item in options"
-                                :key="item.value"
-                                :label="item.label"
-                                :value="item.value">
-                            </el-option>
+                        <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="2"></el-option>
                         </el-select>
-                        <el-button type="primary">鏌ヨ</el-button>
-                        <el-button>娓呯┖</el-button>
-                        <el-button>瀵煎嚭</el-button>
+                        <el-select v-model="form.type" style="width: 150px; margin-right: 10px;" placeholder="鐩樼偣缁撴灉">
+                            <el-option label="璐﹀疄鐩哥" :value="0"></el-option>
+                            <el-option label="鐩樹簭" :value="1"></el-option>
+                            <el-option label="鐩樼泩" :value="2"></el-option>
+                        </el-select>
+                        <el-button type="primary" @click="getList">鏌ヨ</el-button>
+                        <el-button @click="clear">娓呯┖</el-button>
+                        <el-button @click="exportExcel">瀵煎嚭</el-button>
                     </div>
                     <div class="list_search_right">
-                        <span>宸茬洏:100</span>
-                        <span>鏈洏:20</span>
-                        <span>璐﹀疄鐩哥:88</span>
-                        <span>鐩樼泩:2</span>
-                        <span>鐩樹簭:20</span>
+                        <span>宸茬洏:{{info.finishAmount || 0}}</span>
+                        <span>鏈洏:{{info.unFinishAmount || 0}}</span>
+                        <span>璐﹀疄鐩哥:{{info.equalAmount || 0}}</span>
+                        <span>鐩樼泩:{{info.profitAmount || 0}}</span>
+                        <span>鐩樹簭:{{info.lossAmount || 0}}</span>
                     </div>
                 </div>
                 <div style="width: 100%; margin: 20px 0;">
-                    <el-table :data="roomList" stripe>
-                        <el-table-column prop="projectName" label="璧勪骇缂栫爜" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="璧勪骇鍚嶇О" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="鏉$爜" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="鍝佺墝" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="瑙勬牸鍨嬪彿" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="鍗曚綅" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="鎵�鍦ㄤ粨搴�" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="璐﹂潰鏁伴噺" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="鐩樼偣鏁伴噺" show-overflow-tooltip />
-                        <el-table-column prop="buildingName" label="澶囨敞" show-overflow-tooltip />
+                    <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="materialQrcode" label="鏉$爜" show-overflow-tooltip />
+                        <el-table-column prop="materialBrand" label="鍝佺墝" show-overflow-tooltip />
+                        <el-table-column prop="materialAttr" label="瑙勬牸鍨嬪彿" show-overflow-tooltip />
+                        <el-table-column prop="materialUnitName" label="鍗曚綅" show-overflow-tooltip />
+                        <el-table-column prop="warehouseName" label="鎵�鍦ㄤ粨搴�" show-overflow-tooltip />
+                        <el-table-column prop="stock" label="璐﹂潰鏁伴噺" show-overflow-tooltip />
+                        <el-table-column label="鐩樼偣鏁伴噺" show-overflow-tooltip>
+                            <template slot-scope="{row}">
+                                <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>
+                        <el-table-column prop="remark" label="澶囨敞" show-overflow-tooltip />
                     </el-table>
                 </div>
                 <div class="list_pagination">
@@ -87,6 +97,7 @@
 <script>
   import GlobalWindow from '@/components/common/GlobalWindow'
   import BaseOpera from '@/components/base/BaseOpera'
+  import { ywStocktakingRecordPage, getById, exportExcel } from '@/api/ywStocktaking'
   export default {
     name: "inventoryDetails",
     components: {
@@ -95,26 +106,83 @@
     extends: BaseOpera,
     data() {
       return {
+        id: null,
         info: {},
-        input: '',
-        options: [],
-        roomList: [],
-
+        list: [],
+        form: {
+          materialCode: '',
+          status: '',
+          type: ''
+        },
         pageSize: 10,
         total: 0,
         page: 1
       }
     },
     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()
       },
       handleCurrentChange(page) {
         this.page = page
+        this.getList()
       },
-      open (title) {
+      open (title, id) {
         this.title = title
         this.visible = true
+        this.id = id
+        this.getDetails()
+        this.getList()
+      },
+      getDetails() {
+        getById(this.id)
+            .then(res => {
+              this.info = res
+            })
+      },
+      clear() {
+        this.form.name = ''
+        this.form.status = ''
+        this.form.type = ''
+        this.form.materialCode = ''
+        this.page = 1
+        this.getList()
+      },
+      getList() {
+        ywStocktakingRecordPage({
+          capacity: this.pageSize,
+          page: this.page,
+          model: {
+            stocktakingId: this.id,
+            materialCode: this.form.materialCode,
+            status: this.form.status,
+            type: this.form.type
+          }
+        }).then(res => {
+          this.list = res.records
+          this.total = res.total
+        })
       }
     }
   }

--
Gitblit v1.9.3