Browse Source

客户退货申请

master_hella_20240701
yufei0306 6 months ago
parent
commit
d3c4c97b37
  1. 58
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue

58
src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue

@ -57,10 +57,11 @@
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
:isShowButton = isShowButton
@onEnter="onEnter"
/>
<!-- 添加明细采购收货记录单号 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
<!-- 详情 -->
<Detail
@ -127,7 +128,6 @@ const genLabelId = ref(); //主表ID
routeName.value = route.name
const tableColumns = ref([...CustomerreturnRequestMain.allSchemas.tableColumns,...CustomerreturnRequestDetail.allSchemas.tableMainColumns])
const isShowButton = ref(true)
//
const updataTableColumns = (val) => {
@ -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) => {

Loading…
Cancel
Save