From 236566b02c46f11f684e942b38ec43c310421fa3 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 17 三月 2026 13:06:27 +0800
Subject: [PATCH] 军泰伟业 1.仓储物流需要加上库位,库位暂时分为外购、自制、委外三种类型 2.生产订单加上库存数量,方便实时查看 3.产品发货后,若部分产品退回,可修改订单发货数量(减去退回的产品数量),若订单产品全部退回,可对发货的订单进行取消撤回操作

---
 src/views/inventoryManagement/stockManagement/Unqualified.vue |  101 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 90 insertions(+), 11 deletions(-)

diff --git a/src/views/inventoryManagement/stockManagement/Unqualified.vue b/src/views/inventoryManagement/stockManagement/Unqualified.vue
index 67d5f58..9f81143 100644
--- a/src/views/inventoryManagement/stockManagement/Unqualified.vue
+++ b/src/views/inventoryManagement/stockManagement/Unqualified.vue
@@ -7,7 +7,16 @@
                   style="width: 240px"
                   placeholder="璇疯緭鍏�"
                   clearable/>
+        <span class="search_title ml10">璐ㄦ鐘舵�侊細</span>
+        <el-select v-model="searchForm.type"
+                  style="width: 240px"
+                  placeholder="璇烽�夋嫨"
+                  clearable>
+          <el-option label="鍚堟牸" :value="0" />
+          <el-option label="涓嶅悎鏍�" :value="1" />
+        </el-select>
         <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+        <el-button @click="handleReset">閲嶇疆</el-button>
       </div>
       <div>
          <el-button type="primary" @click="isShowNewModal = true">鏂板搴撳瓨</el-button>
@@ -24,12 +33,24 @@
         <el-table-column label="瑙勬牸鍨嬪彿" prop="model" show-overflow-tooltip />
         <el-table-column label="鍗曚綅" prop="unit" show-overflow-tooltip />
         <el-table-column label="搴撳瓨鏁伴噺" prop="qualitity" show-overflow-tooltip />
-        <el-table-column label="搴撳瓨棰勮鏁伴噺" prop="warnNum"  show-overflow-tooltip />
+        <el-table-column label="璐ㄦ鐘舵��"
+                         prop="type"
+                         show-overflow-tooltip
+                         width="100">
+          <template #default="scope">
+            <el-tag :type="scope.row.type == 0 ? 'success' : 'danger'" size="small">
+              {{ scope.row.type == 0 ? '鍚堟牸' : '涓嶅悎鏍�' }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="鍐荤粨鏁伴噺" prop="lockedQuantity" show-overflow-tooltip />
         <el-table-column label="澶囨敞" prop="remark"  show-overflow-tooltip />
         <el-table-column label="鏈�杩戞洿鏂版椂闂�" prop="updateTime" show-overflow-tooltip />
         <el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
           <template #default="scope">
-            <el-button link type="primary" size="small" @click="showSubtractModal(scope.row)" :disabled="scope.row.qualitity === 0">棰嗙敤</el-button>
+            <el-button link type="primary" size="small" @click="showSubtractModal(scope.row)" :disabled="scope.row.unLockedQuantity === 0">棰嗙敤</el-button>
+            <el-button link type="primary" size="small" v-if="scope.row.unLockedQuantity > 0" @click="showFrozenModal(scope.row)">鍐荤粨</el-button>
+            <el-button link type="primary" size="small" v-if="scope.row.lockedQuantity > 0" @click="showThawModal(scope.row)">瑙e喕</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -44,19 +65,37 @@
     <subtract-stock-inventory v-if="isShowSubtractModal"
                  v-model:visible="isShowSubtractModal"
                  :record="record"
+                 type="unqualified"
                  @completed="handleQuery" />
+    <!-- 鍐荤粨/瑙e喕搴撳瓨-->
+    <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal"
+                                     v-model:visible="isShowFrozenAndThawModal"
+                                     :record="record"
+                                     :operation-type="operationType"
+                                     type="unqualified"
+                                     @completed="handleQuery" />
   </div>
 </template>
 
 <script setup>
 import pagination from '@/components/PIMTable/Pagination.vue'
-import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
+import { ref, reactive, toRefs, onMounted, getCurrentInstance, watch } from 'vue'
 import { ElMessageBox } from "element-plus";
 import { getStockUninventoryListPage } from "@/api/inventoryManagement/stockUninventory.js";
 const NewStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/New.vue"));
 const SubtractStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/Subtract.vue"));
+const FrozenAndThawStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue"));
 
 const { proxy } = getCurrentInstance()
+
+const props = defineProps({
+  type: {
+    type: Number,
+    required: true,
+    default: 3
+  }
+})
+
 const tableData = ref([])
 const selectedRows = ref([])
 const record = ref({})
@@ -70,9 +109,14 @@
 const isShowNewModal = ref(false)
 // 鏄惁鏄剧ず棰嗙敤寮规
 const isShowSubtractModal = ref(false)
+// 鏄惁鏄剧ず鍐荤粨/瑙e喕寮规
+const isShowFrozenAndThawModal = ref(false)
+// 鎿嶄綔绫诲瀷
+const operationType = ref('frozen')
 const data = reactive({
   searchForm: {
     productName: '',
+    type: '',
   }
 })
 const { searchForm } = toRefs(data)
@@ -83,6 +127,13 @@
   page.current = 1
   getList()
 }
