From ee7ac8df8bce38add1f75baf876b49de94b9e00a Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期五, 16 十月 2026 17:58:33 +0800
Subject: [PATCH] feat(mes): 赋码管理绑定托盘支持未录入批次的袋码

---
 src/views/wls/productsales/data.ts |   59 ++++++-----------------------------------------------------
 1 files changed, 6 insertions(+), 53 deletions(-)

diff --git a/src/views/wls/productsales/data.ts b/src/views/wls/productsales/data.ts
index 4834c35..192d780 100644
--- a/src/views/wls/productsales/data.ts
+++ b/src/views/wls/productsales/data.ts
@@ -13,6 +13,7 @@
   DICT_TYPE,
   MesAutoCodeRuleCode,
   MesWmSalesNoticeStatusEnum,
+  MesWmWarehouseTypeEnum,
 } from '@vben/constants';
 import { getDictOptions } from '@vben/hooks';
 
@@ -21,7 +22,6 @@
 import { z } from '#/adapter/form';
 import CrmCustomerSelect from '#/components/crm-customer-select.vue';
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
-import { ErpSaleOrderSelect } from '#/views/erp/sale/order/components';
 import { getRangePickerDefaultProps } from '#/utils';
 import { MdItemSelect } from '#/views/mes/md/item/components';
 import { WmMaterialStockSelect } from '#/views/wls/materialstock/components';
@@ -125,52 +125,16 @@
       component: markRaw(WmSalesNoticeSelect),
       componentProps: {
         disabled: isHeaderReadonly(formType),
-        // 閫夋嫨鍙戣揣閫氱煡鍗曞悗锛岃嚜鍔ㄥ洖濉攢鍞鍗曞彿銆佸鎴枫�佹敹璐т汉淇℃伅
+        // 閫夋嫨鍙戣揣閫氱煡鍗曞悗锛岃嚜鍔ㄥ洖濉鎴枫�佹敹璐т汉淇℃伅
         onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => {
           await formApi?.setValues({
             clientId: notice?.clientId,
             contactAddress: notice?.recipientAddress,
             contactName: notice?.recipientName,
             contactTelephone: notice?.recipientTelephone,
-            salesOrderCode: notice?.salesOrderCode,
           });
         },
         status: MesWmSalesNoticeStatusEnum.APPROVED,
-      },
-    },
-    {
-      fieldName: 'saleOrderId',
-      label: '閿�鍞鍗曠紪鍙�',
-      component: markRaw(ErpSaleOrderSelect),
-      componentProps: {
-        disabled: isHeaderReadonly(formType),
-        placeholder: '璇烽�夋嫨閿�鍞鍗�',
-        onChange: (item: any) => {
-          if (formApi) {
-            formApi.setFieldValue('salesOrderCode', item?.no ?? '');
-            if (item?.customerId) {
-              formApi.setFieldValue('clientId', item.customerId);
-            }
-          }
-        },
-      },
-      rules: 'selectRequired',
-      dependencies: {
-        triggerFields: ['salesOrderCode'],
-        if: () => formType === 'create',
-      },
-    },
-    {
-      fieldName: 'salesOrderCode',
-      label: '閿�鍞鍗曠紪鍙�',
-      component: 'Input',
-      componentProps: {
-        disabled: true,
-        placeholder: '閿�鍞鍗曠紪鍙�',
-      },
-      dependencies: {
-        triggerFields: [''],
-        if: () => formType !== 'create',
       },
     },
     {
@@ -285,15 +249,6 @@
       },
     },
     {
-      fieldName: 'salesOrderCode',
-      label: '閿�鍞鍗曠紪鍙�',
-      component: 'Input',
-      componentProps: {
-        allowClear: true,
-        placeholder: '璇疯緭鍏ラ攢鍞鍗曠紪鍙�',
-      },
-    },
-    {
       fieldName: 'clientId',
       label: '瀹㈡埛',
       component: markRaw(CrmCustomerSelect),
@@ -343,11 +298,6 @@
     {
       field: 'noticeCode',
       title: '鍙戣揣閫氱煡鍗曞彿',
-      minWidth: 160,
-    },
-    {
-      field: 'salesOrderCode',
-      title: '閿�鍞鍗曠紪鍙�',
       minWidth: 160,
     },
     {
@@ -584,7 +534,7 @@
       title: '鎵爜鏉ユ簮',
       minWidth: 110,
       formatter: ({ row }) =>
-        row.palletCodeId ? `鎵樼洏鐮� #${row.palletCodeId}` : row.bagCodeId ? `琚嬬爜 #${row.bagCodeId}` : '鎵嬪伐鎷h揣',
+         row.bagCodeId ? `琚嬬爜 #${row.bagCodeId}${row.palletCodeId ? ` / 鎵樼洏 #${row.palletCodeId}` : ''}` : row.palletCodeId ? `鎵樼洏鐮� #${row.palletCodeId}` : '鎵嬪伐鎷h揣',
     },
     {
       field: 'warehouseName',
@@ -606,6 +556,7 @@
       title: '鏁伴噺',
       width: 100,
     },
+    { field: 'remark', title: '琚嬬爜涓庢壂鐮佹潵婧�', minWidth: 240 },
     ...(stockable
       ? [
           {
@@ -651,6 +602,8 @@
       label: '閫夋嫨搴撳瓨',
       component: markRaw(WmMaterialStockSelect),
       componentProps: {
+        // 鍙粠鍚堟牸浠撳簱锛坱ype=20锛夐�夋嫨鍙嫞璐у簱瀛�
+        warehouseType: MesWmWarehouseTypeEnum.QUALIFIED,
         // 閫夋嫨搴撳瓨璁板綍鍚庯紝鑷姩鍥炲~浠撳簱/搴撳尯/搴撲綅/鎵规/鏁伴噺
         onChange: async (stock?: MesWmMaterialStockApi.MaterialStock) => {
           await formApi?.setValues({

--
Gitblit v1.9.3