From cac91a6a4c74d90215ebd93f787564efd651ae98 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 28 五月 2026 13:12:24 +0800
Subject: [PATCH] 富边电子 1.客户往来,销售合同号改为订单号。增加订单号查询搜索。 2.发货台账,没有时间显示, 3.指标统计改名为销售统计 4.采购台账,采购合同号改为采购单号。取消销售合同号。签订日期改为采购日期。付款方式取消显示。 5.供应商档案,取消供应商类型(甲乙丙丁),录入时也取消。 6.采购合同号改成采购单号。 7.采购报表,退款储量改成采购总价(或不显示)。 8.销售之后库存没有出库记录。 9.质量管理,检验员改成送件员。

---
 src/views/productionManagement/workOrderManagement/index.vue |  344 ++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 252 insertions(+), 92 deletions(-)

diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index 6def04c..f2f7118 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -3,17 +3,26 @@
     <div class="search_form">
       <div class="search-row">
         <div class="search-item">
-          <span class="search_title">宸ュ崟缂栧彿锛�</span>
-          <el-input v-model="searchForm.workOrderNo"
+          <span class="search_title">鍏ュ簱鏃ユ湡锛�</span>
+          <el-date-picker v-model="searchForm.timeStr"
+                          type="date"
+                          placeholder="璇烽�夋嫨鏃ユ湡"
+                          value-format="YYYY-MM-DD"
+                          format="YYYY-MM-DD"
+                          clearable
+                          @change="handleQuery"/>
+        </div>
+        <div class="search-item">
+          <span class="search_title">浜у搧澶х被锛�</span>
+          <el-input v-model="searchForm.productName"
                     style="width: 240px"
                     placeholder="璇疯緭鍏�"
-                    @change="handleQuery"
-                    clearable
-                    prefix-icon="Search" />
+                    clearable/>
         </div>
         <div class="search-item">
           <el-button type="primary"
                      @click="handleQuery">鎼滅储</el-button>
+          <el-button type="primary" @click="openAddDialog" style="margin-left: 10px;">鏂板</el-button>
         </div>
       </div>
     </div>
@@ -23,13 +32,7 @@
                 :tableData="tableData"
                 :page="page"
                 :tableLoading="tableLoading"
-                @pagination="pagination">
-        <template #completionStatus="{ row }">
-          <el-progress :percentage="toProgressPercentage(row?.completionStatus)"
-                       :color="progressColor(toProgressPercentage(row?.completionStatus))"
-                       :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" />
-        </template>
-      </PIMTable>
+                @pagination="pagination" />
     </div>
     
     <!-- 娴佽浆鍗″脊绐� -->
@@ -165,6 +168,67 @@
     </el-dialog>
     
     <FilesDia ref="workOrderFilesRef" />
+    
+    <!-- 鏂板宸ュ崟寮圭獥 -->
+    <el-dialog v-model="addDialogVisible"
+               title="鏂板宸ュ崟"
+               width="500px"
+               @close="closeAddDialog">
+      <el-form ref="addFormRef"
+               :model="addForm"
+               :rules="addFormRules"
+               label-width="120px"
+               label-position="top">
+        <el-form-item label="浜у搧鍚嶇О锛�"
+                      prop="productId">
+          <el-tree-select v-model="addForm.productId"
+                          placeholder="璇烽�夋嫨浜у搧"
+                          clearable
+                          check-strictly
+                          :data="productOptions"
+                          :render-after-expand="false"
+                          style="width: 100%"
+                          @change="handleProductChange" />
+        </el-form-item>
+        <el-form-item label="瑙勬牸鍨嬪彿锛�"
+                      prop="productModelId">
+          <el-select v-model="addForm.productModelId"
+                     placeholder="璇烽�夋嫨瑙勬牸鍨嬪彿"
+                     clearable
+                     style="width: 100%"
+                     @change="handleModelChange"
+                     filterable>
+            <el-option v-for="item in modelOptions"
+                       :key="item.id"
+                       :label="item.model"
+                       :value="item.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鍗曚綅锛�"
+                      prop="unit">
+          <el-input v-model="addForm.unit"
+                    placeholder="鍗曚綅"
+                    disabled
+                    style="width: 100%" />
+        </el-form-item>
+        <el-form-item label="鏁伴噺锛�"
+                      prop="quantity">
+          <el-input-number v-model="addForm.quantity"
+                           :min="1"
+                           :step="1"
+                           step-strictly
+                           style="width: 100%"
+                           placeholder="璇疯緭鍏ユ暟閲�" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button type="primary"
+                     @click="handleAddSubmit">纭畾</el-button>
+          <el-button @click="closeAddDialog">鍙栨秷</el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -178,34 +242,35 @@
     downProductWorkOrder,
   } from "@/api/productionManagement/workOrder.js";
   import { getUserProfile, userListNoPageByTenantId } from "@/api/system/user.js";
