Browse Source

采购收货申请,添加明细

master_hella_20240701
yufei0306 7 months ago
parent
commit
55c71b57b9
  1. 23
      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

23
src/components/BasicForm/src/BasicForm.vue

@ -273,12 +273,17 @@ const props = defineProps({
required: false, required: false,
default: false default: false
}, },
// TableForm // TableForm fieldTableColumn indexTableColumn
indexTableColumn :{ indexTableColumn :{
type: Number, type: Number,
required: false, required: false,
default: 0 default: 0
}, },
fieldTableColumn:{
type: String,
required: false,
default: ''
},
//searchTable //searchTable
/***[{ /***[{
formField:form中对应的field, formField:form中对应的field,
@ -385,11 +390,21 @@ const opensearchTable = (
} else { } else {
// //
if (searchCondition[i].isSearch) { if (searchCondition[i].isSearch) {
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({ filters.push({
action: searchCondition[i].action, action: searchCondition[i].action,
column: searchCondition[i].key, column: searchCondition[i].key,
value: searchCondition[i].value value: searchCondition[i].value
}) })
}
} else { } else {
_searchCondition[searchCondition[i].key] = searchCondition[i].value _searchCondition[searchCondition[i].key] = searchCondition[i].value
} }
@ -496,7 +511,13 @@ const handleAddTable = () => {
tableAllSchemas.value.tableFormColumns.forEach(item => { tableAllSchemas.value.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
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) inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0)
}
}else{ }else{
emit('handleAddTable') 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){ if(isConcatDetailSchemas){
// //
console.log('detailSchemas',detailSchemas) 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{ }else{
tableColumns.value = allSchemas.tableColumns.filter(item => (item.field !== 'action')) tableColumns.value = allSchemas?.tableColumns.filter(item => (item.field !== 'action'))
} }
getPage.value = getApiPage getPage.value = getApiPage
typeRef.value = type typeRef.value = type

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

@ -14,7 +14,6 @@
:allSchemas="PurchasereceiptRequestMain.allSchemas" :allSchemas="PurchasereceiptRequestMain.allSchemas"
:detailAllSchemas="PurchasereceiptRequestDetail.allSchemas" :detailAllSchemas="PurchasereceiptRequestDetail.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table v-clientTable
@ -44,7 +43,7 @@
ref="formRef" ref="formRef"
@success="getList" @success="getList"
:isOpenSearchTable="true" :isOpenSearchTable="true"
:indexTableColumn="1" fieldTableColumn="poNumber"
:rules="PurchasereceiptRequestMainRules" :rules="PurchasereceiptRequestMainRules"
:formAllSchemas="PurchasereceiptRequestMain.allSchemas" :formAllSchemas="PurchasereceiptRequestMain.allSchemas"
:tableAllSchemas="PurchasereceiptRequestDetail.allSchemas" :tableAllSchemas="PurchasereceiptRequestDetail.allSchemas"
@ -237,11 +236,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const setV = {} const setV = {}
if(formField == 'supplierCode'){ if(formField == 'supplierCode'){
setV['supplierCode'] = val[0]['code'] setV['supplierCode'] = val[0]['code']
}else if(formField == 'ppNumber') { }else if(formField == 'poNumber') {
//---- //----
setV['supplierCode'] = val[0]['supplierCode'] setV['supplierCode'] = val[0]['supplierCode']
setV['poNumber'] = val[0]['number'] setV['poNumber'] = val[0]['number']
setV['poNumber'] = val[0]['number']
const newRow = val[0] const newRow = val[0]
newRow['poNumber'] = val[0]['number'] 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: '采购订单号', label: '采购订单号',
field: 'ppNumber', field: 'poNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 180 width: 180
@ -592,13 +592,25 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
searchListPlaceholder: '请选择订单号', searchListPlaceholder: '请选择订单号',
searchField: 'number', searchField: 'number',
searchTitle: '采购订单信息', searchTitle: '采购订单信息',
isConcatDetailSchemas:true,//是否是主子表合并 默认false
searchDetailSchemas:PurchaseDetail.allSchemas,
searchAllSchemas: PurchaseMain.allSchemas, searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage, searchPage: PurchaseDetailApi.getPurchaseDetailPage,
searchCondition: [{ searchCondition: [
key:'supplierCode', {
value:'supplierCode', key:'number',
message: '请选择供应商!', value:'poNumber',
isMainValue: true action: '==', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isFormModel:true,
isMainValue: false
},
{
key: 'status', // 查询列表中字段
value: '2', // 指查询具体值
action: '==', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
}] }]
}, },
form: { form: {

Loading…
Cancel
Save