From b52c08544fd4ab1e8ff0f09efaac160608fd90ce Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 27 四月 2026 11:59:06 +0800
Subject: [PATCH] 天津宝东 1.修改生产流程

---
 src/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue |   14 -
 src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue |   26 --
 src/views/productionManagement/productionOrder/New.vue                             |  456 ++++++++++++++++++++++++++++++++++++++++----------
 src/views/productionManagement/productionOrder/index.vue                           |   21 --
 src/views/procurementManagement/invoiceEntry/components/Modal.vue                  |    3 
 src/views/salesManagement/invoiceRegistration/index.vue                            |    2 
 6 files changed, 374 insertions(+), 148 deletions(-)

diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
index 1ddfc16..ee3e036 100644
--- a/src/views/procurementManagement/invoiceEntry/components/Modal.vue
+++ b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -233,8 +233,7 @@
 
 const rules = ref({
 	invoiceNumber: [
-		{ required: true, message: "璇疯緭鍏ュ彂绁ㄥ彿", trigger: "blur" },
-		{ type: "string" },
+		{ required: false, message: "璇疯緭鍏ュ彂绁ㄥ彿", trigger: "blur" },
 	],
 	invoiceAmount: [
 		{ required: true, message: "璇疯緭鍏ュ彂绁ㄩ噾棰�", trigger: "blur" },
diff --git a/src/views/productionManagement/productionOrder/New.vue b/src/views/productionManagement/productionOrder/New.vue
index c9c478b..9156438 100644
--- a/src/views/productionManagement/productionOrder/New.vue
+++ b/src/views/productionManagement/productionOrder/New.vue
@@ -1,67 +1,168 @@
 <template>
   <div>
     <el-dialog
-        v-model="isShow"
-        title="鏂板鐢熶骇璁㈠崟"
-        width="800"
-        @close="closeModal"
+      v-model="isShow"
+      title="鏂板鐢熶骇璁㈠崟"
+      width="1280px"
+      @close="closeModal"
     >
-      <el-form label-width="140px" :model="formState" label-position="top" ref="formRef">
+      <el-form
+        ref="formRef"
+        :model="formState"
+        label-width="140px"
+        label-position="top"
+      >
         <el-form-item
-            label="浜у搧鍚嶇О"
-            prop="productModelId"
-            :rules="[
-                {
-                required: true,
-                message: '璇烽�夋嫨浜у搧',
-                trigger: 'change',
-              }
-            ]"
+          label="浜у搧鍚嶇О"
+          prop="productModelId"
+          :rules="[
+            {
+              required: true,
+              message: '璇烽�夋嫨浜у搧',
+              trigger: 'change',
+            },
+          ]"
         >
           <el-button type="primary" @click="showProductSelectDialog = true">
-            {{ formState.productName ? formState.productName : '閫夋嫨浜у搧' }}
+            {{ formState.productName ? formState.productName : "閫夋嫨浜у搧" }}
           </el-button>
         </el-form-item>
 
         <el-form-item
-            label="瑙勬牸"
-            prop="productModelName"
+          label="瑙勬牸"
+          prop="productModelName"
+          :rules="[
+            {
+              required: true,
+              message: '璇烽�夋嫨瑙勬牸',
+              trigger: 'change',
+            },
+          ]"
         >
-          <el-input v-model="formState.productModelName"  disabled />
+          <el-input v-model="formState.productModelName" disabled />
         </el-form-item>
 
         <el-form-item
-            label="鍗曚綅"
-            prop="unit"
+          label="鍗曚綅"
+          prop="unit"
+          :rules="[
+            {
+              required: true,
+              message: '璇烽�夋嫨鍗曚綅',
+              trigger: 'change',
+            },
+          ]"
         >
-          <el-input v-model="formState.unit"  disabled />
+          <el-input v-model="formState.unit" disabled />
         </el-form-item>
 