+  import { createStockInventory } from "@/api/inventoryManagement/stockInventory.js";
+  import { getStockInRecordListPage } from "@/api/inventoryManagement/stockInRecord.js";
+  import { productTreeList, modelList } from "@/api/basicData/product.js";
+  import { findAllQualifiedStockInRecordTypeOptions } from "@/api/basicData/enum.js";
   import QRCode from "qrcode";
   import { getCurrentInstance, reactive, toRefs } from "vue";
   import FilesDia from "./components/filesDia.vue";
   const { proxy } = getCurrentInstance();
 
+  // 鏉ユ簮绫诲瀷閫夐」
+  const stockRecordTypeOptions = ref([]);
+
   const tableColumn = ref([
     {
-      label: "宸ュ崟绫诲瀷",
-      prop: "workOrderType",
-      width: "80",
+      label: "鍏ュ簱鎵规",
+      prop: "inboundBatches",
+      width: "280",
     },
     {
-      label: "宸ュ崟缂栧彿",
-      prop: "workOrderNo",
-      width: "140",
+      label: "鍏ュ簱鏃堕棿",
+      prop: "createTime",
+      width: "160",
     },
     {
-      label: "鐢熶骇璁㈠崟鍙�",
-      prop: "productOrderNpsNo",
-      width: "140",
-    },
-    {
-      label: "浜у搧鍚嶇О",
+      label: "浜у搧澶х被",
       prop: "productName",
-      width: "140",
     },
     {
-      label: "瑙勬牸",
+      label: "瑙勬牸鍨嬪彿",
       prop: "model",
     },
     {
@@ -213,73 +278,19 @@
       prop: "unit",
     },
     {
-      label: "宸ュ簭鍚嶇О",
-      prop: "processName",
+      label: "鍏ュ簱鏁伴噺",
+      prop: "stockInNum",
     },
     {
-      label: "闇�姹傛暟閲�",
-      prop: "planQuantity",
-      width: "140",
+      label: "鍏ュ簱浜�",
+      prop: "createBy",
     },
     {
-      label: "瀹屾垚鏁伴噺",
-      prop: "completeQuantity",
-      width: "140",
-    },
-    {
-      label: "瀹屾垚杩涘害",
-      prop: "completionStatus",
-      dataType: "slot",
-      slot: "completionStatus",
-      width: "140",
-    },
-    {
-      label: "璁″垝寮�濮嬫椂闂�",
-      prop: "planStartTime",
-      width: "140",
-    },
-    {
-      label: "璁″垝缁撴潫鏃堕棿",
-      prop: "planEndTime",
-      width: "140",
-    },
-    {
-      label: "瀹為檯寮�濮嬫椂闂�",
-      prop: "actualStartTime",
-      width: "140",
-    },
-    {
-      label: "瀹為檯缁撴潫鏃堕棿",
-      prop: "actualEndTime",
-      width: "140",
-    },
-    {
-      label: "鎿嶄綔",
-      width: "200",
-      align: "center",
-      dataType: "action",
-      fixed: "right",
-      operation: [
-        {
-          name: "娴佽浆鍗�",
-          clickFun: row => {
-            downloadAndPrintWorkOrder(row);
-          },
-        },
-        {
-          name: "闄勪欢",
-          clickFun: row => {
-            openWorkOrderFiles(row);
-          },
-        },
-        {
-          name: "鎶ュ伐",
-          clickFun: row => {
-            showReportDialog(row);
-          },
-          disabled: row => row.planQuantity <= 0,
-        },
-      ],
+      label: "鏉ユ簮",
+      prop: "recordType",
+      formatData: (val) => {
+        return stockRecordTypeOptions.value.find(item => item.value === val)?.label || val;
+      }
     },
   ]);
   
@@ -304,6 +315,27 @@
     userId: "",
     productMainId: null,
   });
