From da57fbd8e7fa021614fb32502fb1520ea4e34e1e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 18 五月 2026 11:35:16 +0800
Subject: [PATCH] 浪潮 1.样式修改

---
 src/views/inventoryManagement/dispatchLog/Record.vue | 1418 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 1,040 insertions(+), 378 deletions(-)

diff --git a/src/views/inventoryManagement/dispatchLog/Record.vue b/src/views/inventoryManagement/dispatchLog/Record.vue
index 1637226..7475352 100644
--- a/src/views/inventoryManagement/dispatchLog/Record.vue
+++ b/src/views/inventoryManagement/dispatchLog/Record.vue
@@ -1,119 +1,297 @@
 <template>
-	<div class="app-container">
-		<div class="search_form">
-			<div>
-				<span class="search_title ml10">鍑哄簱鏃ユ湡锛�</span>
-				<el-date-picker
-					v-model="searchForm.timeStr"
-					type="date"
-					placeholder="璇烽�夋嫨鏃ユ湡"
-					value-format="YYYY-MM-DD"
-					format="YYYY-MM-DD"
-					clearable
-					@change="handleQuery"
-				/>
-        <span class="search_title ml10">鏉ユ簮锛�</span>
-        <el-select v-model="searchForm.recordType"
-                   style="width: 240px"
-                   placeholder="璇烽�夋嫨"
-                   clearable>
-          <el-option v-for="item in stockRecordTypeOptions"
-                     :key="item.value"
-                     :label="item.label"
-                     :value="item.value"/>
-        </el-select>
-				<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
-				>鎼滅储</el-button
-				>
-			</div>
-			<div>
-				<el-button @click="handleOut">瀵煎嚭</el-button>
-				<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
-				<el-button type="primary" plain @click="handlePrint">鎵撳嵃</el-button>
-			</div>
-		</div>
-		<div class="table_list">
-			<el-table
-				:data="tableData"
-				border
-				v-loading="tableLoading"
-				@selection-change="handleSelectionChange"
-				:expand-row-keys="expandedRowKeys"
-				:row-key="(row) => row.id"
-				style="width: 100%"
-				height="calc(100vh - 18.5em)"
-			>
-				<el-table-column align="center" type="selection" width="55" />
-				<el-table-column align="center" label="搴忓彿" type="index" width="60" />
-        <el-table-column
-            label="鍑哄簱鎵规"
-            prop="outboundBatches"
-            min-width="100"
-            show-overflow-tooltip
+  <div>
+    <div class="search_form" style="margin-bottom: 10px">
+      <div>
+        <span class="search_title ml10">鍑哄簱鏃ユ湡锛�</span>
+        <el-date-picker
+          v-model="searchForm.timeStr"
+          type="date"
+          placeholder="璇烽�夋嫨鏃ユ湡"
+          value-format="YYYY-MM-DD"
+          format="YYYY-MM-DD"
+          clearable
+          @change="handleQuery"
         />
-				<el-table-column
-					label="鍑哄簱鏃ユ湡"
-					prop="createTime"
-					show-overflow-tooltip
-				/>
-				<el-table-column
-					label="浜у搧澶х被"
-					prop="productName"
-					show-overflow-tooltip
-				/>
-				<el-table-column
-					label="瑙勬牸鍨嬪彿"
-					prop="model"
-					show-overflow-tooltip
-				/>
-				<el-table-column
-					label="鍗曚綅"
-					prop="unit"
-					show-overflow-tooltip
-				/>
-				<el-table-column
-					label="鍑哄簱鏁伴噺"
-					prop="stockOutNum"
-					show-overflow-tooltip
-				/>
-				<el-table-column
-					label="鍑哄簱浜�"
-					prop="createBy"
-					show-overflow-tooltip
-				/>
-        <el-table-column label="鏉ユ簮"
-                         prop="recordType"
-                         show-overflow-tooltip>
+        <span class="search_title ml10">鏉ユ簮锛�</span>
+        <el-select
+          v-model="searchForm.recordType"
+          style="width: 240px"
+          placeholder="璇烽�夋嫨"
+          clearable
+        >
+          <el-option
+            v-for="item in stockRecordTypeOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
+          >鎼滅储</el-button
+        >
+      </div>
+      <div>
+        <el-button type="primary" @click="handleAdd">鏂板</el-button>
+        <el-button type="primary" @click="handleBatchApprove">瀹℃壒</el-button>
+        <el-button @click="handleOut">瀵煎嚭</el-button>
+        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+        <el-button type="primary" plain @click="handlePrint">鎵撳嵃</el-button>
+      </div>
+    </div>
+    <div class="table_list">
+      <el-table
+        :data="tableData"
+        border
+        v-loading="tableLoading"
+        @selection-change="handleSelectionChange"
+        :expand-row-keys="expandedRowKeys"
+        :row-key="(row) => row.id"
+        style="width: 100%"
+        height="calc(100vh - 18.5em)"
+      >
+        <el-table-column align="center" type="selection" width="55" />
+        <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+        <el-table-column
+          label="鍑哄簱鎵规"
+          prop="outboundBatches"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="鍑哄簱鏃ユ湡"
+          prop="createTime"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="浜у搧澶х被"
+          prop="productName"
+          show-overflow-tooltip
+        />
+        <el-table-column label="瑙勬牸鍨嬪彿" prop="model" show-overflow-tooltip />
+        <el-table-column label="搴撲綅" prop="warehouseName" show-overflow-tooltip />
+        <el-table-column label="鎵瑰彿" prop="batchNo" show-overflow-tooltip />
+        <el-table-column label="鍗曚綅" prop="unit" show-overflow-tooltip />
+        <el-table-column
+          label="鍑哄簱鏁伴噺"
+          prop="stockOutNum"
+          show-overflow-tooltip
+        />
+        <el-table-column label="鍑哄簱浜�" prop="createBy" show-overflow-tooltip />
+        <el-table-column label="鏉ユ簮" prop="recordType" show-overflow-tooltip>
           <template #default="scope">
             {{ getRecordType(scope.row.recordType) }}
           </template>
         </el-table-column>
