|
@ -57,10 +57,11 @@ |
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
:isShowButton = isShowButton |
|
|
|
|
|
@onEnter="onEnter" |
|
|
@onEnter="onEnter" |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
|
|
|
<!-- 添加明细:采购收货记录单号 --> |
|
|
|
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<Detail |
|
|
<Detail |
|
@ -127,7 +128,6 @@ const genLabelId = ref(); //主表ID |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref([...CustomerreturnRequestMain.allSchemas.tableColumns,...CustomerreturnRequestDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([...CustomerreturnRequestMain.allSchemas.tableColumns,...CustomerreturnRequestDetail.allSchemas.tableMainColumns]) |
|
|
|
|
|
|
|
|
const isShowButton = ref(true) |
|
|
|
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
@ -201,9 +201,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
setV['deliverPlanNumber'] = val[0]['deliverPlanNumber'] |
|
|
setV['deliverPlanNumber'] = val[0]['deliverPlanNumber'] |
|
|
setV['customerCode'] = val[0]['customerCode'] |
|
|
setV['customerCode'] = val[0]['customerCode'] |
|
|
setV['customerDockCode'] = val[0]['customerDockCode'] |
|
|
setV['customerDockCode'] = val[0]['customerDockCode'] |
|
|
if(setV['deliverRecordNumber'] != null){ |
|
|
|
|
|
isShowButton.value = false |
|
|
|
|
|
} |
|
|
|
|
|
// 获取子表数据 |
|
|
// 获取子表数据 |
|
|
DeliverRecordDetailApi.getDeliverRecordDetailPage({masterId:val[0]['id']}) |
|
|
DeliverRecordDetailApi.getDeliverRecordDetailPage({masterId:val[0]['id']}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
@ -221,7 +219,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
if (res) tableData.value = res.list |
|
|
if (res) { |
|
|
|
|
|
tableData.value = [...res.list] |
|
|
|
|
|
originTableData.value = [...res.list] |
|
|
|
|
|
} |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
message.error('错误') |
|
|
message.error('错误') |
|
@ -480,6 +481,7 @@ const labelPrint = async (row) => { |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm =async (type: string, row?: number) => { |
|
|
const openForm =async (type: string, row?: number) => { |
|
|
|
|
|
originTableData.value = [] |
|
|
if(type == "update"){ |
|
|
if(type == "update"){ |
|
|
CustomerreturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
CustomerreturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
if(item.field == 'deliverRecordNumber'){ |
|
|
if(item.field == 'deliverRecordNumber'){ |
|
@ -589,10 +591,52 @@ CustomerreturnRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
|
|
|
const originTableData = ref([]) |
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
|
|
|
|
|
// 添加明细 |
|
|
// 添加明细 |
|
|
|
|
|
// const handleAddTable = () => { |
|
|
|
|
|
// tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
|
|
|
// } |
|
|
const handleAddTable = () => { |
|
|
const handleAddTable = () => { |
|
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
console.log('originTableData.value',originTableData.value) |
|
|
|
|
|
console.log('tableData.value',tableData.value) |
|
|
|
|
|
const subTableDFata = originTableData.value.filter(item=> !tableData.value.find(item1=>item1.id == item.id)) |
|
|
|
|
|
if(subTableDFata.length==0){ |
|
|
|
|
|
message.warning('暂无可选择数据!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const tableObject = { |
|
|
|
|
|
// 当前页 |
|
|
|
|
|
currentPage: 1, |
|
|
|
|
|
// 导出加载中 |
|
|
|
|
|
exportLoading: false, |
|
|
|
|
|
// 加载中 |
|
|
|
|
|
loading: false, |
|
|
|
|
|
// 页数 |
|
|
|
|
|
pageSize: subTableDFata.length, |
|
|
|
|
|
params:null, |
|
|
|
|
|
// 排序 |
|
|
|
|
|
sort: { |
|
|
|
|
|
order: '', // 排序规则 |
|
|
|
|
|
prop: '' // 排序字段 |
|
|
|
|
|
}, |
|
|
|
|
|
// 总条数 |
|
|
|
|
|
total: subTableDFata.length, |
|
|
|
|
|
// 表格数据 |
|
|
|
|
|
tableList: subTableDFata, |
|
|
|
|
|
currentRow:null |
|
|
|
|
|
} |
|
|
|
|
|
const tableColumns = CustomerreturnRequestDetail.allSchemas.tableFormColumns |
|
|
|
|
|
tableColumns.forEach((item) => { |
|
|
|
|
|
item.width = item.table?.width || 150 |
|
|
|
|
|
}) |
|
|
|
|
|
searchTableRef.value.openData("收货明细",tableObject,{tableColumns},true) |
|
|
|
|
|
} |
|
|
|
|
|
const searchTableSuccess1 = (formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
console.log(val) |
|
|
|
|
|
tableData.value = [...tableData.value,...val] |
|
|
} |
|
|
} |
|
|
// 删除明细 |
|
|
// 删除明细 |
|
|
const handleDeleteTable = (item, index) => { |
|
|
const handleDeleteTable = (item, index) => { |
|
|