Browse Source

采购收货申请,添加明细

master_hella_20240701
yufei0306 7 months ago
parent
commit
55c71b57b9
  1. 35
      src/components/BasicForm/src/BasicForm.vue
  2. 4
      src/components/SearchTable/src/SearchTable.vue
  3. 6
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  4. 26
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

35
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')
}

4
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

6
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -14,7 +14,6 @@
:allSchemas="PurchasereceiptRequestMain.allSchemas"
:detailAllSchemas="PurchasereceiptRequestDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
@ -44,7 +43,7 @@
ref="formRef"
@success="getList"
:isOpenSearchTable="true"
:indexTableColumn="1"
fieldTableColumn="poNumber"
:rules="PurchasereceiptRequestMainRules"
:formAllSchemas="PurchasereceiptRequestMain.allSchemas"
:tableAllSchemas="PurchasereceiptRequestDetail.allSchemas"
@ -237,11 +236,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
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']
//

26
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

@ -52,7 +52,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
},
{
label: '采购订单号',
field: 'ppNumber',
field: 'poNumber',
sort: 'custom',
table: {
width: 180
@ -592,13 +592,25 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '采购订单信息',
isConcatDetailSchemas:true,//是否是主子表合并 默认false
searchDetailSchemas:PurchaseDetail.allSchemas,
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{
key:'supplierCode',
value:'supplierCode',
message: '请选择供应商!',
isMainValue: true
searchPage: PurchaseDetailApi.getPurchaseDetailPage,
searchCondition: [
{
key:'number',
value:'poNumber',
action: '==', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isFormModel:true,
isMainValue: false
},
{
key: 'status', // 查询列表中字段
value: '2', // 指查询具体值
action: '==', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
}]
},
form: {

Loading…
Cancel
Save