-			</el-table>
-			<pagination
-				v-show="total > 0"
-				:total="total"
-				layout="total, sizes, prev, pager, next, jumper"
-				:page="page.current"
-				:limit="page.size"
-				@pagination="paginationChange"
-			/>
-		</div>
-	</div>
+        <el-table-column
+          label="瀹℃壒鐘舵��"
+          prop="approvalStatus"
+          show-overflow-tooltip
+        >
+          <template #default="scope">
+            <el-tag
+              :type="getApprovalStatusTagType(scope.row.approvalStatus)"
+              size="small"
+            >
+              {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="鎿嶄綔" width="120" align="center" fixed="right">
+          <template #default="scope">
+            <el-button 
+              v-if="scope.row.approvalStatus !== 1 && scope.row.approvalStatus !== '1' && scope.row.approvalStatus !== 'approved' && scope.row.approvalStatus !== 'APPROVED'"
+              link 
+              type="primary" 
+              size="small" 
+              @click="handleEdit(scope.row)">缂栬緫</el-button>
+            <span v-else style="color: #999; font-size: 12px;">宸查�氳繃</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        layout="total, sizes, prev, pager, next, jumper"
+        :page="page.current"
+        :limit="page.size"
+        @pagination="paginationChange"
+      />
+    </div>
+
+    <!-- 鏂板/缂栬緫瀵硅瘽妗� -->
+    <el-dialog v-model="dialogVisible"
+               :title="dialogTitle"
+               width="800"
+               @close="closeDialog">
+      <el-form ref="formRef"
+               :model="formState"
+               label-width="140px"
+               label-position="top">
+        <el-form-item label="浜у搧鍚嶇О"
+                      prop="productModelId"
+                      :rules="[
+                        {
+                          required: true,
+                          message: '璇烽�夋嫨浜у搧',
+                          trigger: 'change',
+                        }
+                      ]">
+          <el-button type="primary"
+                     @click="showProductSelect = true">
+            {{ formState.productName ? formState.productName : '閫夋嫨浜у搧' }}
+          </el-button>
+        </el-form-item>
+        <el-form-item label="瑙勬牸"
+                      prop="productModelName">
+          <el-input v-model="formState.productModelName" disabled />
+        </el-form-item>
+        <el-form-item label="鍗曚綅"
+                      prop="unit">
+          <el-input v-model="formState.unit" disabled />
+        </el-form-item>
+        <el-form-item label="浠撳簱"
+                      prop="warehouseInfoId"
+                      :rules="[
+                        {
+                          required: true,
+                          message: '璇烽�夋嫨浠撳簱',
+                          trigger: 'change',
+                        }
+                      ]">
+          <el-select v-model="formState.warehouseInfoId"
+                     placeholder="璇烽�夋嫨浠撳簱"
+                     clearable
+                     @change="handleWarehouseChange"
+                     style="width: 100%">
+            <el-option v-for="warehouse in warehouseList"
+                       :key="warehouse.id"
+                       :label="warehouse.warehouseName"
+                       :value="warehouse.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鎵瑰彿"
+                      prop="batchNo"
+                      :rules="[
+                        {
+                          required: true,
+                          message: '璇烽�夋嫨鎵瑰彿',
+                          trigger: 'change',
+                        }
+                      ]">
+          <el-select v-model="formState.batchNo"
+                     placeholder="璇烽�夋嫨鎵瑰彿"
+                     clearable
+                     @change="handleBatchNoChange"
+                     style="width: 100%">
+            <el-option v-for="batch in batchNoList"
+                       :key="batch"
+                       :label="batch + ' (搴撳瓨: ' + (batchNoStockMap[batch] || 0) + ')'"
+                       :value="batch" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formState.batchNo && batchNoStockMap[formState.batchNo] !== undefined"
+                      label="褰撳墠鎵瑰彿搴撳瓨"
+                      prop="currentStock">
+          <el-input :model-value="batchNoStockMap[formState.batchNo]" disabled />
+        </el-form-item>
+        <el-form-item label="鍑哄簱鏁伴噺"
+                      prop="qualitity"
+                      :rules="[
+                        {
+                          required: true,
+                          message: '璇疯緭鍏ュ嚭搴撴暟閲�',
+                          trigger: 'blur',
+                        },
+                        {
+                          validator: (rule, value, callback) => {
+                            if (formState.maxStock > 0 && value > formState.maxStock) {
+                              callback('鍑哄簱鏁伴噺涓嶈兘瓒呰繃褰撳墠鎵瑰彿搴撳瓨 ' + formState.maxStock);
+                            } else {
+                              callback();
+                            }
+                          },
+                          trigger: 'blur',
+                        }
+                      ]">
+          <el-input-number v-model="formState.qualitity"
+                           :step="1"
+                           :min="1"
+                           :max="formState.maxStock > 0 ? formState.maxStock : undefined"
+                           style="width: 100%" />
+        </el-form-item>
+        <el-form-item v-if="isEdit"
+                      label="鏉ユ簮"
+                      prop="recordType">
+          <el-select v-model="formState.recordType"
+                     placeholder="璇烽�夋嫨鏉ユ簮"
+                     disabled>
+            <el-option v-for="item in stockRecordTypeOptions"
+                       :key="item.value"
+                       :label="item.label"
+                       :value="item.value" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="搴撳瓨绫诲瀷"
+                      prop="type"
+                      :rules="[
+                        {
+                          required: true,
+                          message: '璇烽�夋嫨搴撳瓨绫诲瀷',
+                          trigger: 'change',
+                        }
+                      ]">
+          <el-select v-model="formState.type"
+                     placeholder="璇烽�夋嫨搴撳瓨绫诲瀷"
+                     >
+            <el-option label="鍚堟牸搴撳瓨"
+                       value="qualified" />
+            <el-option label="涓嶅悎鏍煎簱瀛�"
+                       value="unqualified" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="澶囨敞"
+                      prop="remark">
+          <el-input v-model="formState.remark"
+                    type="textarea" />
+        </el-form-item>
+      </el-form>
+      <!-- 浜у搧閫夋嫨寮圭獥 -->
+      <ProductSelectDialog v-model="showProductSelect"
+                           @confirm="handleProductSelect"
+                           :top-product-parent-id="props.topParentProductId"
+                           request-url="/basic/product/pageModelAndQua"
+                           single />
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="handleSubmit">纭</el-button>
+          <el-button @click="closeDialog">鍙栨秷</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
 </template>
 
 <script setup>
 import pagination from "@/components/PIMTable/Pagination.vue";
-import { ref } from "vue";
-import { ElMessageBox } from "element-plus";
+import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
+import { ref, reactive, toRefs, computed, getCurrentInstance, watch, onMounted } from "vue";
+import { ElMessageBox, ElMessage } from "element-plus";
 import useUserStore from "@/store/modules/user";
 import { getCurrentDate } from "@/utils/index.js";
 import {
-	getStockOutPage,
-	delStockOut,
+  getStockOutPage,
+  delPendingStockOut,
+  batchApproveStockOutRecords,
+  updateStockOutRecord,
 } from "@/api/inventoryManagement/stockOut.js";
 import {
-  findAllQualifiedStockOutRecordTypeOptions, findAllUnQualifiedStockOutRecordTypeOptions,
+  findAllQualifiedStockOutRecordTypeOptions,
+  findAllUnQualifiedStockOutRecordTypeOptions,
 } from "@/api/basicData/enum.js";
