From 4ceaadfe421507c9cd0c32094d04ca938d518311 Mon Sep 17 00:00:00 2001
From: lishenao <3065849776@qq.com>
Date: 星期四, 03 七月 2025 14:44:13 +0800
Subject: [PATCH] 库存管理数据修改

---
 src/views/inventoryManagement/dispatchLog/index.vue |  125 ++++++++++++++++++++++-------------------
 1 files changed, 66 insertions(+), 59 deletions(-)

diff --git a/src/views/inventoryManagement/dispatchLog/index.vue b/src/views/inventoryManagement/dispatchLog/index.vue
index 7ad8196..38475bd 100644
--- a/src/views/inventoryManagement/dispatchLog/index.vue
+++ b/src/views/inventoryManagement/dispatchLog/index.vue
@@ -4,7 +4,7 @@
       <div>
         <span class="search_title">渚涘簲鍟嗗悕绉帮細</span>
         <el-input
-          v-model="searchForm.customerName"
+          v-model="searchForm.supplierName"
           style="width: 240px"
           placeholder="璇疯緭鍏�"
           @change="handleQuery"
@@ -38,67 +38,67 @@
         <el-table-column align="center" label="搴忓彿" type="index" width="60" />
         <el-table-column
           label="鍑哄簱鏃ユ湡"
-          prop="salesContractNo"
+          prop="inboundTime"
           width="100"
           show-overflow-tooltip
         />
         <el-table-column
           label="渚涘簲鍟嗗悕绉�"
-          prop="customerName"
+          prop="supplierName"
           width="160"
           show-overflow-tooltip
         />
         <el-table-column
           label="浜у搧澶х被"
-          prop="salesman"
+          prop="productCategory"
           width="100"
           show-overflow-tooltip
         />
         <el-table-column
           label="瑙勬牸鍨嬪彿"
-          prop="projectName"
+          prop="specificationModel"
           width="100"
           show-overflow-tooltip
         />
         <el-table-column
           label="鍗曚綅"
-          prop="contractAmount"
+          prop="unit"
           width="80"
           show-overflow-tooltip
         />
         <el-table-column
           label="鍑哄簱鏁伴噺"
-          prop="entryPersonName"
+          prop="inboundQuantity"
           width="100"
           show-overflow-tooltip
         />
         <el-table-column
           label="鍚◣鍗曚环"
-          prop="entryDate"
+          prop="taxInclusiveUnitPrice"
           width="100"
           show-overflow-tooltip
         />
         <el-table-column
           label="鍚◣鎬讳环"
-          prop="executionDate"
+          prop="taxInclusiveTotalPrice"
           width="100"
           show-overflow-tooltip
         />
         <el-table-column
           label="绋庣巼"
-          prop="executionDate"
+          prop="taxRate"
           width="100"
           show-overflow-tooltip
         />
         <el-table-column
           label="涓嶅惈绋庢�讳环"
-          prop="executionDate"
+          prop="taxExclusiveTotalPrice"
           width="100"
           show-overflow-tooltip
         />
         <el-table-column
           label="鍑哄簱浜�"
-          prop="executionDate"
+          prop="nickname"
           width="80"
           show-overflow-tooltip
         />
@@ -284,20 +284,25 @@
 import useUserStore from "@/store/modules/user";
 import { userListNoPage } from "@/api/system/user.js";
 import {
-  ledgerListPage,
-  customerList,
-  addOrUpdateSalesLedger,
-  getSalesLedgerWithProducts,
-  delLedger,
-} from "@/api/salesManagement/salesLedger.js";
+  getStockOutPage,
+  addStockOut,
+  updateStockOut,
+  delStockOut,
+  exportStockOut,
+  getStockManageById
+} from "@/api/inventoryManagement/stockOut.js";
+
 const userStore = useUserStore();
 const { proxy } = getCurrentInstance();
 const tableData = ref([]);
-const productData = ref([]);
+// const productData = ref([]);
 const selectedRows = ref([]);
 const userList = ref([]);
-const customerOption = ref([]);
+// const customerOption = ref([]);
 const tableLoading = ref(false);