-        <el-form-item label="宸ヨ壓璺嚎">
-          <el-select v-model="formState.routeId"
-                     placeholder="璇烽�夋嫨宸ヨ壓璺嚎"
-                     style="width: 100%;"
-                     :loading="bindRouteLoading">
-            <el-option v-for="item in routeOptions"
-                       :key="item.id"
-                       :label="`${item.processRouteCode || ''}`"
-                       :value="item.id" />
+        <el-form-item
+          label="宸ヨ壓璺嚎"
+          prop="routeId"
+          :rules="[
+            {
+              required: true,
+              message: '璇烽�夋嫨宸ヨ壓璺嚎',
+              trigger: 'change',
+            },
+          ]"
+        >
+          <el-select
+            v-model="formState.routeId"
+            placeholder="璇烽�夋嫨宸ヨ壓璺嚎"
+            style="width: 100%;"
+            :loading="bindRouteLoading"
+          >
+            <el-option
+              v-for="item in routeOptions"
+              :key="item.id"
+              :label="`${item.processRouteCode || ''}`"
+              :value="item.id"
+            />
           </el-select>
         </el-form-item>
 
+        <el-form-item label="鐢ㄦ枡淇℃伅">
+          <el-table :data="[materialForm]" border size="small" class="material-table">
+            <el-table-column label="鍘熺焊瑙勬牸" min-width="180" align="center">
+              <template #default>
+                <el-tree-select
+                  v-model="materialForm.productCategoryId"
+                  placeholder="璇烽�夋嫨鍘熺焊瑙勬牸"
+                  filterable
+                  clearable
+                  check-strictly
+                  :render-after-expand="false"
+                  style="width: 100%;"
+                  :loading="bindProductLoading"
+                  :data="bindProductOptions"
+                  @change="handleMaterialCategoryChange"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="鍘熸枡鍨嬪彿" min-width="180" align="center">
+              <template #default>
+                <el-select
+                  v-model="materialForm.materialModel"
+                  placeholder="璇烽�夋嫨鍘熸枡鍨嬪彿"
+                  filterable
+                  clearable
+                  style="width: 100%;"
+                  :loading="bindMaterialModelLoading"
+                >
+                  <el-option
+                    v-for="item in bindMaterialModelOptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="鍘熺焊闇�瑕侀噺" min-width="120" align="center">
+              <template #default>
+                <el-input-number
+                  v-model="materialForm.basePaperQty"
+                  :min="0"
+                  :precision="2"
+                  controls-position="right"
+                  style="width: 100%"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column label="绾哥闇�瑕侀噺" min-width="120" align="center">
+              <template #default>
+                <el-input-number
+                  v-model="materialForm.cartonQty"
+                  :min="0"
+                  :precision="2"
+                  controls-position="right"
+                  style="width: 100%"
+                />
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+
         <el-form-item
-            label="闇�姹傛暟閲�"
-            prop="quantity"
+          label="闇�姹傛暟閲�"
+          prop="quantity"
+          :rules="[
+            {
+              required: true,
+              message: '璇峰~鍐欓渶姹傛暟閲�',
+              trigger: 'change',
+            },
+          ]"
         >
           <el-input-number v-model="formState.quantity" :step="1" :min="1" style="width: 100%" />
         </el-form-item>
       </el-form>
 
-      <!-- 浜у搧閫夋嫨寮圭獥 -->
       <ProductSelectDialog
-          v-model="showProductSelectDialog"
-          @confirm="handleProductSelect"
-          single
+        v-model="showProductSelectDialog"
+        @confirm="handleProductSelect"
+        single
       />
       <template #footer>
         <div class="dialog-footer">
@@ -74,26 +175,21 @@
 </template>
 
 <script setup>
-import {ref, computed, getCurrentInstance} from "vue";
+import { computed, getCurrentInstance, reactive, ref, watch } from "vue";
 import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