+import { addStockOutRecordOnly, getStockInventoryByModelId } from "@/api/inventoryManagement/stockInventory.js";
+import { addUnqualifiedStockOutRecordOnly } from "@/api/inventoryManagement/stockUninventory.js";
+import { getWarehouseList } from "@/api/inventoryManagement/warehouse.js";
+import { productModelListByUrl } from "@/api/basicData/productModel.js";
 
 const userStore = useUserStore();
 const { proxy } = getCurrentInstance();
@@ -122,9 +300,17 @@
 const tableLoading = ref(false);
 // 鏉ユ簮绫诲瀷閫夐」
 const stockRecordTypeOptions = ref([]);
+// 鎵瑰彿鍒楄〃锛堜粠batchNoMaps鑾峰彇锛�
+const batchNoList = ref([]);
+// 鎵瑰彿搴撳瓨鏄犲皠
+const batchNoStockMap = ref({});
+// 浠撳簱鍒楄〃
+const warehouseList = ref([]);
+// 鍘熷batchNoMaps鏁版嵁
+const rawBatchNoMaps = ref({});
 const page = reactive({
-	current: 1,
-	size: 100,
+  current: 1,
+  size: 100,
 });
 const total = ref(0);
 
@@ -132,9 +318,13 @@
   type: {
     type: String,
     required: true,
-    default: '0'
-  }
-})
+    default: "0",
+  },
+  topParentProductId: {
+    type: [String, Number],
+    default: undefined,
+  },
+});
 
 // 鎵撳嵃鐩稿叧
 const printPreviewVisible = ref(false);
@@ -142,129 +332,593 @@
 
 // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
 const data = reactive({
-	searchForm: {
-		supplierName: "",
-		timeStr: "",
+  searchForm: {
+    supplierName: "",
+    timeStr: "",
     recordType: "",
-	}
+  },
 });
 const { searchForm } = toRefs(data);
