From b018e5ed2c5c6c183542e9d09fb0c0ac2ea0c95f Mon Sep 17 00:00:00 2001
From: zhaoyiran <yiran_zhao6@163.com>
Date: Thu, 13 Mar 2025 09:40:13 +0800
Subject: [PATCH] =?UTF-8?q?YT-2079=E7=9B=98=E7=82=B9=E9=85=8D=E7=BD=AE?=
 =?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../count/countConfig/countConfig.data.ts     | 60 ++++++++++++++++++-
 .../countManage/count/countConfig/index.vue   | 15 ++++-
 2 files changed, 70 insertions(+), 5 deletions(-)

diff --git a/src/views/wms/countManage/count/countConfig/countConfig.data.ts b/src/views/wms/countManage/count/countConfig/countConfig.data.ts
index 8291c65a3..39fe63dd4 100644
--- a/src/views/wms/countManage/count/countConfig/countConfig.data.ts
+++ b/src/views/wms/countManage/count/countConfig/countConfig.data.ts
@@ -1,5 +1,7 @@
 import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
 import { dateFormatter } from '@/utils/formatTime'
+import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
+import * as ItembasicApi from '@/api/wms/itembasic'
 
 // 表单校验
 export const CountConfigRules = reactive({
@@ -10,7 +12,7 @@ export const CountConfigRules = reactive({
 
 export const CountConfig = useCrudSchemas(reactive<CrudSchema[]>([
   {
-    label: '物品代码',
+    label: '品番',
     field: 'itemCode',
     sort: 'custom',
     table: {
@@ -18,14 +20,44 @@ export const CountConfig = useCrudSchemas(reactive<CrudSchema[]>([
       fixed: 'left'
     },
     isSearch: true,
+    form: {
+      // labelMessage: '信息提示说明!!!',
+      componentProps: {
+        enterSearch: true,
+        isSearchList: true,
+        searchListPlaceholder: '请选择物料基本信息',
+        searchField: 'code',
+        searchTitle: '物料基本信息',
+        searchAllSchemas: Itembasic.allSchemas,
+        searchPage: ItembasicApi.getItembasicPage,
+        searchCondition: [{
+          key: 'available',
+          value: 'TRUE',
+          isMainValue: false
+        }],
+        verificationParams: [{
+          key: 'code',
+          action: '==',
+          value: '',
+          isMainValue: false,
+          isSearch: true,
+          isFormModel: true,
+        }], // 失去焦点校验参数
+      }
+    }
   },
   {
-    label: '物料名称',
+    label: '品名',
     field: 'itemName',
     sort: 'custom',
     table: {
       width: 180
     },
+    form:{
+      componentProps:{
+        disabled: true
+      }
+    }
   },
   {
     label: '背番',
@@ -34,14 +66,26 @@ export const CountConfig = useCrudSchemas(reactive<CrudSchema[]>([
     table: {
       width: 100
     },
+    form:{
+      componentProps:{
+        disabled: true
+      }
+    }
   },
   {
     label: '计量单位',
     field: 'uom',
     sort: 'custom',
+    dictType: DICT_TYPE.UOM,
+    dictClass: 'string',
     table: {
       width: 100
     },
+    form:{
+      componentProps:{
+        disabled: true
+      }
+    }
   },
   {
     label: '包装规格',
@@ -50,6 +94,11 @@ export const CountConfig = useCrudSchemas(reactive<CrudSchema[]>([
     table: {
       width: 100
     },
+    form:{
+      componentProps:{
+        disabled: true
+      }
+    }
   },
   {
     label: '包装数量',
@@ -58,6 +107,11 @@ export const CountConfig = useCrudSchemas(reactive<CrudSchema[]>([
     table: {
       width: 100
     },
+    form:{
+      componentProps:{
+        disabled: true
+      }
+    }
   },
   {
     label: '盘点模式',
@@ -79,6 +133,8 @@ export const CountConfig = useCrudSchemas(reactive<CrudSchema[]>([
     label: '是否可用',
     field: 'available',
     sort: 'custom',
+    isForm:false,
+    isTable: false
   },
   {
     label: '备注',
diff --git a/src/views/wms/countManage/count/countConfig/index.vue b/src/views/wms/countManage/count/countConfig/index.vue
index 3a71f2d2c..eb421aea5 100644
--- a/src/views/wms/countManage/count/countConfig/index.vue
+++ b/src/views/wms/countManage/count/countConfig/index.vue
@@ -65,6 +65,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
 import TableHead from '@/components/TableHead/src/TableHead.vue'
 import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
 import Detail from '@/components/Detail/src/Detail.vue'
+import { debug } from 'console'
 
 defineOptions({ name: 'CountConfig' })
 
@@ -77,10 +78,18 @@ routeName.value = route.name
 const tableColumns = ref(CountConfig.allSchemas.tableColumns)
 
 // 查询页面返回
-const searchTableSuccess = (formField, searchField, val, formRef) => {
+const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
   nextTick(() => {
     const setV = {}
     setV[formField] = val[0][searchField]
+    if (formField == 'itemCode') {
+        setV['itemName'] = val[0].name
+        setV['desc1'] = val[0].backNumber
+        setV['uom'] = val[0].uom
+        setV['packUnit'] = val[0].defaultPackUnit
+        setV['packQty'] = val[0].defaultPackQty
+
+      }
     formRef.setValues(setV)
   })
 }
@@ -133,8 +142,8 @@ const buttonBaseClick = (val, item) => {
 
 // 列表-操作按钮
 const butttondata = [
-  defaultButtons.mainListEditBtn({hasPermi:'wms:countConfig:update'}), // 编辑
-  defaultButtons.mainListDeleteBtn({hasPermi:'wms:countConfig:delete'}), // 删除
+  defaultButtons.mainListEditBtn(), // 编辑
+  defaultButtons.mainListDeleteBtn(), // 删除
 ]
 
 // 列表-操作按钮事件