-import {addProductOrder, listProcessRoute} from "@/api/productionManagement/productionOrder.js";
+import { addProductOrder, listProcessRoute } from "@/api/productionManagement/productionOrder.js";
+import { modelList, productTreeList } from "@/api/basicData/product.js";
 
 const props = defineProps({
   visible: {
     type: Boolean,
     required: true,
   },
-
-  type: {
-    type: String,
-    required: true,
-    default: 'qualified',
-  },
 });
 
-const emit = defineEmits(['update:visible', 'completed']);
+const emit = defineEmits(["update:visible", "completed"]);
 
-// 鍝嶅簲寮忔暟鎹紙鏇夸唬閫夐」寮忕殑 data锛�
+const formRef = ref();
 const formState = ref({
   productId: undefined,
   productModelId: undefined,
@@ -104,85 +200,255 @@
   quantity: 0,
 });
 
+const materialForm = reactive({
+  productCategoryId: null,
+  productCategory: "",
+  materialModel: "",
+  basePaperQty: null,
+  cartonQty: null,
+});
+
+const bindProductOptions = ref([]);
+const bindProductLoading = ref(false);
+const bindMaterialModelOptions = ref([]);
+const bindMaterialModelLoading = ref(false);
+const routeOptions = ref([]);
+const bindRouteLoading = ref(false);
+
 const isShow = computed({
   get() {
     return props.visible;
   },
   set(val) {
-    emit('update:visible', val);
+    emit("update:visible", val);
   },
 });
 
 const showProductSelectDialog = ref(false);
+const { proxy } = getCurrentInstance();
 
-let { proxy } = getCurrentInstance()
+const resetMaterialForm = () => {
+  materialForm.productCategoryId = null;
+  materialForm.productCategory = "";
+  materialForm.materialModel = "";
+  materialForm.basePaperQty = null;
+  materialForm.cartonQty = null;
+  bindMaterialModelOptions.value = [];
+};
 
 const closeModal = () => {
-  // 閲嶇疆琛ㄥ崟鏁版嵁
   formState.value = {
     productId: undefined,
     productModelId: undefined,
     routeId: undefined,
     productName: "",
     productModelName: "",
-    quantity: '',
+    unit: "",
+    quantity: 0,
   };
+  routeOptions.value = [];
+  resetMaterialForm();
   isShow.value = false;
 };
 
-// 浜у搧閫夋嫨澶勭悊
 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;
-    showProductSelectDialog.value = false;
-    fetchRouteOptions( product.id);
-    // 瑙﹀彂琛ㄥ崟楠岃瘉鏇存柊
-    proxy.$refs["formRef"]?.validateField('productModelId');
-  }
+  if (!products || products.length === 0) return;
+  const product = products[0];
+  const selectedProductModelId = product.productModelId ?? product.id;
+  const selectedProductId = product.productId ?? product.parentId ?? product.topProductParentId;
+  formState.value.productId = selectedProductId;
+  formState.value.productName = product.productName;
+  formState.value.productModelName = product.model;
+  formState.value.productModelId = selectedProductModelId;
+  formState.value.unit = product.unit;
+  showProductSelectDialog.value = false;
+  fetchRouteOptions(selectedProductModelId);
+  formRef.value?.validateField("productModelId");
 };
 
-const routeOptions = ref([]);
-const bindRouteLoading = ref(false);
 const fetchRouteOptions = (productModelId) => {
+  if (!productModelId) {
+    routeOptions.value = [];
+    formState.value.routeId = undefined;
+    return;
+  }
   formState.value.routeId = undefined;
-  routeOptions.value = []
+  routeOptions.value = [];
   bindRouteLoading.value = true;
-  listProcessRoute({ productModelId: productModelId }).then(res => {
+  listProcessRoute({ productModelId }).then((res) => {
     routeOptions.value = res.data || [];
   }).finally(() => {
     bindRouteLoading.value = false;
-  })
-}
-
-const handleSubmit = () => {
-  proxy.$refs["formRef"].validate(valid => {
-    if (valid) {
-      // 楠岃瘉鏄惁閫夋嫨浜嗕骇鍝佸拰瑙勬牸
-      if (!formState.value.productModelId) {
-        proxy.$modal.msgError("璇烽�夋嫨浜у搧");
-        return;
-      }
-      if (!formState.value.productModelId) {
-        proxy.$modal.msgError("璇烽�夋嫨瑙勬牸");
-        return;
-      }
-
-      addProductOrder(formState.value).then(res => {
-        // 鍏抽棴妯℃�佹
-        isShow.value = false;
-        // 鍛婄煡鐖剁粍浠跺凡瀹屾垚
-        emit('completed');
-        proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
-      })
-    }
-  })
+  });
 };
 