+
+// 瀵硅瘽妗嗙浉鍏�
+const dialogVisible = ref(false);
+const dialogType = ref('add'); // 'add' 鎴� 'edit'
+const dialogTitle = computed(() => dialogType.value === 'add' ? '鏂板鍑哄簱璁板綍' : '缂栬緫鍑哄簱璁板綍');
+const isEdit = computed(() => dialogType.value === 'edit');
+const formRef = ref();
+const showProductSelect = ref(false);
+
+// 琛ㄥ崟鏁版嵁
+const formState = ref({
+  id: undefined,
+  productId: undefined,
+  productModelId: undefined,
+  productName: "",
+  productModelName: "",
+  unit: "",
+  warehouseInfoId: null, // 浠撳簱ID
+  type: undefined,
+  qualitity: 0,
+  batchNo: null,
+  recordType: "",
+  remark: "",
+  maxStock: 0, // 褰撳墠閫変腑鎵瑰彿鐨勬渶澶у簱瀛�
+});
+
+// 鎵瑰彿涓虹┖鏃惰浆涓� null
+watch(
+  () => formState.value.batchNo,
+  val => {
+    if (val === "") {
+      formState.value.batchNo = null;
+    }
+  }
+);
 
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 const handleQuery = () => {
-	page.current = 1;
-	getList();
+  page.current = 1;
+  getList();
 };
 const paginationChange = (obj) => {
-	page.current = obj.page;
-	page.size = obj.limit;
-	getList();
+  page.current = obj.page;
+  page.size = obj.limit;
+  getList();
 };
 const getList = () => {
-	tableLoading.value = true;
-	getStockOutPage({ ...searchForm.value, ...page, type: props.type })
-		.then((res) => {
-			tableLoading.value = false;
-			tableData.value = res.data.records;
-			tableData.value.map((item) => {
-				item.children = [];
-			});
-			total.value = res.data.total;
-		})
-		.catch(() => {
-			tableLoading.value = false;
-		});
+  tableLoading.value = true;
+  getStockOutPage({
+    ...searchForm.value,
+    ...page,
+    topParentProductId: props.topParentProductId,
+  })
+    .then((res) => {
+      tableLoading.value = false;
+      tableData.value = res.data.records;
+      tableData.value.map((item) => {
+        item.children = [];
+      });
+      total.value = res.data.total;
+    })
+    .catch(() => {
+      tableLoading.value = false;
+    });
 };
 
 const getRecordType = (recordType) => {
-  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
-}
+  return (
+    stockRecordTypeOptions.value.find((item) => item.value === recordType)
+      ?.label || ""
+  );
+};
+
+const approvalStatusLabelMap = {
+  0: "寰呭鎵�",
+  1: "閫氳繃",
+  2: "椹冲洖",
+  3: "寰呯‘璁�",
+  pending: "寰呭鎵�",
+  approved: "閫氳繃",
+  rejected: "椹冲洖",
+  PENDING: "寰呭鎵�",
+  APPROVED: "閫氳繃",
+  REJECTED: "椹冲洖",
+};
+
+const getApprovalStatusLabel = (status) => {
+  if (status === null || status === undefined || status === "") {
+    return "寰呭鎵�";
+  }
+  return approvalStatusLabelMap[status] || "寰呭鎵�";
+};
+
+// 閫氳繃/椹冲洖鍥哄畾鑹诧紱鍏朵綑锛堝惈寰呭鎵广�佺┖鍊笺�佹湭鏄犲皠浣嗘枃妗堜负寰呭鎵癸級缁熶竴鐢� warning 棰勮鑹�
+const getApprovalStatusTagType = (status) => {
+  if (
+    status === 1 ||
+    status === "1" ||
+    status === "approved" ||
+    status === "APPROVED"
+  )
+    return "success";
+  if (
+    status === 2 ||
+    status === "2" ||
+    status === "rejected" ||
+    status === "REJECTED"
+  )
+    return "danger";
+  return "warning";
+};
+
+// 鏂板
+const handleAdd = () => {
+  dialogType.value = 'add';
+  resetForm();
+  // 鏍规嵁褰撳墠tab璁剧疆榛樿搴撳瓨绫诲瀷
+  formState.value.type = props.type === '0' ? 'qualified' : 'unqualified';
+  dialogVisible.value = true;
+};
+
+// 缂栬緫
+const handleEdit = async (row) => {
+  dialogType.value = 'edit';
+  resetForm();
+
+  // 鍏堝姞杞芥墍鏈夋暟鎹紝鏈�鍚庡啀璧嬪�� formState
+  let loadedWarehouseList = [];
+  let loadedBatchNoList = [];
+  let loadedBatchNoStockMap = {};
+  let loadedMaxStock = 0;
+  let loadedRawBatchNoMaps = {};
+
+  // 缂栬緫鏃跺姞杞戒粨搴撳垪琛�
+  if (row.warehouseInfoId) {
+    const allWarehouses = await loadWarehouseList();
+    const currentWarehouse = allWarehouses.find(w => String(w.id) === String(row.warehouseInfoId));
+    if (currentWarehouse) {
+      loadedWarehouseList = [{
+        id: currentWarehouse.id,
+        warehouseName: currentWarehouse.warehouseName || currentWarehouse.name || currentWarehouse.warehouseCode || `浠撳簱${currentWarehouse.id}`
+      }];
+    }
+  }
+
+  // 缂栬緫鏃舵煡璇骇鍝佸簱瀛�
+  if (row.productModelId) {
+    try {
+      console.log('缂栬緫鏃舵煡璇㈠簱瀛橈紝productModelId:', row.productModelId);
+      console.log('褰撳墠row鏁版嵁:', row);
+      const res = await productModelListByUrl('/basic/product/pageModelAndQua', {
+        id: row.productModelId,
+        page: 1,
+        size: 1
+      });
+      console.log('鏌ヨ搴撳瓨鎺ュ彛杩斿洖:', res);
+      // 鎺ュ彛鐩存帴杩斿洖 {records: [], total: ...}锛屾病鏈� data 灞傚拰 code
+      const records = res.records || (res.data && res.data.records) || [];
+      if (records.length > 0) {
+        const product = records[0];
+        console.log('浜у搧鏁版嵁:', product);
+        console.log('batchNoMaps:', product.batchNoMaps);
+        if (product.batchNoMaps && Object.keys(product.batchNoMaps).length > 0) {
+          loadedRawBatchNoMaps = product.batchNoMaps;
+          // 鑾峰彇鎵�鏈変粨搴撲俊鎭敤浜庡弽鏄惧悕绉�
+          const allWarehouses = await loadWarehouseList();
+          const warehouseMap = {};
+          allWarehouses.forEach(w => {
+            warehouseMap[w.id] = w.warehouseName || w.name || w.warehouseCode || `浠撳簱${w.id}`;
+          });
+          // 鏋勫缓浠撳簱鍒楄〃锛岀‘淇濆寘鍚綋鍓嶈褰曠殑浠撳簱
+          const warehouseIds = Object.keys(product.batchNoMaps);
+          // 濡傛灉褰撳墠璁板綍鐨勪粨搴撲笉鍦� product.batchNoMaps 涓紝娣诲姞杩涘幓
+          if (row.warehouseInfoId && !warehouseIds.some(id => String(id) === String(row.warehouseInfoId))) {
+            warehouseIds.push(String(row.warehouseInfoId));
+          }
+          loadedWarehouseList = warehouseIds.map(warehouseInfoId => ({
+            id: warehouseInfoId,
+            warehouseName: warehouseMap[warehouseInfoId] || `浠撳簱${warehouseInfoId}`
+          }));
+          console.log('褰撳墠浠撳簱ID:', row.warehouseInfoId);
+          console.log('璇ヤ粨搴撶殑batchNoMaps:', product.batchNoMaps[row.warehouseInfoId]);
+          // 濡傛灉褰撳墠鏈変粨搴揑D锛岃В鏋愯浠撳簱鐨勬壒鍙峰簱瀛橈紙澶勭悊绫诲瀷涓嶅尮閰嶉棶棰橈級
+          let batchArray = null;
+          if (row.warehouseInfoId) {
+            // 灏濊瘯澶氱鏂瑰紡鑾峰彇鎵瑰彿鏁版嵁
+            batchArray = product.batchNoMaps[row.warehouseInfoId] ||
+                        product.batchNoMaps[String(row.warehouseInfoId)] ||
+                        product.batchNoMaps[Number(row.warehouseInfoId)];
+          }
+          if (batchArray) {
+            console.log('batchArray:', batchArray);
+            const batchMap = {};
+            const batches = [];
+            batchArray.forEach(item => {
+              const batchNo = Object.keys(item)[0];
+              const stock = item[batchNo];
+              console.log('鎵瑰彿:', batchNo, '搴撳瓨:', stock);
+              batches.push(batchNo);
+              batchMap[batchNo] = stock;
+            });
+            loadedBatchNoList = batches;
+            loadedBatchNoStockMap = batchMap;
+            console.log('batchMap:', batchMap);
+            console.log('褰撳墠鎵瑰彿:', row.batchNo);
+            // 璁剧疆褰撳墠鎵瑰彿鐨勫簱瀛�
+            if (row.batchNo && batchMap[row.batchNo] !== undefined) {
+              loadedMaxStock = batchMap[row.batchNo];
+              console.log('璁剧疆maxStock涓�:', loadedMaxStock);
+            } else {
+              console.log('鏈壘鍒板綋鍓嶆壒鍙风殑搴撳瓨');
+              loadedMaxStock = 0;
+            }
+          } else {
+            console.log('鏈壘鍒板綋鍓嶄粨搴撶殑batchNoMaps');
+            loadedBatchNoList = row.batchNo ? [row.batchNo] : [];
+            loadedBatchNoStockMap = {};
+            loadedMaxStock = 0;
+          }
+        } else {
+          console.log('浜у搧娌℃湁batchNoMaps');
+          loadedBatchNoList = row.batchNo ? [row.batchNo] : [];
+          loadedBatchNoStockMap = {};
+          loadedMaxStock = 0;
+        }
+      } else {
+        console.log('鎺ュ彛杩斿洖鏁版嵁寮傚父:', res);
+        loadedBatchNoList = row.batchNo ? [row.batchNo] : [];
+        loadedBatchNoStockMap = {};
+        loadedMaxStock = 0;
+      }
+    } catch (error) {
+      console.error('鏌ヨ浜у搧搴撳瓨澶辫触', error);
+      loadedBatchNoList = row.batchNo ? [row.batchNo] : [];
+      loadedBatchNoStockMap = {};
+      loadedMaxStock = 0;
+    }
+  } else {
+    console.log('娌℃湁productModelId');
+    loadedBatchNoList = row.batchNo ? [row.batchNo] : [];
+    loadedBatchNoStockMap = {};
+    loadedMaxStock = 0;
+  }
+
+  // 鎵�鏈夋暟鎹姞杞藉畬鎴愬悗锛屼竴娆℃�ц祴鍊�
+  warehouseList.value = loadedWarehouseList;
+  batchNoList.value = loadedBatchNoList;
+  batchNoStockMap.value = loadedBatchNoStockMap;
+  rawBatchNoMaps.value = loadedRawBatchNoMaps;
+
+  // 鏈�鍚庤祴鍊� formState锛岀‘淇濅粨搴撳垪琛ㄥ凡缁忓噯澶囧ソ
+  // 娉ㄦ剰锛氬皢 warehouseInfoId 杞崲涓哄瓧绗︿覆锛岀‘淇濅笌 warehouseList 涓殑 id 绫诲瀷鍖归厤
+  formState.value = {
+    id: row.id,
+    productId: row.productId,
+    productModelId: row.productModelId,
+    productName: row.productName,
+    productModelName: row.model,
+    unit: row.unit,
+    type: props.type === '0' ? 'qualified' : 'unqualified',
+    qualitity: row.stockOutNum,
+    batchNo: row.batchNo,
+    warehouseInfoId: row.warehouseInfoId != null ? String(row.warehouseInfoId) : null,
+    recordType: row.recordType,
+    remark: row.remark || "",
+    maxStock: loadedMaxStock,
+  };
+
+  // 鎵�鏈夋暟鎹姞杞藉畬鎴愬悗鍐嶆樉绀哄脊绐�
+  dialogVisible.value = true;
+};
+
+// 閲嶇疆琛ㄥ崟
+const resetForm = () => {
+  formState.value = {
+    id: undefined,
+    productId: undefined,
+    productModelId: undefined,
+    productName: "",
+    productModelName: "",
+    unit: "",
+    warehouseInfoId: null,
+    type: undefined,
+    qualitity: 0,
+    batchNo: null,
+    recordType: "",
+    remark: "",
+    maxStock: 0,
+  };
+  warehouseList.value = [];
+  batchNoList.value = [];
+  batchNoStockMap.value = {};
+  rawBatchNoMaps.value = {};
+};
+
+// 鍏抽棴瀵硅瘽妗�
+const closeDialog = () => {
+  dialogVisible.value = false;
+  resetForm();
+};
+
+// 鍔犺浇浠撳簱鍒楄〃
+const loadWarehouseList = async () => {
+  try {
+    const res = await getWarehouseList();
+    if (res.code === 200) {
+      return res.data || [];
+    }
+  } catch (error) {
+    console.error('鍔犺浇浠撳簱鍒楄〃澶辫触', error);
+  }
+  return [];
+};
+
+// 浜у搧閫夋嫨澶勭悊
+const handleProductSelect = async products => {
+  if (products && products.length > 0) {
+    const product = products[0];
+    formState.value.productId = product.productId;
+    formState.value.productName = product.productName;
+    formState.value.productModelName = product.model;
+    formState.value.productModelId = product.id;
+    formState.value.unit = product.unit;
+    // 瑙f瀽batchNoMaps鏁版嵁锛屾牸寮忎负锛歿 浠撳簱ID: [{鎵瑰彿: 搴撳瓨}, {鎵瑰彿: 搴撳瓨}] }
+    warehouseList.value = [];
+    batchNoList.value = [];
+    batchNoStockMap.value = {};
+    rawBatchNoMaps.value = {};
+    formState.value.warehouseInfoId = null;
+    formState.value.batchNo = null;
+    formState.value.maxStock = 0;
+
+    if (product.batchNoMaps && Object.keys(product.batchNoMaps).length > 0) {
+      rawBatchNoMaps.value = product.batchNoMaps;
+      // 鑾峰彇鎵�鏈変粨搴撲俊鎭敤浜庡弽鏄惧悕绉�
+      const allWarehouses = await loadWarehouseList();
+      const warehouseMap = {};
+      allWarehouses.forEach(w => {
+        warehouseMap[w.id] = w.warehouseName || w.name || w.warehouseCode || `浠撳簱${w.id}`;
+      });
+      // 鏋勫缓浠撳簱鍒楄〃
+      warehouseList.value = Object.keys(product.batchNoMaps).map(warehouseInfoId => ({
+        id: warehouseInfoId,
+        warehouseName: warehouseMap[warehouseInfoId] || `浠撳簱${warehouseInfoId}`
+      }));
+    }
+    showProductSelect.value = false;
+    // 瑙﹀彂琛ㄥ崟楠岃瘉鏇存柊
+    proxy.$refs["formRef"]?.validateField("productModelId");
+  }
+};
+
+// 浠撳簱閫夋嫨鍙樺寲澶勭悊
+const handleWarehouseChange = (warehouseInfoId) => {
+  batchNoList.value = [];
+  batchNoStockMap.value = {};
+  formState.value.batchNo = null;
+  formState.value.maxStock = 0;
+
+  if (warehouseInfoId && rawBatchNoMaps.value[warehouseInfoId]) {
+    // 瑙f瀽璇ヤ粨搴撲笅鐨勬壒鍙锋暟鎹紝鏍煎紡涓猴細[{鎵瑰彿: 搴撳瓨}, {鎵瑰彿: 搴撳瓨}]
+    const batchArray = rawBatchNoMaps.value[warehouseInfoId];
+    const batchMap = {};
+    const batches = [];
+
+    batchArray.forEach(item => {
+      const batchNo = Object.keys(item)[0];
+      const stock = item[batchNo];
+      batches.push(batchNo);
+      batchMap[batchNo] = stock;
+    });
+
+    batchNoList.value = batches;
+    batchNoStockMap.value = batchMap;
+  }
+};
+
+// 鎵瑰彿閫夋嫨鍙樺寲澶勭悊
+const handleBatchNoChange = (batchNo) => {
+  if (batchNo && batchNoStockMap.value[batchNo]) {
+    formState.value.maxStock = batchNoStockMap.value[batchNo];
+    // 濡傛灉褰撳墠鍑哄簱鏁伴噺瓒呰繃鏈�澶у簱瀛橈紝鑷姩璋冩暣涓烘渶澶у簱瀛�
+    if (formState.value.qualitity > formState.value.maxStock) {
+      formState.value.qualitity = formState.value.maxStock;
+    }
+  } else {
+    formState.value.maxStock = 0;
+  }
+};
+
+// 鎻愪氦琛ㄥ崟
+const handleSubmit = () => {
+  proxy.$refs["formRef"].validate(valid => {
+    if (valid) {
+      // 楠岃瘉鏄惁閫夋嫨浜嗕骇鍝�
+      if (!formState.value.productModelId) {
+        ElMessage.error("璇烽�夋嫨浜у搧");
+        return;
+      }
+
+      if (dialogType.value === 'add') {
+        submitAdd();
+      } else {
+        submitEdit();
+      }
+    }
+  });
+};
+
+// 鎻愪氦鏂板
+const submitAdd = () => {
+  const params = { ...formState.value };
+
+  if (formState.value.type === "qualified") {
+    addStockOutRecordOnly(params).then(res => {
+      ElMessage.success("鏂板鎴愬姛");
+      closeDialog();
+      getList();
+    }).catch(() => {
+      ElMessage.error("鏂板澶辫触");
+    });
+  } else {
+    addUnqualifiedStockOutRecordOnly(params).then(res => {
+      ElMessage.success("鏂板鎴愬姛");
+      closeDialog();
+      getList();
+    }).catch(() => {
+      ElMessage.error("鏂板澶辫触");
+    });
+  }
+};
+
+// 鎻愪氦缂栬緫
+const submitEdit = () => {
+  const params = {
+    productId: formState.value.productId,
+    productModelId: formState.value.productModelId,
+    productName: formState.value.productName,
+    model: formState.value.productModelName,
+    unit: formState.value.unit,
+    batchNo: formState.value.batchNo,
+    stockOutNum: formState.value.qualitity,
+    recordType: formState.value.recordType,
+    remark: formState.value.remark,
+  };
+
+  updateStockOutRecord(formState.value.id, params).then(() => {
+    ElMessage.success("缂栬緫鎴愬姛");
+    closeDialog();
+    getList();
+  }).catch(() => {
+    ElMessage.error("缂栬緫澶辫触");
+  });
+};
 
 // 鑾峰彇鏉ユ簮绫诲瀷閫夐」
 const fetchStockRecordTypeOptions = () => {
-  if (props.type === '0') {
-    findAllQualifiedStockOutRecordTypeOptions()
-        .then(res => {
-          stockRecordTypeOptions.value = res.data;
-        })
-    return
+  if (props.type === "0") {
+    findAllQualifiedStockOutRecordTypeOptions().then((res) => {
+      stockRecordTypeOptions.value = res.data;
+    });
+    return;
   }
-  findAllUnQualifiedStockOutRecordTypeOptions()
-      .then(res => {
-        stockRecordTypeOptions.value = res.data;
-      })
-}
+  findAllUnQualifiedStockOutRecordTypeOptions().then((res) => {
+    stockRecordTypeOptions.value = res.data;
+  });
+};
 
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = (selection) => {
-	// 杩囨护鎺夊瓙鏁版嵁
-	selectedRows.value = selection.filter((item) => item.id);
-	console.log("selection", selectedRows.value);
+  // 杩囨护鎺夊瓙鏁版嵁
+  selectedRows.value = selection.filter((item) => item.id);
+  console.log("selection", selectedRows.value);
 };
 const expandedRowKeys = ref([]);
 
