|
@@ -754,6 +754,10 @@ const newLineTemplate = {
|
|
name: '',
|
|
name: '',
|
|
id: '',
|
|
id: '',
|
|
} as any,
|
|
} as any,
|
|
|
|
+ Sales_Order: '',
|
|
|
|
+ Purchase_Order: '',
|
|
|
|
+ Reference: '',
|
|
|
|
+ PO_Number: '',
|
|
Parent_Id: {
|
|
Parent_Id: {
|
|
name: '',
|
|
name: '',
|
|
id: '',
|
|
id: '',
|
|
@@ -846,7 +850,7 @@ let getGoodMaterialOption = () => {
|
|
// console.log(resp, 'res')
|
|
// console.log(resp, 'res')
|
|
const res = resp.data.result || {}
|
|
const res = resp.data.result || {}
|
|
if (Array.isArray(res.data) && res.data.length) {
|
|
if (Array.isArray(res.data) && res.data.length) {
|
|
- console.log(res.data, 'res.data')
|
|
|
|
|
|
+ // console.log(res.data, 'res.data')
|
|
goodMaterialOption.value =
|
|
goodMaterialOption.value =
|
|
res.data[0].Website_Subform.map(
|
|
res.data[0].Website_Subform.map(
|
|
(i: any) => i.Website_Subform_Value,
|
|
(i: any) => i.Website_Subform_Value,
|
|
@@ -898,6 +902,10 @@ const onBatchRecordChange = ($e: string, line = -1) => {
|
|
id: result.Owner.id,
|
|
id: result.Owner.id,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ subList.value[line].Sales_Order = result.Sales_Order || ''
|
|
|
|
+ subList.value[line].Purchase_Order = result.Purchase_Order || ''
|
|
|
|
+ subList.value[line].Reference = result.Reference || ''
|
|
|
|
+ subList.value[line].PO_Number = result.PO_Number || ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 给子表格加红绿背景. 颜色用的tailwind的 red green
|
|
// 给子表格加红绿背景. 颜色用的tailwind的 red green
|
|
@@ -944,6 +952,10 @@ const commit = () => {
|
|
Cube: i.Cube || '',
|
|
Cube: i.Cube || '',
|
|
Total_FOB: i.Total_FOB || '',
|
|
Total_FOB: i.Total_FOB || '',
|
|
User_Notes: i.User_Notes || '',
|
|
User_Notes: i.User_Notes || '',
|
|
|
|
+ Sales_Order: i.Sales_Order || '',
|
|
|
|
+ Purchase_Order: i.Purchase_Order || '',
|
|
|
|
+ Reference: i.Reference || '',
|
|
|
|
+ PO_Number: i.PO_Number || '',
|
|
}
|
|
}
|
|
}) as any[]
|
|
}) as any[]
|
|
|
|
|
|
@@ -952,27 +964,27 @@ const commit = () => {
|
|
.filter((i) => i.deleteFlag)
|
|
.filter((i) => i.deleteFlag)
|
|
.map((i) => ({ id: i.id, _delete: null, Material_of_Goods: null })),
|
|
.map((i) => ({ id: i.id, _delete: null, Material_of_Goods: null })),
|
|
)
|
|
)
|
|
- const emptyBatchRecordList: number[] = []
|
|
|
|
|
|
+ // const emptyBatchRecordList: number[] = []
|
|
const emptyUserNotesList: number[] = []
|
|
const emptyUserNotesList: number[] = []
|
|
result.forEach((i, index) => {
|
|
result.forEach((i, index) => {
|
|
- if (!i.Sample) {
|
|
|
|
- if (!i.Batch_Record) {
|
|
|
|
- emptyBatchRecordList.push(index)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // if (!i.Sample) {
|
|
|
|
+ // if (!i.Batch_Record) {
|
|
|
|
+ // emptyBatchRecordList.push(index)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
if (!i.User_Notes) {
|
|
if (!i.User_Notes) {
|
|
emptyUserNotesList.push(index)
|
|
emptyUserNotesList.push(index)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
- if (emptyBatchRecordList.length) {
|
|
|
|
- ElNotification({
|
|
|
|
- title: '请检查表单',
|
|
|
|
- message: `第 ${emptyBatchRecordList.map((i) => i + 1).join(', ')} 行的Batch Record数据`,
|
|
|
|
- duration: 5000,
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ // if (emptyBatchRecordList.length) {
|
|
|
|
+ // ElNotification({
|
|
|
|
+ // title: '请检查表单',
|
|
|
|
+ // message: `第 ${emptyBatchRecordList.map((i) => i + 1).join(', ')} 行的Batch Record数据`,
|
|
|
|
+ // duration: 5000,
|
|
|
|
+ // })
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
if (emptyUserNotesList.length) {
|
|
if (emptyUserNotesList.length) {
|
|
ElNotification({
|
|
ElNotification({
|
|
title: '请检查表单, 备注是必填的',
|
|
title: '请检查表单, 备注是必填的',
|
|
@@ -1032,6 +1044,7 @@ const exportSubTable = () => {
|
|
'体积m³ Cube',
|
|
'体积m³ Cube',
|
|
'总离岸价 澳币/AUD Total FOB',
|
|
'总离岸价 澳币/AUD Total FOB',
|
|
'负责人 Owner',
|
|
'负责人 Owner',
|
|
|
|
+ 'Reference',
|
|
]
|
|
]
|
|
|
|
|
|
const data: any[] = subList.value.map((i) => {
|
|
const data: any[] = subList.value.map((i) => {
|
|
@@ -1046,6 +1059,7 @@ const exportSubTable = () => {
|
|
'体积m³ Cube': i.Cube || '',
|
|
'体积m³ Cube': i.Cube || '',
|
|
'总离岸价 澳币/AUD Total FOB': i.Total_FOB || '',
|
|
'总离岸价 澳币/AUD Total FOB': i.Total_FOB || '',
|
|
'负责人 Owner': i.Requester.name || '',
|
|
'负责人 Owner': i.Requester.name || '',
|
|
|
|
+ Reference: i.Reference || i.PO_Number || '',
|
|
}
|
|
}
|
|
})
|
|
})
|
|
if (data.length === 0) {
|
|
if (data.length === 0) {
|
|
@@ -1079,10 +1093,14 @@ const exportSubTable = () => {
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 120 },
|
|
{ wpx: 120 },
|
|
{ wpx: 120 },
|
|
{ wpx: 120 },
|
|
|
|
+ { wpx: 100 },
|
|
]
|
|
]
|
|
|
|
|
|
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')
|
|
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')
|
|
- XLSX.writeFile(wb, 'test.xlsx')
|
|
|
|
|
|
+ XLSX.writeFile(
|
|
|
|
+ wb,
|
|
|
|
+ encodeURIComponent(currentRow.value.Name || 'test') + '.xlsx',
|
|
|
|
+ )
|
|
}
|
|
}
|
|
|
|
|
|
let qcList = ref([] as any[])
|
|
let qcList = ref([] as any[])
|
|
@@ -1100,13 +1118,12 @@ const search = (keyword: string) => {
|
|
})
|
|
})
|
|
.then((res: any) => {
|
|
.then((res: any) => {
|
|
if (Array.isArray(res.data) && res.data.length) {
|
|
if (Array.isArray(res.data) && res.data.length) {
|
|
- qcList.value = res.data
|
|
|
|
- .map((i: any) => {
|
|
|
|
- return {
|
|
|
|
- ...i,
|
|
|
|
- isSearch: true,
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ qcList.value = res.data.map((i: any) => {
|
|
|
|
+ return {
|
|
|
|
+ ...i,
|
|
|
|
+ isSearch: true,
|
|
|
|
+ }
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
qcList.value = []
|
|
qcList.value = []
|
|
ElMessage.warning('No Data Found')
|
|
ElMessage.warning('No Data Found')
|