+function convertIdToValue(data) {
+  return (data || []).map((item) => {
+    const { id, children, ...rest } = item;
+    const node = {
+      ...rest,
+      value: id,
+    };
+    if (children && children.length > 0) {
+      node.children = convertIdToValue(children);
+    }
+    return node;
+  });
+}
+
+const findNodeById = (nodes, productId) => {
+  const tree = nodes || [];
+  for (let i = 0; i < tree.length; i++) {
+    if (String(tree[i].value) === String(productId)) {
+      return tree[i].label;
+    }
+    if (tree[i].children && tree[i].children.length > 0) {
+      const found = findNodeById(tree[i].children, productId);
+      if (found) return found;
+    }
+  }
+  return "";
+};
+
+const loadBindProductOptions = async () => {
+  bindProductLoading.value = true;
+  try {
+    const res = await productTreeList();
+    bindProductOptions.value = convertIdToValue(res || []);
+  } catch (e) {
+    console.error("鑾峰彇浜у搧閫夐」澶辫触锛�", e);
+  } finally {
+    bindProductLoading.value = false;
+  }
+};
+
+const loadBindMaterialModelOptions = async (productCategoryId) => {
+  if (!productCategoryId) {
+    bindMaterialModelOptions.value = [];
+    materialForm.materialModel = "";
+    return;
+  }
+  bindMaterialModelLoading.value = true;
+  try {
+    const res = await modelList({ id: productCategoryId });
+    const list = Array.isArray(res) ? res : (Array.isArray(res?.data) ? res.data : []);
+    const mapped = list
+      .map((item) => ({
+        label: item.model || "",
+        value: item.model || "",
+      }))
+      .filter((item) => item.value);
+    const unique = [];
+    const seen = new Set();
+    mapped.forEach((item) => {
+      if (!seen.has(item.value)) {
+        seen.add(item.value);
+        unique.push(item);
+      }
+    });
+    bindMaterialModelOptions.value = unique;
+    if (!unique.some((item) => item.value === materialForm.materialModel)) {
+      materialForm.materialModel = "";
+    }
+  } catch (e) {
+    console.error("鑾峰彇鍘熸枡鍨嬪彿澶辫触锛�", e);
+    bindMaterialModelOptions.value = [];
+    materialForm.materialModel = "";
+  } finally {
+    bindMaterialModelLoading.value = false;
+  }
+};
+
+const handleMaterialCategoryChange = async (value) => {
+  materialForm.productCategoryId = value;
+  materialForm.productCategory = findNodeById(bindProductOptions.value, value);
+  materialForm.materialModel = "";
+  await loadBindMaterialModelOptions(value);
+};
+
+const isEmptyField = (value) => value === null || value === undefined || value === "";
+
+const validateMaterialForm = () => {
+  if (!materialForm.productCategoryId && !materialForm.productCategory) {
+    return { valid: false, message: "璇烽�夋嫨鍘熺焊瑙勬牸" };
+  }
+  if (!materialForm.materialModel) {
+    return { valid: false, message: "璇烽�夋嫨鍘熸枡鍨嬪彿" };
+  }
+  if (isEmptyField(materialForm.basePaperQty)) {
+    return { valid: false, message: "璇峰~鍐欏師绾搁渶瑕侀噺" };
+  }
+  if (isEmptyField(materialForm.cartonQty)) {
+    return { valid: false, message: "璇峰~鍐欑焊绠遍渶瑕侀噺" };
+  }
+  return { valid: true, message: "" };
+};
+
+const validateOrderForm = () => {
+  if (!formState.value.productModelId) {
+    return { valid: false, message: "璇烽�夋嫨浜у搧" };
+  }
+  if (!formState.value.productModelName) {
+    return { valid: false, message: "璇烽�夋嫨瑙勬牸" };
+  }
+  if (!formState.value.unit) {
+    return { valid: false, message: "璇烽�夋嫨鍗曚綅" };
+  }
+  if (!formState.value.routeId) {
+    return { valid: false, message: "璇烽�夋嫨宸ヨ壓璺嚎" };
+  }
+  if (!(Number(formState.value.quantity || 0) > 0)) {
+    return { valid: false, message: "璇峰~鍐欓渶姹傛暟閲�" };
+  }
+  return { valid: true, message: "" };
+};
+
+watch(
+  () => isShow.value,
+  (visible) => {
+    if (visible) {
+      loadBindProductOptions();
+    }
+  },
+  { immediate: true }
+);
+
+const handleSubmit = () => {
+  formRef.value?.validate((valid) => {
+    if (!valid) return;
+    const orderValidateResult = validateOrderForm();
+    if (!orderValidateResult.valid) {
+      proxy.$modal.msgWarning(orderValidateResult.message);
+      return;
+    }
+    const materialValidateResult = validateMaterialForm();
+    if (!materialValidateResult.valid) {
+      proxy.$modal.msgWarning(materialValidateResult.message);
+      return;
+    }
+    const submitData = {
+      ...formState.value,
+      productId: formState.value.productId,
+      productModelId: formState.value.productModelId,
+      materialList: [
+        {
+          productModelId: formState.value.productModelId,
+          productCategoryId: materialForm.productCategoryId,
+          productCategory: materialForm.productCategory,
+          materialName: materialForm.productCategory,
+          materialModel: materialForm.materialModel,
+          basePaperQty: materialForm.basePaperQty,
+          cartonQty: materialForm.cartonQty,
+        },
+      ],
+    };
+    addProductOrder(submitData).then(() => {
+      isShow.value = false;
+      emit("completed");
+      proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+    });
+  });
+};
 
 defineExpose({
   closeModal,
@@ -190,3 +456,9 @@
   isShow,
 });
 </script>
