diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue
index 47618055c..7859e1a17 100644
--- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue
+++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue
@@ -57,10 +57,11 @@
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
- :isShowButton = isShowButton
@onEnter="onEnter"
/>
+
+
{
@@ -201,9 +201,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV['deliverPlanNumber'] = val[0]['deliverPlanNumber']
setV['customerCode'] = val[0]['customerCode']
setV['customerDockCode'] = val[0]['customerDockCode']
- if(setV['deliverRecordNumber'] != null){
- isShowButton.value = false
- }
+
// 获取子表数据
DeliverRecordDetailApi.getDeliverRecordDetailPage({masterId:val[0]['id']})
.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 => {
console.log(err)
message.error('错误')
@@ -480,6 +481,7 @@ const labelPrint = async (row) => {
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
+ originTableData.value = []
if(type == "update"){
CustomerreturnRequestMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'deliverRecordNumber'){
@@ -589,10 +591,52 @@ CustomerreturnRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
+const originTableData = ref([])
+const searchTableRef = ref()
// 添加明细
+// const handleAddTable = () => {
+// tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
+// }
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) => {