+const supplierList = ref([])
+const productList = ref([])
+const productModelList = ref([])
 const page = reactive({
   current: 1,
   size: 100,
@@ -310,30 +315,32 @@
 const dialogFormVisible = ref(false);
 const data = reactive({
   searchForm: {
-    customerName: "",
+    supplierName: "",
   },
   form: {
-    salesContractNo: "",
-    salesman: "",
-    customerContractNo: "",
-    customerId: "",
-    projectName: "",
-    entryPerson: "",
-    entryDate: "",
-    maintenanceTime: "",
-    productData: [],
-    executionDate: "",
+    supplierId: null,
+    supplierName: '',
+    productId: null,
+    productName: '',
+    userId: userStore.userId,
+    nickname: '',
+    model: '',
+    productModelId: null,
+    unit: '',
+    productrecordId: null,
+    taxInclusiveUnitPrice: '',
+    taxInclusiveTotalPrice: '',
+    taxRate: '',
+    taxExclusiveTotalPrice: '',
+    inboundTime: '',
+    inboundBatch: '',
+    inboundQuantity: ''
   },
   rules: {
-    salesman: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
-    customerContractNo: [
-      { required: true, message: "璇疯緭鍏�", trigger: "blur" },
-    ],
-    customerId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
-    projectName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-    entryPerson: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
-    entryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
-    executionDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+    supplierId: [{ required: true, message: '璇烽�夋嫨渚涘簲鍟�', trigger: 'change' }],
+    productRecordid: [{ required: true, message: '璇烽�夋嫨浜у搧', trigger: 'change' }],
+    inboundTime: [{ required: true, message: '璇烽�夋嫨鍏ュ簱鏃堕棿', trigger: 'change' }],
+    inboundQuantity: [{ required: true, message: '璇疯緭鍏ュ叆搴撴暟閲�', trigger: 'blur' }]
   },
 });
 const { searchForm, form, rules } = toRefs(data);
@@ -351,10 +358,10 @@
 };
 const getList = () => {
   tableLoading.value = true;
-  ledgerListPage({ ...searchForm.value, ...page })
+  getStockOutPage({ ...searchForm.value, ...page })
     .then((res) => {
       tableLoading.value = false;
-      tableData.value = res.records;
+      tableData.value = res.data.records;
       tableData.value.map((item) => {
         item.children = [];
       });
@@ -364,24 +371,24 @@
       tableLoading.value = false;
     });
 };
-const findNodeById = (nodes, productId) => {
-  for (let i = 0; i < nodes.length; i++) {
-    if (nodes[i].value === productId) {
-      return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣
-    }
-    if (nodes[i].children && nodes[i].children.length > 0) {
-      const foundNode = findNodeById(nodes[i].children, productId);
-      if (foundNode) {
-        return foundNode.label; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖璇ヨ妭鐐�
-      }
-    }
-  }
-  return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
-};
+// const findNodeById = (nodes, productId) => {
+//   for (let i = 0; i < nodes.length; i++) {
+//     if (nodes[i].value === productId) {
+//       return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣
+//     }
+//     if (nodes[i].children && nodes[i].children.length > 0) {
+//       const foundNode = findNodeById(nodes[i].children, productId);
+//       if (foundNode) {
+//         return foundNode.label; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖璇ヨ妭鐐�
+//       }
+//     }
+//   }
+//   return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
+// };
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = (selection) => {
   // 杩囨护鎺夊瓙鏁版嵁
-  selectedRows.value = selection.filter((item) => item.children !== undefined);
+  selectedRows.value = selection.filter((item) => item.id);
   console.log("selection", selectedRows.value);
 };
 const expandedRowKeys = ref([]);
@@ -464,7 +471,7 @@
     type: "warning",
   })
     .then(() => {
-      proxy.download("/sales/ledger/export", {}, "鍑哄簱鍙拌处.xlsx");
+      proxy.download("/stockmanagement/export", {}, "鍑哄簱鍙拌处.xlsx");
     })
     .catch(() => {
       proxy.$modal.msg("宸插彇娑�");
@@ -485,7 +492,7 @@
     type: "warning",
   })
     .then(() => {
-      delLedger(ids).then((res) => {
+      delStockOut(ids).then((res) => {
         proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
         getList();
       });

--
Gitblit v1.9.3