+
+<style scoped lang="scss">
+.material-table {
+  width: 100%;
+}
+</style>
diff --git a/src/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue b/src/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue
index 2379076..c7d6cfb 100644
--- a/src/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue
+++ b/src/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue
@@ -6,13 +6,9 @@
         <el-table-column label="鍘熸枡鍨嬪彿" prop="materialModel" min-width="180" />
         <el-table-column label="鍘熺焊闇�瑕侀噺" prop="basePaperQty" min-width="120" />
         <el-table-column label="绾哥闇�瑕侀噺" prop="cartonQty" min-width="120" />
-        <el-table-column label="濉戞枡琚嬫暟閲�" prop="plasticBagQty" min-width="120" />
-        <el-table-column label="璁¢噺鍗曚綅" prop="unit" width="100" />
         <el-table-column label="鍘熺焊棰嗙敤鏁伴噺" prop="basePaperPickQty" min-width="120" />
         <el-table-column label="绾哥棰嗙敤鏁伴噺" prop="cartonPickQty" min-width="120" />
-        <el-table-column label="濉戞枡琚嬮鐢ㄦ暟閲�" prop="plasticBagPickQty" min-width="120" />
         <el-table-column label="閫�鏂欐暟閲�" prop="returnQty" min-width="110" />
