From 55c71b57b9654bb1ea821cea5d5c54e3d64faabd Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Thu, 25 Apr 2024 17:26:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=94=B6=E8=B4=A7=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 35 +++++++++++++++---- .../SearchTable/src/SearchTable.vue | 4 +-- .../purchasereceiptRequestMain/index.vue | 6 ++-- .../purchasereceiptRequestMain.data.ts | 26 ++++++++++---- 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index a0e36e748..70104671e 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -273,12 +273,17 @@ const props = defineProps({ required: false, default: false }, - // TableForm 的第几列按钮 + // TableForm 的第几列按钮 (后续用 fieldTableColumn替换 ,indexTableColumn容易出问题) indexTableColumn :{ type: Number, required: false, default: 0 }, + fieldTableColumn:{ + type: String, + required: false, + default: '' + }, //表单中展示的数据,需要用searchTable中字段计算 /***[{ formField:form中对应的field, @@ -385,11 +390,21 @@ const opensearchTable = ( } else { // 扩展 转换为筛选条件进行查询 if (searchCondition[i].isSearch) { - filters.push({ - action: searchCondition[i].action, - column: searchCondition[i].key, - value: searchCondition[i].value - }) + if (searchCondition[i].isFormModel) { + //用formModel中的值 + filters.push({ + action: searchCondition[i].action, + column: searchCondition[i].key, + value: formRef.value.formModel[searchCondition[i].value] + }) + }else{ + filters.push({ + action: searchCondition[i].action, + column: searchCondition[i].key, + value: searchCondition[i].value + }) + } + } else { _searchCondition[searchCondition[i].key] = searchCondition[i].value } @@ -496,7 +511,13 @@ const handleAddTable = () => { tableAllSchemas.value.tableFormColumns.forEach(item => { tableFormKeys[item.field] = item.default ? item.default : '' }) - inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0) + if(props.fieldTableColumn!=''){ + console.log('handleAddTable',tableAllSchemas.value.tableFormColumns.find(item=>item.field==props.fieldTableColumn)) + inpuFocus(tableAllSchemas.value.tableFormColumns.find(item=>item.field==props.fieldTableColumn),tableFormKeys,0) + }else{ + inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0) + + } }else{ emit('handleAddTable') } diff --git a/src/components/SearchTable/src/SearchTable.vue b/src/components/SearchTable/src/SearchTable.vue index db9440b9f..5cdb3feda 100644 --- a/src/components/SearchTable/src/SearchTable.vue +++ b/src/components/SearchTable/src/SearchTable.vue @@ -87,9 +87,9 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s if(isConcatDetailSchemas){ //主子表合并 console.log('detailSchemas',detailSchemas) - tableColumns.value = [...allSchemas.tableColumns,...detailSchemas.tableMainColumns].filter(item => (item.field !== 'action')) + tableColumns.value = [...allSchemas?.tableColumns,...detailSchemas?.tableMainColumns].filter(item => (item.field !== 'action')) }else{ - tableColumns.value = allSchemas.tableColumns.filter(item => (item.field !== 'action')) + tableColumns.value = allSchemas?.tableColumns.filter(item => (item.field !== 'action')) } getPage.value = getApiPage typeRef.value = type diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue index eff020ab4..112b3d81c 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue @@ -14,7 +14,6 @@ :allSchemas="PurchasereceiptRequestMain.allSchemas" :detailAllSchemas="PurchasereceiptRequestDetail.allSchemas" /> - const setV = {} if(formField == 'supplierCode'){ setV['supplierCode'] = val[0]['code'] - }else if(formField == 'ppNumber') { + }else if(formField == 'poNumber') { //新增--采购订单-- setV['supplierCode'] = val[0]['supplierCode'] setV['poNumber'] = val[0]['number'] - setV['poNumber'] = val[0]['number'] const newRow = val[0] newRow['poNumber'] = val[0]['number'] // 请求明细数据 diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts index dddade1c8..7f9bd71e9 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts @@ -52,7 +52,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( }, { label: '采购订单号', - field: 'ppNumber', + field: 'poNumber', sort: 'custom', table: { width: 180 @@ -592,13 +592,25 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive