From c3651a1361b3c558d6b4f7a4a7995dbfece76a61 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 20 七月 2026 10:32:48 +0800
Subject: [PATCH] 银川 1.销售订单页面展示字段修改 2.修改商机中产品时,输入价格与数量,下方滑动条会自动到最前方,需要重新拉动滑动条才能看到价格与数量输入框

---
 src/views/crm/product/components/edit-table.vue |   27 ++++---------
 src/api/erp/sale/order/index.ts                 |    2 +
 src/views/erp/sale/order/index.vue              |    9 ++++
 src/views/crm/business/modules/form.vue         |    2 
 src/views/erp/sale/order/modules/form.vue       |    6 ++
 src/views/erp/sale/order/data.ts                |   62 ++++++++++++++++++++++++++++---
 src/views/crm/product/components/data.ts        |    5 --
 7 files changed, 82 insertions(+), 31 deletions(-)

diff --git a/src/api/erp/sale/order/index.ts b/src/api/erp/sale/order/index.ts
index 61a9cd6..5fb0764 100644
--- a/src/api/erp/sale/order/index.ts
+++ b/src/api/erp/sale/order/index.ts
@@ -27,6 +27,8 @@
     contractId?: number; // 鍏宠仈 CRM 鍚堝悓缂栧彿
     contractNo?: string; // CRM 鍚堝悓鍗曞彿
     needProduction?: number; // 鏄惁闇�瑕佺敓浜э細0-涓嶉渶瑕侊紝1-闇�瑕�
+    productionStatus?: number; // 鐢熶骇鐘舵�侊細0-鏈畬鎴愶紝1-宸插畬鎴�
+    productionFinishTime?: Date; // 鐢熶骇瀹屾垚鏃堕棿
     hasSalesNotice?: boolean; // 鏄惁宸茬敓鎴愬彂璐ч�氱煡鍗�
     canCreateSalesNotice?: boolean; // 鏄惁鍙互鐢熸垚鍙戣揣閫氱煡鍗�
     items?: SaleOrderItem[]; // 閿�鍞鍗曚骇鍝佹槑缁嗗垪琛�
diff --git a/src/views/crm/business/modules/form.vue b/src/views/crm/business/modules/form.vue
index 97d7493..6b312cb 100644
--- a/src/views/crm/business/modules/form.vue
+++ b/src/views/crm/business/modules/form.vue
@@ -105,7 +105,7 @@
 </script>
 
 <template>
-  <Modal :title="getTitle" class="w-1/2">
+  <Modal :title="getTitle" class="w-3/4">
     <Form class="mx-4">
       <template #product="slotProps">
         <ProductEditTable
diff --git a/src/views/crm/product/components/data.ts b/src/views/crm/product/components/data.ts
index 2892603..75d25ba 100644
--- a/src/views/crm/product/components/data.ts
+++ b/src/views/crm/product/components/data.ts
@@ -67,11 +67,6 @@
       minWidth: 120,
     },
     {
-      field: 'itemBarCode',
-      title: '鏉$爜',
-      minWidth: 150,
-    },
-    {
       field: 'itemUnitName',
       title: '鍗曚綅',
       minWidth: 80,
diff --git a/src/views/crm/product/components/edit-table.vue b/src/views/crm/product/components/edit-table.vue
index e10c345..113080c 100644
--- a/src/views/crm/product/components/edit-table.vue
+++ b/src/views/crm/product/components/edit-table.vue
@@ -3,15 +3,15 @@
 import type { CrmContractApi } from '#/api/crm/contract';
 import type { MdmItemApi } from '#/api/mdm/item';
 
-import { nextTick, onMounted, ref, watch } from 'vue';
+import { nextTick, ref, watch } from 'vue';
 
 import { erpPriceMultiply } from '@vben/utils';
 
-import { InputNumber, Select } from 'ant-design-vue';
+import { InputNumber } from 'ant-design-vue';
 
 import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
 import { BizTypeEnum } from '#/api/crm/permission';
-import { getItemPage } from '#/api/mdm/item';
+import { MdmItemSelect } from '#/views/basicData/mdm/components';
 import { $t } from '#/locales';
 
 import { useProductEditTableColumns } from './data';
@@ -39,12 +39,11 @@
 }
 
 /** 鍒囨崲浜у搧鏃跺悓姝ュ熀纭�淇℃伅 */
-function handleProductChange(itemId: any, row: any) {
-  const product = productOptions.value.find((p) => p.id === itemId);
+function handleProductChange(product: MdmItemApi.Item | undefined, row: any) {
   if (!product) {
     return;
   }
-  row.itemId = itemId;
+  row.itemId = product.id;
   row.itemName = product.name;
   row.itemCode = product.code;
   row.itemBarCode = product.barCode;
@@ -118,23 +117,15 @@
     immediate: true,
   },
 );
-
-/** 鍒濆鍖� */
-const productOptions = ref<MdmItemApi.Item[]>([]); // 鐗╂枡涓嬫媺閫夐」
-onMounted(async () => {
-  const res = await getItemPage({ pageNo: 1, pageSize: 100, status: 0 });
-  productOptions.value = res.list || [];
-});
 </script>
 
 <template>
   <Grid class="w-full">
     <template #itemId="{ row }">