-        <el-table-column label="瀹為檯鏁伴噺" prop="actualQty" min-width="110" />
       </el-table>
       <template #footer>
         <span class="dialog-footer">
@@ -33,7 +29,6 @@
       <el-table :data="returnSummaryList" border row-key="summaryKey">
         <el-table-column label="鍘熸枡鍚嶇О" prop="materialName" min-width="180" />
         <el-table-column label="鍘熸枡鍨嬪彿" prop="materialModel" min-width="180" />
-        <el-table-column label="璁¢噺鍗曚綅" prop="unit" min-width="100" />
         <el-table-column label="閫�鏂欐眹鎬绘暟閲�" prop="returnQtyTotal" min-width="140" />
       </el-table>
 
@@ -71,11 +66,7 @@
 const getPickQty = item => {
   const directPick = Number(item.pickQty ?? NaN);
   if (Number.isFinite(directPick)) return directPick;
-  return (
-    Number(item.basePaperPickQty || 0) +
-    Number(item.cartonPickQty || 0) +
-    Number(item.plasticBagPickQty || 0)
-  );
+  return Number(item.basePaperPickQty || 0) + Number(item.cartonPickQty || 0);
 };
 const calcReturnQty = item =>
   getPickQty(item) - Number(item.actualQty || 0);
@@ -120,12 +111,11 @@
   materialDetailTableData.value.forEach(item => {
     const returnQty = calcReturnQty(item);
     if (returnQty <= 0) return;
-    const key = `${item.materialModelId || ""}_${item.materialName || ""}_${item.materialModel || ""}_${item.unit || ""}`;
+    const key = `${item.materialModelId || ""}_${item.materialName || ""}_${item.materialModel || ""}`;
     const old = map.get(key) || {
       summaryKey: key,
       materialName: item.materialName || "",
       materialModel: item.materialModel || "",
-      unit: item.unit || "",
       returnQtyTotal: 0,
     };
     old.returnQtyTotal += returnQty;
diff --git a/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue b/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
index 7442a11..aa06bd1 100644
--- a/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
+++ b/src/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue
@@ -22,11 +22,6 @@
             {{ row.cartonQty ?? "-" }}
           </template>
         </el-table-column>
-        <el-table-column label="濉戞枡琚嬫暟閲�" min-width="120">
-          <template #default="{ row }">
-            {{ row.plasticBagQty ?? "-" }}
-          </template>
-        </el-table-column>
 <!--        <el-table-column label="璁¢噺鍗曚綅" width="120">-->
 <!--          <template #default="{ row }">-->
 <!--            {{ row.unit || "-" }}-->
@@ -48,18 +43,6 @@
           <template #default="{ row }">
             <el-input-number
               v-model="row.cartonPickQty"
-              :min="0"
-              :precision="3"
-              :step="1"
-              controls-position="right"
-              style="width: 100%;"
-            />
-          </template>
-        </el-table-column>
-        <el-table-column label="濉戞枡琚嬮鐢ㄦ暟閲�" min-width="120">
-          <template #default="{ row }">
-            <el-input-number
-              v-model="row.plasticBagPickQty"
               :min="0"
               :precision="3"
               :step="1"
@@ -130,10 +113,8 @@
   materialModel: row.materialModel || "",
   basePaperQty: Number(row.basePaperQty ?? row.requiredQty ?? 0),
   cartonQty: Number(row.cartonQty ?? 0),
-  plasticBagQty: Number(row.plasticBagQty ?? 0),
   basePaperPickQty: Number(row.basePaperPickQty ?? row.pickQty ?? 0),
   cartonPickQty: Number(row.cartonPickQty ?? 0),
-  plasticBagPickQty: Number(row.plasticBagPickQty ?? 0),
   unit: row.unit || "",
 });
 
@@ -217,9 +198,7 @@
       item.basePaperPickQty === null ||
       item.basePaperPickQty === undefined ||
       item.cartonPickQty === null ||