+const handleBatchApprove = () => {
+  if (selectedRows.value.length === 0) {
+    proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+    return;
+  }
+  const ids = selectedRows.value.map((item) => item.id);
+  ElMessageBox.confirm("璇烽�夋嫨瀹℃壒缁撴灉", "瀹℃壒", {
+    confirmButtonText: "閫氳繃",
+    cancelButtonText: "椹冲洖",
+    type: "warning",
+    distinguishCancelAndClose: true,
+  })
+    .then(() => {
+      batchApproveStockOutRecords({ ids, approvalStatus: 1 })
+        .then(() => {
+          proxy.$modal.msgSuccess("瀹℃壒閫氳繃鎴愬姛");
+          getList();
+        })
+        .catch(() => {
+          proxy.$modal.msgError("瀹℃壒閫氳繃澶辫触");
+        });
+    })
+    .catch((action) => {
+      if (action === "cancel") {
+        batchApproveStockOutRecords({ ids, approvalStatus: 2 })
+          .then(() => {
+            proxy.$modal.msgSuccess("瀹℃壒椹冲洖鎴愬姛");
+            getList();
+          })
+          .catch(() => {
+            proxy.$modal.msgError("瀹℃壒椹冲洖澶辫触");
+          });
+        return;
+      }
+      proxy.$modal.msg("宸插彇娑�");
+    });
+};
+
 // 瀵煎嚭
 const handleOut = () => {
-	ElMessageBox.confirm("鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
-		confirmButtonText: "纭",
-		cancelButtonText: "鍙栨秷",
-		type: "warning",
-	})
-		.then(() => {
-			proxy.download("/stockOutRecord/exportStockOutRecord", {type: props.type}, props.type === '0' ? "鍚堟牸鍑哄簱鍙拌处.xlsx" : "涓嶅悎鏍煎嚭搴撳彴璐�.xlsx");
-		})
-		.catch(() => {
-			proxy.$modal.msg("宸插彇娑�");
-		});
+  ElMessageBox.confirm("鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.download(
+        "/stockOutRecord/exportStockOutRecord",
+        { type: props.type },
+        props.type === "0" ? "鍚堟牸鍑哄簱鍙拌处.xlsx" : "涓嶅悎鏍煎嚭搴撳彴璐�.xlsx"
+      );
+    })
+    .catch(() => {
+      proxy.$modal.msg("宸插彇娑�");
+    });
 };
 
 // 鍒犻櫎
 const handleDelete = () => {
-	let ids = [];
-	if (selectedRows.value.length > 0) {
-		ids = selectedRows.value.map((item) => item.id);
-	} else {
-		proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
-		return;
-	}
-	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
-		confirmButtonText: "纭",
-		cancelButtonText: "鍙栨秷",
-		type: "warning",
-	})
-		.then(() => {
-			delStockOut(ids).then((res) => {
-				proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-				getList();
-			});
-		})
-		.catch(() => {
-			proxy.$modal.msg("宸插彇娑�");
-		});
+  let ids = [];
+  if (selectedRows.value.length > 0) {
+    ids = selectedRows.value.map((item) => item.id);
+  } else {
+    proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+    return;
+  }
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+    .then(() => {
+      delPendingStockOut(ids).then((res) => {
+        proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        getList();
+      });
+    })
+    .catch(() => {
+      proxy.$modal.msg("宸插彇娑�");
+    });
 };
 
 // 鎵撳嵃鍔熻兘
 const handlePrint = () => {
-	if (selectedRows.value.length === 0) {
-		proxy.$modal.msgWarning("璇烽�夋嫨瑕佹墦鍗扮殑鏁版嵁");
-		return;
-	}
-	printData.value = [...selectedRows.value];
-	console.log('鎵撳嵃鏁版嵁:', printData.value);
-	printPreviewVisible.value = true;
+  if (selectedRows.value.length === 0) {
+    proxy.$modal.msgWarning("璇烽�夋嫨瑕佹墦鍗扮殑鏁版嵁");
+    return;
+  }
+  printData.value = [...selectedRows.value];
+  console.log("鎵撳嵃鏁版嵁:", printData.value);
+  printPreviewVisible.value = true;
 };
 
 // 鎵ц鎵撳嵃
 const executePrint = () => {
-	console.log('寮�濮嬫墽琛屾墦鍗帮紝鏁版嵁鏉℃暟:', printData.value.length);
-	console.log('鎵撳嵃鏁版嵁:', printData.value);
-	
-	// 鍒涘缓涓�涓柊鐨勬墦鍗扮獥鍙�
-	const printWindow = window.open('', '_blank', 'width=800,height=600');
-	
-	// 鏋勫缓鎵撳嵃鍐呭
-	let printContent = `
+  console.log("寮�濮嬫墽琛屾墦鍗帮紝鏁版嵁鏉℃暟:", printData.value.length);
+  console.log("鎵撳嵃鏁版嵁:", printData.value);
+
+  // 鍒涘缓涓�涓柊鐨勬墦鍗扮獥鍙�
+  const printWindow = window.open("", "_blank", "width=800,height=600");
+
+  // 鏋勫缓鎵撳嵃鍐呭
+  let printContent = `
     <!DOCTYPE html>
     <html>
     <head>
@@ -398,14 +1052,13 @@
     </head>
     <body>
   `;
-	
-	// 涓烘瘡鏉℃暟鎹敓鎴愭墦鍗伴〉闈�
-	printData.value.forEach((item, index) => {
-		printContent += `
+
+  // 涓烘瘡鏉℃暟鎹敓鎴愭墦鍗伴〉闈�
+  printData.value.forEach((item, index) => {
+    printContent += `
       <div class="print-page">
         <div class="delivery-note">
           <div class="header">
-            <div class="company-name">榧庤瘹鐟炲疄涓氭湁闄愯矗浠诲叕鍙�</div>
             <div class="document-title">闆跺敭鍙戣揣鍗�</div>
           </div>
           
@@ -417,12 +1070,12 @@
               </div>
               <div>
                 <span class="label">瀹㈡埛鍚嶇О锛�</span>
-                <span class="value">${item.supplierName || '寮犵埍鏈�'}</span>
+                <span class="value">${item.supplierName}</span>
               </div>
             </div>
             <div class="info-row">
               <span class="label">鍗曞彿锛�</span>
-              <span class="value">${item.code || ''}</span>
+              <span class="value">${item.code || ""}</span>
             </div>
           </div>
 
@@ -440,12 +1093,12 @@
               </thead>
               <tbody>
                 <tr>
-                  <td>${item.productName || '鐮傜伆鐮�'}</td>
-                  <td>${item.model || '鏍囧噯'}</td>
-                  <td>${item.unit || '鍧�'}</td>
-                  <td>${item.taxInclusiveUnitPrice || '0'}</td>
-                  <td>${item.inboundNum || '2000'}</td>
-                  <td>${item.taxInclusiveTotalPrice || '0'}</td>
+                  <td>${item.productName || "鐮傜伆鐮�"}</td>
+                  <td>${item.model || "鏍囧噯"}</td>
+                  <td>${item.unit || "鍧�"}</td>
+                  <td>${item.taxInclusiveUnitPrice || "0"}</td>
+                  <td>${item.inboundNum || "2000"}</td>
+                  <td>${item.taxInclusiveTotalPrice || "0"}</td>
                 </tr>
               </tbody>
               <tfoot>
@@ -454,8 +1107,10 @@
                   <td class="total-value"></td>
                   <td class="total-value"></td>
                   <td class="total-value"></td>
-                  <td class="total-value">${item.inboundNum || '2000'}</td>
-                  <td class="total-value">${item.taxInclusiveTotalPrice || '0'}</td>
+                  <td class="total-value">${item.inboundNum || "2000"}</td>
+                  <td class="total-value">${
+                    item.taxInclusiveTotalPrice || "0"
+                  }</td>
                 </tr>
               </tfoot>
             </table>
@@ -479,7 +1134,7 @@
             <div class="footer-row">
               <div class="footer-item">
                 <span class="label">鎿嶄綔鍛橈細</span>
-                <span class="value">${userStore.nickName || '鎾曞紑鍓�'}</span>
+                <span class="value">${userStore.nickName || "鎾曞紑鍓�"}</span>
               </div>
               <div class="footer-item">
                 <span class="label">鎵撳嵃鏃ユ湡锛�</span>
@@ -490,220 +1145,227 @@
         </div>
       </div>
     `;
-	});
-	
-	printContent += `
+  });
+
+  printContent += `
     </body>
     </html>
   `;
-	
-	// 鍐欏叆鍐呭鍒版柊绐楀彛
-	printWindow.document.write(printContent);
-	printWindow.document.close();
-	
-	// 绛夊緟鍐呭鍔犺浇瀹屾垚鍚庢墦鍗�
-	printWindow.onload = () => {
-		setTimeout(() => {
-			printWindow.print();
-			printWindow.close();
-			printPreviewVisible.value = false;
-		}, 500);
-	};
+
+  // 鍐欏叆鍐呭鍒版柊绐楀彛
+  printWindow.document.write(printContent);
+  printWindow.document.close();
+
+  // 绛夊緟鍐呭鍔犺浇瀹屾垚鍚庢墦鍗�
+  printWindow.onload = () => {
+    setTimeout(() => {
+      printWindow.print();
+      printWindow.close();
+      printPreviewVisible.value = false;
+    }, 500);
+  };
 };
-
-
 
 // 鏍煎紡鍖栨棩鏈�
 const formatDate = (dateString) => {
-	if (!dateString) return getCurrentDate();
-	const date = new Date(dateString);
-	const year = date.getFullYear();
-	const month = String(date.getMonth() + 1).padStart(2, "0");
-	const day = String(date.getDate()).padStart(2, "0");
-	return `${year}/${month}/${day}`;
+  if (!dateString) return getCurrentDate();
+  const date = new Date(dateString);
+  const year = date.getFullYear();
+  const month = String(date.getMonth() + 1).padStart(2, "0");
+  const day = String(date.getDate()).padStart(2, "0");
+  return `${year}/${month}/${day}`;
 };
 
 // 鏍煎紡鍖栨棩鏈熸椂闂�
 const formatDateTime = (date) => {
-	const year = date.getFullYear();
-	const month = String(date.getMonth() + 1).padStart(2, "0");
-	const day = String(date.getDate()).padStart(2, "0");
-	const hours = String(date.getHours()).padStart(2, "0");
-	const minutes = String(date.getMinutes()).padStart(2, "0");
-	const seconds = String(date.getSeconds()).padStart(2, "0");
-	return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
+  const year = date.getFullYear();
+  const month = String(date.getMonth() + 1).padStart(2, "0");
+  const day = String(date.getDate()).padStart(2, "0");
+  const hours = String(date.getHours()).padStart(2, "0");
+  const minutes = String(date.getMinutes()).padStart(2, "0");
+  const seconds = String(date.getSeconds()).padStart(2, "0");
+  return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
 };
 onMounted(() => {
-	getList();
+  getList();
   fetchStockRecordTypeOptions();
 });
+
+watch(
+  () => props.topParentProductId,
+  () => {
+    page.current = 1;
+    getList();
+  }
+);
 </script>
 
 <style scoped lang="scss">
 .print-preview-dialog {
-	.el-dialog__body {
-		padding: 0;
-		max-height: 80vh;
-		overflow-y: auto;
-	}
+  .el-dialog__body {
+    padding: 0;
+    max-height: 80vh;
+    overflow-y: auto;
+  }
 }
 
 .print-preview-container {
-	.print-preview-header {
-		padding: 15px;
-		border-bottom: 1px solid #e4e7ed;
-		text-align: center;
-		
-		.el-button {
-			margin: 0 10px;
-		}
-	}
-	
-	.print-preview-content {
-		padding: 20px;
-		background-color: #f5f5f5;
-		min-height: 400px;
-	}
+  .print-preview-header {
+    padding: 15px;
+    border-bottom: 1px solid #e4e7ed;
+    text-align: center;
+
+    .el-button {
+      margin: 0 10px;
+    }
+  }
+
+  .print-preview-content {
+    padding: 20px;
+    background-color: #f5f5f5;
+    min-height: 400px;
+  }
 }
 
 .print-page {
-	width: 220mm;
-	height: 90mm;
-	padding: 10mm;
-	margin: 0 auto;
-	background: white;
-	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
-	margin-bottom: 10px;
-	box-sizing: border-box;
+  width: 220mm;
+  height: 90mm;
+  padding: 10mm;
+  margin: 0 auto;
+  background: white;
+  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
+  margin-bottom: 10px;
+  box-sizing: border-box;
 }
 
 .delivery-note {
-	width: 100%;
-	height: 100%;
-	font-family: "SimSun", serif;
-	font-size: 10px;
-	line-height: 1.2;
-	display: flex;
-	flex-direction: column;
+  width: 100%;
+  height: 100%;
+  font-family: "SimSun", serif;
+  font-size: 10px;
+  line-height: 1.2;
+  display: flex;
+  flex-direction: column;
 }
 
 .header {
-	text-align: center;
-	margin-bottom: 8px;
-	
-	.company-name {
-		font-size: 18px;
-		font-weight: bold;
-		margin-bottom: 4px;
-	}
-	
-	.document-title {
-		font-size: 16px;
-		font-weight: bold;
-	}
+  text-align: center;
+  margin-bottom: 8px;
+
+  .company-name {
+    font-size: 18px;
+    font-weight: bold;
+    margin-bottom: 4px;
+  }
+
+  .document-title {
+    font-size: 16px;
+    font-weight: bold;
+  }
 }
 
 .info-section {
-	margin-bottom: 8px;
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-	
-	.info-row {
-		line-height: 20px;
-		
-		.label {
-			font-weight: bold;
-			width: 60px;
-			font-size: 14px;
-		}
-		
-		.value {
-			margin-right: 20px;
-			min-width: 80px;
-			font-size: 14px;
-		}
-	}
+  margin-bottom: 8px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .info-row {
+    line-height: 20px;
+
+    .label {
+      font-weight: bold;
+      width: 60px;
+      font-size: 14px;
+    }
+
+    .value {
+      margin-right: 20px;
+      min-width: 80px;
+      font-size: 14px;
+    }
+  }
 }
 
 .table-section {
-	margin-bottom: 4px;
-	flex: 1;
-	
-	.product-table {
-		width: 100%;
-		border-collapse: collapse;
-		border: 1px solid #000;
-		
-		th, td {
-			border: 1px solid #000;
-			padding: 6px;
-			text-align: center;
-			font-size: 14px;
-			line-height: 1.4;
-		}
-		
-		th {
-			font-weight: bold;
-		}
-		
-		.total-label {
-			text-align: right;
-			font-weight: bold;
-		}
-		
-		.total-value {
-			font-weight: bold;
-		}
-	}
+  margin-bottom: 4px;
+  flex: 1;
+
+  .product-table {
+    width: 100%;
+    border-collapse: collapse;
+    border: 1px solid #000;
+
+    th,
+    td {
+      border: 1px solid #000;
+      padding: 6px;
+      text-align: center;
+      font-size: 14px;
+      line-height: 1.4;
+    }
+
+    th {
+      font-weight: bold;
+    }
+
+    .total-label {
+      text-align: right;
+      font-weight: bold;
+    }
+
+    .total-value {
+      font-weight: bold;
+    }
+  }
 }
 
 .footer-section {
-	.footer-row {
-		display: flex;
-		margin-bottom: 3px;
-		line-height: 20px;
-		justify-content: space-between;
-		
-		.footer-item {
-			display: flex;
-			margin-right: 20px;
-			
-			.label {
-				font-weight: bold;
-				width: 80px;
-				font-size: 14px;
-			}
-			
-			.value {
-				min-width: 80px;
-				font-size: 14px;
-			}
-			
-			&.address-item {
-				.address-value {
-					min-width: 200px;
-				}
-			}
-		}
-	}
+  .footer-row {
+    display: flex;
+    margin-bottom: 3px;
+    line-height: 20px;
+    justify-content: space-between;
+
+    .footer-item {
+      display: flex;
+      margin-right: 20px;
+
+      .label {
+        font-weight: bold;
+        width: 80px;
+        font-size: 14px;
+      }
+
+      .value {
+        min-width: 80px;
+        font-size: 14px;
+      }
+
+      &.address-item {
+        .address-value {
+          min-width: 200px;
+        }
+      }
+    }
+  }
 }
 
 @media print {
-	.app-container {
-		display: none;
-	}
-	
-	.print-page {
-		box-shadow: none;
-		margin: 0;
-		padding: 10mm;
-		padding-left: 20mm;
-		page-break-inside: avoid;
-		page-break-after: always;
-	}
-	.print-page:last-child {
-		page-break-after: avoid;
-	}
+  .app-container {
+    display: none;
+  }
+
+  .print-page {
+    box-shadow: none;
+    margin: 0;
+    padding: 10mm;
+    padding-left: 20mm;
+    page-break-inside: avoid;
+    page-break-after: always;
+  }
+  .print-page:last-child {
+    page-break-after: avoid;
+  }
 }
 </style>

--
Gitblit v1.9.3