+
+/** 閲嶇疆鎸夐挳鎿嶄綔 */
+const handleReset = () => {
+  searchForm.value.productName = '';
+  searchForm.value.type = '';
+  handleQuery();
+}
 const paginationChange = (obj) => {
   page.current = obj.page;
   page.size = obj.limit;
@@ -90,7 +141,11 @@
 }
 const getList = () => {
   tableLoading.value = true
-  getStockUninventoryListPage({ ...searchForm.value, ...page }).then(res => {
+  const params = { ...searchForm.value, ...page, productType: props.type };
+  if (searchForm.value.type !== "") {
+    params.type = searchForm.value.type;
+  }
+  getStockUninventoryListPage(params).then(res => {
     tableLoading.value = false
     tableData.value = res.data.records
     total.value = res.data.total
@@ -107,6 +162,20 @@
   isShowSubtractModal.value = true
 }
 
+// 鐐瑰嚮鍐荤粨
+const showFrozenModal = (row) => {
+  record.value = row
+  isShowFrozenAndThawModal.value = true
+  operationType.value = 'frozen'
+}
+
+// 鐐瑰嚮瑙e喕
+const showThawModal = (row) => {
+  record.value = row
+  isShowFrozenAndThawModal.value = true
+  operationType.value = 'thaw'
+}
+
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = (selection) => {
   // 杩囨护鎺夊瓙鏁版嵁
@@ -117,12 +186,12 @@
 
 // 琛ㄦ牸琛岀被鍚�
 const tableRowClassName = ({ row }) => {
-  const stock = Number(row?.inboundNum0 ?? 0);
-  const warn = Number(row?.warnNum ?? 0);
-  if (!Number.isFinite(stock) || !Number.isFinite(warn)) {
-    return '';
-  }
-  return stock < warn ? 'row-low-stock' : '';
+  // const stock = Number(row?.unLockedQuantity ?? 0);
+  // const warn = Number(row?.warnNum ?? 0);
+  // if (!Number.isFinite(stock) || !Number.isFinite(warn)) {
+  //   return '';
+  // }
+  // return stock < warn ? 'row-low-stock' : '';
 };
 
 // 瀵煎嚭
@@ -135,7 +204,12 @@
     type: 'warning',
   }
   ).then(() => {
-    proxy.download("/stockUninventory/exportStockUninventory", {}, '涓嶅悎鏍煎簱瀛樹俊鎭�.xlsx')
+    const fileNameMap = {
+      1: '鑷埗搴撳瓨淇℃伅.xlsx',
+      2: '澶栬喘搴撳瓨淇℃伅.xlsx',
+      3: '濮斿搴撳瓨淇℃伅.xlsx'
+    };
+    proxy.download("/stockUninventory/exportStockUninventory", {productType: props.type}, fileNameMap[props.type] || '搴撳瓨淇℃伅.xlsx')
   }).catch(() => {
     proxy.$modal.msg("宸插彇娑�")
   })
@@ -144,6 +218,11 @@
 onMounted(() => {
   getList()
 })
+
+watch(() => props.type, () => {
+  page.current = 1
+  getList()
+})
 </script>
 
 <style scoped lang="scss">

--
Gitblit v1.9.3