-      item.cartonPickQty === undefined ||
-      item.plasticBagPickQty === null ||
-      item.plasticBagPickQty === undefined
+      item.cartonPickQty === undefined
   );
   if (invalidRow) {
     return { valid: false, message: "璇峰畬鍠勯鐢ㄦ暟閲忓悗鍐嶄繚瀛�" };
@@ -236,7 +215,8 @@
   }
   materialSaving.value = true;
   try {
-    await saveMaterialPickingLedger(materialTableData.value[0]);
+    const firstRow = { ...materialTableData.value[0] };
+    await saveMaterialPickingLedger(firstRow);
     emit("saved");
     dialogVisible.value = false;
   } finally {
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index e00becb..bfbca98 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -175,17 +175,6 @@
                                  style="width: 100%" />
               </template>
             </el-table-column>
-            <el-table-column label="濉戞枡琚嬫暟閲�"
-                             min-width="120"
-                             align="center">
-              <template #default>
-                <el-input-number v-model="bindForm.plasticBagQty"
-                                 :min="0"
-                                 :precision="2"
-                                 controls-position="right"
-                                 style="width: 100%" />
-              </template>
-            </el-table-column>
           </el-table>
         </el-form-item>
       </el-form>
@@ -417,13 +406,13 @@
   const bindRouteTableData = computed(() => currentBindOrderRow.value ? [currentBindOrderRow.value] : []);
   const bindForm = reactive({
     orderId: null,
+    productModelId: null,
     routeId: null,
     productCategoryId: null,
     productCategory: "",
     materialModel: "",
     basePaperQty: null,
     cartonQty: null,
-    plasticBagQty: null,
   });
   const materialDialogVisible = ref(false);
   const currentMaterialOrder = ref(null);
@@ -523,13 +512,13 @@
   const openBindRouteDialog = async row => {
     currentBindOrderRow.value = row;
     bindForm.orderId = row.id;
+    bindForm.productModelId = row.productModelId || null;
     bindForm.routeId = null;
     bindForm.productCategoryId = row.productCategoryId || null;
     bindForm.productCategory = row.productCategory || "";
     bindForm.materialModel = row.materialModel || "";
     bindForm.basePaperQty = null;
     bindForm.cartonQty = null;
-    bindForm.plasticBagQty = null;
     bindProductOptions.value = [];
     bindMaterialModelOptions.value = [];
     bindRouteDialogVisible.value = true;
@@ -581,10 +570,6 @@
       proxy.$modal.msgWarning("璇峰~鍐欑焊绠遍渶瑕侀噺");
       return;
     }
-    if (isEmptyField(bindForm.plasticBagQty)) {
-      proxy.$modal.msgWarning("璇峰~鍐欏鏂欒鏁伴噺");
-      return;
-    }
     bindRouteSaving.value = true;
     try {
       await bindingRoute({
@@ -592,13 +577,13 @@
         routeId: bindForm.routeId,
         materialList: [
           {
+            productModelId: bindForm.productModelId,
             productCategoryId: bindForm.productCategoryId,
             productCategory: bindForm.productCategory,
             materialName: bindForm.productCategory,
             materialModel: bindForm.materialModel,
             basePaperQty: bindForm.basePaperQty,
             cartonQty: bindForm.cartonQty,
-            plasticBagQty: bindForm.plasticBagQty,
           },
         ],
       });
diff --git a/src/views/salesManagement/invoiceRegistration/index.vue b/src/views/salesManagement/invoiceRegistration/index.vue
index 7a21e34..a6c0386 100644
--- a/src/views/salesManagement/invoiceRegistration/index.vue
+++ b/src/views/salesManagement/invoiceRegistration/index.vue
@@ -443,7 +443,7 @@
 	rules: {
 		createUer: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }],
 		issueDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
-		invoiceNo: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
+		invoiceNo: [{ required: false, message: "璇疯緭鍏�", trigger: "change" }],
 		createTime: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
 	},
 });

--
Gitblit v1.9.3