From d3c4c97b377f17f2b3e8d31bca3a6115655a3c0d Mon Sep 17 00:00:00 2001
From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com>
Date: Tue, 28 May 2024 15:11:32 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=80=80=E8=B4=A7=E7=94=B3?=
=?UTF-8?q?=E8=AF=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../customerreturnRequestMain/index.vue | 58 ++++++++++++++++---
1 file changed, 51 insertions(+), 7 deletions(-)
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) => {