From 326a66d2a022939d72bb99b27b619bbbb89de678 Mon Sep 17 00:00:00 2001
From: zhang_li
Date: Wed, 23 Apr 2025 11:51:55 +0800
Subject: [PATCH] =?UTF-8?q?YT-2441=E8=A1=A5=E7=BB=99=E5=93=81=E6=8C=89?=
=?UTF-8?q?=E6=95=B0=E9=87=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../productreceiptRequestMain/index.vue | 25 ++++++++++++-
.../productreceiptRequestMain.data.ts | 3 ++
.../index.vue | 36 +++++--------------
3 files changed, 35 insertions(+), 29 deletions(-)
diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
index f7c6a612f..8d3ebdc53 100644
--- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
+++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
@@ -265,7 +265,7 @@ function addDay(date: Date | number, addDay: number) {
}
// 查询页面返回
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
- nextTick(() => {
+ nextTick(async() => {
if (type == 'tableForm') {
if (formField == 'secondPackUnit') {
row['secondPackUnit'] = val[0]['packUnit']
@@ -282,6 +282,29 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
}
const index1 = 0
setTableFormsValues(val, index1)
+ } else if (formField == 'workStationCode') {
+ // 获取管理精度
+ const res = await ruleApi.getManagementPrecision({
+ itemCodes: [row['itemCode']],
+ locationCode:val[0]['fgLocationCode']
+ })
+ if (res[0].ManagementPrecision == 'BY_BATCH') {
+ row['batch'] = formatTime(new Date(), 'yyyyMMdd')
+ ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => {
+ if(item.field == 'batch')
+ item.tableForm.disabled = false
+ })
+ ProductreceiptRequestDetailRules.batch[0].required = true
+ // 按数量管理批次清空不可输入
+ } else if (res[0].ManagementPrecision == 'BY_QUANTITY') {
+ ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => {
+ if(item.field == 'batch')
+ item.tableForm.disabled = true
+ })
+ row['batch'] = ''
+ ProductreceiptRequestDetailRules.batch[0].required = false
+ }
+ row[formField] = val[0][searchField]
} else {
row[formField] = val[0][searchField]
}
diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts
index 944c9e269..b05c0f139 100644
--- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts
+++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts
@@ -1113,6 +1113,9 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive
table: {
width: 150
},
+ tableForm: {
+ disabled: false
+ }
},
{
label: '品名',
diff --git a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue
index 7a6c7272c..aaca13711 100644
--- a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue
+++ b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue
@@ -246,39 +246,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const index1 = 0
setTableFormsValues(val, index1)
} else if (formField == 'workStationCode') {
- const params = {
- available: 'TRUE',
- pageSize: 20,
- pageNo: 1,
- code: val[0]['fgLocationCode'],
- name: '',
- areaCode: '',
- sort: '',
- by: 'ASC',
- }
- const res = await LocationApi.getLocationPage(params)
- console.log(222,res)
- const params1 = {
- available: 'TRUE',
- pageSize: 20,
- pageNo: 1,
- code: res.list[0].areaCode,
- name: '',
- type: '',
- manageMode:'' ,
- sort: '',
- by: 'ASC',
- }
- const res1 = await AreaApi.getAreaPage(params1)
- if (res1.list[0].manageMode == 'BY_BATCH') {
+ // 获取管理精度
+ const res = await ruleApi.getManagementPrecision({
+ itemCodes: [row['itemCode']],
+ locationCode:val[0]['fgLocationCode']
+ })
+ if (res[0].ManagementPrecision == 'BY_BATCH') {
row['batch'] = formatTime(new Date(), 'yyyyMMdd')
ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => {
if(item.field == 'batch')
item.tableForm.disabled = false
})
ProductreceiptRequestDetailRules.batch[0].required = true
-
- } else if (res1.list[0].manageMode == 'BY_QUANTITY') {
+ // 按数量管理批次清空不可输入
+ } else if (res[0].ManagementPrecision == 'BY_QUANTITY') {
ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => {
if(item.field == 'batch')
item.tableForm.disabled = true
@@ -286,7 +267,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['batch'] = ''
ProductreceiptRequestDetailRules.batch[0].required = false
}
-
row[formField] = val[0][searchField]
} else{
row[formField] = val[0][searchField]