+
+  // 鏂板宸ュ崟鐩稿叧
+  const addDialogVisible = ref(false);
+  const addFormRef = ref(null);
+  const productOptions = ref([]);
+  const modelOptions = ref([]);
+  const addForm = reactive({
+    productId: null,
+    productModelId: null,
+    productName: "",
+    productModelName: "",
+    unit: "",
+    quantity: 1,
+  });
+
+  // 鏂板琛ㄥ崟鏍¢獙瑙勫垯
+  const addFormRules = {
+    productId: [{ required: true, message: "璇烽�夋嫨浜у搧", trigger: "change" }],
+    productModelId: [{ required: true, message: "璇烽�夋嫨瑙勬牸鍨嬪彿", trigger: "change" }],
+    quantity: [{ required: true, message: "璇疯緭鍏ユ暟閲�", trigger: "blur" }],
+  };
 
   // 鏈鐢熶骇鏁伴噺楠岃瘉瑙勫垯
   const validateQuantity = (rule, value, callback) => {
@@ -404,7 +436,8 @@
 
   const data = reactive({
     searchForm: {
-      workOrderNo: "",
+      timeStr: "",
+      productName: "",
     },
   });
   const { searchForm } = toRefs(data);
@@ -438,8 +471,12 @@
   
   const getList = () => {
     tableLoading.value = true;
-    const params = { ...searchForm.value, ...page };
-    productWorkOrderPage(params)
+    const params = { ...page };
+    params.timeStr = searchForm.value.timeStr;
+    params.productName = searchForm.value.productName;
+    params.recordType = 2; // 榛樿鏌ヨ recordType 涓� 2锛堢敓浜ф姤宸�-鍚堟牸鍏ュ簱锛夌殑鏁版嵁
+    params.type = '0'; // 鍚堟牸鍏ュ簱绫诲瀷
+    getStockInRecordListPage(params)
       .then(res => {
         tableLoading.value = false;
         tableData.value = res.data.records;
@@ -634,6 +671,127 @@
     reportForm.userName = user ? user.nickName : "";
   };
 
+  // 鎵撳紑鏂板寮圭獥
+  const openAddDialog = () => {
+    // 閲嶇疆琛ㄥ崟
+    addForm.productId = null;
+    addForm.productModelId = null;
+    addForm.productName = "";
+    addForm.productModelName = "";
+    addForm.unit = "";
+    addForm.quantity = 1;
+    modelOptions.value = [];
+    // 鍔犺浇浜у搧鏍�
+    getProductOptions();
+    addDialogVisible.value = true;
+  };
+
+  // 鍏抽棴鏂板寮圭獥
+  const closeAddDialog = () => {
+    addFormRef.value?.resetFields();
+    addDialogVisible.value = false;
+  };
+
+  // 鑾峰彇浜у搧鏍�
+  const getProductOptions = () => {
+    productTreeList().then((res) => {
+      productOptions.value = convertIdToValue(res);
+    });
+  };
+
+  // 杞崲浜у搧鏍戞暟鎹�
+  function convertIdToValue(data) {
+    return data.map((item) => {
+      const { id, children, ...rest } = item;
+      const newItem = {
+        ...rest,
+        value: id,
+      };
+      if (children && children.length > 0) {
+        newItem.children = convertIdToValue(children);
+      }
+      return newItem;
+    });
+  }
+
+  // 鏍规嵁ID鏌ユ壘浜у搧鍚嶇О
+  function 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;
+        }
+      }
+    }
+    return null;
+  }
+
+  // 浜у搧閫夋嫨鍙樺寲
+  const handleProductChange = (value) => {
+    addForm.productModelId = null;
+    addForm.unit = "";
+    addForm.productModelName = "";
+    if (value) {
+      addForm.productName = findNodeById(productOptions.value, value);
+      // 鍔犺浇瑙勬牸鍨嬪彿
+      modelList({ id: value }).then((res) => {
+        modelOptions.value = res;
+      });
+    } else {
+      modelOptions.value = [];
+    }
+  };
+
+  // 瑙勬牸鍨嬪彿閫夋嫨鍙樺寲
+  const handleModelChange = (value) => {
+    if (value) {
+      const model = modelOptions.value.find((item) => item.id === value);
+      if (model) {
+        addForm.unit = model.unit;
+        addForm.productModelName = model.model;
+      }
+    } else {
+      addForm.unit = "";
+      addForm.productModelName = "";
+    }
+  };
+
+  // 鎻愪氦鏂板
+  const handleAddSubmit = () => {
+    addFormRef.value?.validate((valid) => {
+      if (valid) {
+        const params = {
+          productId: addForm.productId,
+          productModelId: addForm.productModelId,
+          productName: addForm.productName,
+          productModelName: addForm.productModelName,
+          unit: addForm.unit,
+          qualitity: addForm.quantity,
+          type: "qualified",
+          warnNum: 0,
+          recordType: 2,
+        };
+        createStockInventory(params).then((res) => {
+          proxy.$modal.msgSuccess("鏂板鎴愬姛");
+          closeAddDialog();
+          getList();
+        });
+      }
+    });
+  };
+
+  // 鑾峰彇鏉ユ簮绫诲瀷閫夐」
+  const fetchStockRecordTypeOptions = () => {
+    findAllQualifiedStockInRecordTypeOptions()
+      .then(res => {
+        stockRecordTypeOptions.value = res.data;
+      });
+  };
+
   onMounted(() => {
     getList();
     // 鑾峰彇鐢ㄦ埛鍒楄〃
@@ -642,6 +800,8 @@
         userOptions.value = res.data;
       }
     });
+    // 鑾峰彇鏉ユ簮绫诲瀷閫夐」
+    fetchStockRecordTypeOptions();
   });
 </script>
 

--
Gitblit v1.9.3