-      <Select
-        v-model:value="row.itemId"
-        :options="productOptions"
-        :field-names="{ label: 'name', value: 'id' }"
-        class="w-full"
+      <MdmItemSelect
+        :model-value="row.itemId"
+        placeholder="璇烽�夋嫨浜у搧"
+        @update:model-value="row.itemId = $event"
         @change="handleProductChange($event, row)"
       />
     </template>
diff --git a/src/views/erp/sale/order/data.ts b/src/views/erp/sale/order/data.ts
index eb76efe..9aea440 100644
--- a/src/views/erp/sale/order/data.ts
+++ b/src/views/erp/sale/order/data.ts
@@ -36,6 +36,35 @@
       },
     },
     {
+      fieldName: 'productionStatus',
+      label: '鐢熶骇鐘舵��',
+      component: 'Input',
+      dependencies: {
+        triggerFields: ['needProduction', 'productionStatus'],
+        show: (values) => {
+          return formType === 'detail' && values.needProduction === 1;
+        },
+      },
+      componentProps: {
+        disabled: true,
+      },
+      slots: { default: 'productionStatus' },
+    },
+    {
+      fieldName: 'productionFinishTime',
+      label: '鐢熶骇瀹屾垚鏃堕棿',
+      component: 'Input',
+      dependencies: {
+        triggerFields: ['productionStatus'],
+        show: (values) => {
+          return formType === 'detail' && values.productionStatus === 1;
+        },
+      },
+      componentProps: {
+        disabled: true,
+      },
+    },
+    {
       fieldName: 'orderTime',
       label: '璁㈠崟鏃堕棿',
       component: 'DatePicker',
@@ -375,6 +404,19 @@
       },
     },
     {
+      fieldName: 'productionStatus',
+      label: '鐢熶骇鐘舵��',
+      component: 'Select',
+      componentProps: {
+        options: [
+          { label: '鏈畬鎴�', value: 0 },
+          { label: '宸插畬鎴�', value: 1 },
+        ],
+        placeholder: '璇烽�夋嫨鐢熶骇鐘舵��',
+        allowClear: true,
+      },
+    },
+    {
       fieldName: 'returnStatus',
       label: '閫�璐х姸鎬�',
       component: 'Select',
@@ -441,12 +483,6 @@
       minWidth: 120,
     },
     {
-      field: 'outStatus',
-      title: '鍑哄簱鐘舵��',
-      minWidth: 100,
-      slots: { default: 'outStatus' },
-    },
-    {
       field: 'totalProductPrice',
       title: '閲戦鍚堣',
       formatter: 'formatAmount2',
@@ -465,6 +501,20 @@
       minWidth: 120,
     },
     {
+      field: 'outStatus',
+      title: '鍑哄簱鐘舵��',
+      minWidth: 100,
+      fixed: 'right',
+      slots: { default: 'outStatus' },
+    },
+    {
+      field: 'productionStatus',
+      title: '鐢熶骇鐘舵��',
+      minWidth: 100,
+      fixed: 'right',
+      slots: { default: 'productionStatus' },
+    },
+    {
       field: 'status',
       title: '鐘舵��',
       minWidth: 100,
diff --git a/src/views/erp/sale/order/index.vue b/src/views/erp/sale/order/index.vue
index 4e83fce..2df5b89 100644
--- a/src/views/erp/sale/order/index.vue
+++ b/src/views/erp/sale/order/index.vue
@@ -266,6 +266,15 @@
         <Tag v-else-if="row.outStatus === 2" color="warning">閮ㄥ垎鍑哄簱</Tag>
         <Tag v-else-if="row.outStatus === 3" color="success">鍏ㄩ儴鍑哄簱</Tag>
       </template>
+      <template #productionStatus="{ row }">
+        <template v-if="row.needProduction !== 1">
+          <Tag color="default">鏃犻渶鐢熶骇</Tag>
+        </template>
+        <template v-else>
+          <Tag v-if="row.productionStatus === 0" color="warning">鏈畬鎴�</Tag>
+          <Tag v-else-if="row.productionStatus === 1" color="success">宸插畬鎴�</Tag>
+        </template>
+      </template>
       <template #actions="{ row }">
         <TableAction
           :actions="[
diff --git a/src/views/erp/sale/order/modules/form.vue b/src/views/erp/sale/order/modules/form.vue
index 33114ac..213fb44 100644
--- a/src/views/erp/sale/order/modules/form.vue
+++ b/src/views/erp/sale/order/modules/form.vue
@@ -7,7 +7,7 @@
 
 import { useVbenModal } from '@vben/common-ui';
 
-import { message } from 'ant-design-vue';
+import { message, Tag } from 'ant-design-vue';
 
 import { useVbenForm } from '#/adapter/form';
 import { getAccountSimpleList } from '#/api/erp/finance/account';
@@ -148,6 +148,10 @@
     :show-confirm-button="formType !== 'detail'"
   >
     <Form class="mx-3">
+      <template #productionStatus="{ modelValue }">
+        <Tag v-if="modelValue === 0" color="warning">鏈畬鎴�</Tag>
+        <Tag v-else-if="modelValue === 1" color="success">宸插畬鎴�</Tag>
+      </template>
       <template #items>
         <ItemForm
           ref="itemFormRef"

--
Gitblit v1.9.3