页面调整

szh-new
张同海 6 months ago
parent 23657c4b7b
commit 8afaf86828

@ -3111,41 +3111,66 @@ export const cargoInfoFormSchema2: FormSchema[] = [
},
},
{
field: 'kindPkgs',
label: '',
field: 'kindPkgsName',
component: 'Input',
// defaultValue: '',
show: false,
},
{
label: '包装',
field: 'kindPkgs',
component: 'Select',
required: false,
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 6 },
componentProps: {
options: ListData.goodsName,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
componentProps: ({ schema, tableAction, formActionType, formModel }) => {
return {
options: ListData.goodsName,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e) => {
ListData.goodsName.forEach((item) => {
if (item.value == e) {
formModel.kindPkgsName = item.label
}
})
setTimeout(() => {
formActionType.submit()
}, 10)
},
}
},
},
{
field: 'description',
label: '货物描述',
field: 'description',
component: 'InputTextArea',
required: false,
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 12 },
componentProps: {
rows: 3,
},
},
{
label: '毛重',
field: 'kgs',
component: 'InputNumber',
required: false,
colProps: { span: 6 },
componentProps: ({ schema, tableAction, formActionType, formModel }) => {
return {
onChange: () => {
formActionType.submit()
},
}
},
},
{
label: '尺寸',

@ -665,8 +665,6 @@
}
// list
RefgoodsTable.value.list.forEach((e, index) => {
console.log(e, 'ZZZZZZZZZZZZZZZZZZZZZZ')
let ctnCode = ''
ctnList.forEach((item: any) => {
if (item.label == e.ctn) {
@ -1018,6 +1016,27 @@
RefrightContent.value.init()
}, 100)
}
//
function changeTotalFun(data) {
const { type, val } = data
if (type === 'totalKgs') {
RefcargoInfo.value.setFieldsValue2({
...RefcargoInfo.value.getFieldsValue2(),
kgs: val,
})
// bookingDetails.value.kgs = val || bookingDetails.value.kgs
} else if (type === 'totalPkgs') {
RefcargoInfo.value.setFieldsValue2({
...RefcargoInfo.value.getFieldsValue2(),
pkgs: val,
})
} else if (type === 'totalCbm') {
RefcargoInfo.value.setFieldsValue2({
...RefcargoInfo.value.getFieldsValue2(),
cbm: val,
})
}
}
// ============================================
// function getRouterHis() {
// inChildLoading.value = true
@ -1348,18 +1367,7 @@
RefgoodsTable.value.loadingTable = false
})
}
function changeTotalFun(data) {
const { type, val } = data
if (type === 'totalKgs') {
bookingDetails.value.kgs = val || bookingDetails.value.kgs
} else if (type === 'totalPkgs') {
bookingDetails.value.pkgs = val || bookingDetails.value.pkgs
const enCapitalRes = RefcargoInfo.value.SetTOTALNO(bookingDetails.value.pkgs)
bookingDetails.value.totalno = enCapitalRes
} else if (type === 'totalCbm') {
bookingDetails.value.cbm = val || bookingDetails.value.cbm
}
}
function changeCtnInfoFun({ type, val }) {
if (type === 'kindpkgs') {
bookingDetails.value.kindpkgs = val

@ -685,7 +685,8 @@
// submitFunc: asd,
// })
async function asd() {
let data = await validate2()
let data = getFieldsValue2()
let SS = data.pkgs
if (SS) {
let GetStringNum = (str) => {
@ -823,10 +824,11 @@
}
num = parseFloat(num).add(parseFloat(strNum))
}
if (strKind !== '') {
enCapital = strKind
} else {
strKind = data.kindpkgs ? data.kindpkgs : ''
strKind = data.kindPkgsName ? data.kindPkgsName : ''
enCapital = ToEn(num).toUpperCase() + ' ' + strKind + ' ONLY.'
}
} else {
@ -835,7 +837,7 @@
if (strKind !== '') {
enCapital = strKind
} else {
strKind = data.kindpkgs ? data.kindpkgs : ''
strKind = data.kindPkgsName ? data.kindPkgsName : ''
enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.'
}
}
@ -861,33 +863,47 @@
let { ctx: that, proxy }: any = getCurrentInstance()
watch(
() => props.details,
(nval) => {
setFieldsValue1(nval)
setFieldsValue2({
goodsName: nval.goodsName,
cargoId: nval.cargoId,
hsCode: nval.hsCode,
pkgs: nval.pkgs,
kindPkgs: nval.kindPkgs,
description: nval.description,
kgs: nval.kgs,
cbm: nval.cbm,
})
setTimeout(() => {
setFieldsValue2({
dangerClass: nval.dangerClass,
dangerNo: nval.dangerNo,
dangerPage: nval.dangerPage,
dangerLabel: nval.dangerLabel,
temperatureSet: nval.temperatureSet,
reeferQuantity: nval.reeferQuantity,
temperatureUnit: nval.temperatureUnit,
temperatureMin: nval.temperatureMin,
temperatureMax: nval.temperatureMax,
humidity: nval.humidity,
async (nval) => {
if (Object.keys(nval).length) {
await setFieldsValue1({ marks: nval.marks })
await setFieldsValue2({
pkgs: nval.pkgs,
kgs: nval.kgs,
cbm: nval.cbm,
goodsName: nval.goodsName,
cargoId: nval.cargoId,
hsCode: nval.hsCode,
kindPkgs: nval.kindPkgs,
description: nval.description,
})
console.log({
pkgs: nval.pkgs,
kgs: nval.kgs,
cbm: nval.cbm,
goodsName: nval.goodsName,
cargoId: nval.cargoId,
hsCode: nval.hsCode,
kindPkgs: nval.kindPkgs,
description: nval.description,
})
}, 10)
setFieldsValue4(nval)
setTimeout(async () => {
await setFieldsValue2({
...getFieldsValue2(),
dangerClass: nval.dangerClass,
dangerNo: nval.dangerNo,
dangerPage: nval.dangerPage,
dangerLabel: nval.dangerLabel,
temperatureSet: nval.temperatureSet,
reeferQuantity: nval.reeferQuantity,
temperatureUnit: nval.temperatureUnit,
temperatureMin: nval.temperatureMin,
temperatureMax: nval.temperatureMax,
humidity: nval.humidity,
})
}, 10)
await setFieldsValue4({ totalNo: nval.totalNo })
}
// setFieldsValue3(nval)
// if (!props.inSave) {
@ -1009,11 +1025,11 @@
props.details.goodsname = res.goodsNameEN || ''
} else if (type === 'cargoid') {
props.details.cargoid = res.code || ''
if (res.code == 'R') {
props.props.rules['goodsname'][0].required = true
} else {
props.props.rules['goodsname'][0].required = false
}
// if (res.code == 'R') {
// props.props.rules['goodsname'][0].required = true
// } else {
// props.props.rules['goodsname'][0].required = false
// }
} else if (['kindpkgs'].includes(type)) {
props.details.kindpkgs = res['name'] || ''
const enCapitalRes = SetTOTALNO(props.details.pkgs)
@ -1046,7 +1062,6 @@
const strNum: any = GetStringNum(DSS)
strKind = DSS.substring(strNum.length)
if (strKind !== '') {
console.log(strKind)
enCapital = strKind
} else {
strKind = props.details.kindpkgs
@ -1273,7 +1288,6 @@
}
}
async function validateFields() {
console.log('validateFields')
await validateFields1()
await validateFields2()
// await validateFields3()
@ -1290,6 +1304,7 @@
getFieldsValue,
updateSchema,
validateFields,
setFieldsValue2,
})
</script>
<style lang="less" scoped>

@ -71,9 +71,6 @@
/>
</div>
<div class="table-right">
<!-- <span>合计: {{ totalCtnall }}</span> -->
<!-- {{ totalPkgs }} {{ tableData.length > 0 ? tableData[0].kindpkgs : '' }} -->
<span> 件数: {{ totalPkgs }}</span>
<span>重量: {{ totalKgs }} KGS</span>
<span>尺码: {{ totalCbm }} CBM</span>
@ -347,6 +344,8 @@
title: '尺码',
width: 80,
data: 'cbm',
type: 'numeric',
format: '0',
},
{
title: '品名',
@ -744,10 +743,13 @@
}).then((res) => {
list.value.splice(0)
let data = res.data
data.forEach((item, index) => {
totalPkgs.value = 0
data.forEach(async (item, index) => {
totalPkgs.value = totalPkgs.value + item.pkgs
totalKgs.value = totalKgs.value + item.kgs
totalCbm.value = totalCbm.value + item.cbm
totalCtn.value = totalCtn.value + item.ctnNum
item.rowKey = index
})
data.forEach(async (item) => {
const weightTypeList = weightTypeDict.value.length
? weightTypeDict.value
: (await getDictDropDown({ code: 'weight_type' }))?.data
@ -832,29 +834,18 @@
}
//
const confirm = () => {
// let ApiData = { ids: [] }
// list.value.forEach((e, i) => {
// if (e.selected) {
// ApiData.ids.push(e.id)
// }
// })
// BatchDelOpCtn(ApiData).then((res) => {
// GetCtnList(props.details)
// notification.success({
// message: res.message,
// duration: 3,
// })
// })
let Arr: any = []
let ApiData = { ids: [] }
list.value.forEach((e, i) => {
if (!e.selected) {
Arr.push(e)
if (e.selected) {
ApiData.ids.push(e.id)
}
})
list.value.splice(0)
Arr.forEach((e) => {
list.value.push(e)
BatchDelOpCtn(ApiData).then((res) => {
GetCtnList(props.details)
notification.success({
message: res.message,
duration: 3,
})
})
}
//
@ -952,29 +943,7 @@
// })
// })
}
// function EditRow(record, index, event) {
// console.log('', record, index, event)
// if (!record.editable) {
// record.onEdit(true)
// } else {
// record.editable = false
// // record.onCancelEdit()
// record.onSubmitEdit()
// }
// }
//
// function EditRowEnd() {
// totalPkgs.value = 0
// totalKgs.value = 0
// totalCbm.value = 0
// totalCtn.value = 0
// getDataSource().forEach((item) => {
// totalPkgs.value = Number(item.pkgs) + Number(totalPkgs.value)
// totalKgs.value = Number(item.kgs) + Number(totalKgs.value)
// totalCbm.value = Number(item.size) + Number(totalCbm.value)
// totalCtn.value = Number(item.size) + Number(totalCtn.value)
// })
// }
// -------------------------------
const loadingTable = ref(false)
const tableData: any = ref([{}])
@ -1029,590 +998,10 @@
console.log('---')
},
})
const editOption = ref({
beforeCellValueChange: ({ row, column, changeValue }) => {
if (inTableLoad.value) {
return false
}
if (
['pkgs', 'kgs', 'cbm', 'tareweight'].includes(column.field) &&
!new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue)
) {
const height = document.body.clientHeight - 100
notification.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
})
notification.error({
message: `输入的${enmuErrorLabel(column.field)}不符合规则`,
duration: 3,
})
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
return false
}
if (column.field === 'cntrno') {
const res = checkCntrno(changeValue)
if (res !== '') {
const height = document.body.clientHeight - 100
notification.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
})
notification.error({ message: res, duration: 3 })
// row['cntrno'] = ''
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
}
}
},
beforeStartCellEditing: ({ row, column, cellValue }) => {
console.log(column)
// const arr = this.$options.filters['dictData']('BookingLockCtn')
let type = true
// arr.forEach((item) => {
// if (item.code == column.field && this.isLockBooking) {
// type = false
// }
// })
return type
},
afterCellValueChange: ({ row, column, changeValue }) => {
if (inTableLoad.value) {
return false
}
if (['kgs', 'cbm', 'tareweight', 'weighkgs'].includes(column.field)) {
changeValue = changeValue + ''
const valIndex = changeValue.includes('.') ? changeValue.indexOf('.') + 1 : false
const valCount = changeValue.length - valIndex
if (valIndex && valCount > 5) {
const height = document.body.clientHeight - 100
notification.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
})
notification.error({ message: '仅支持小数点后五位', duration: 3 })
row[column.field] = changeValue.substr(0, valIndex + 5)
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
} else {
const arrayNum = changeValue.split('.')
if (!/\./.test(changeValue)) {
row[column.field] = changeValue + '.00'
} else if (arrayNum[1].length < 2) {
row[column.field] = changeValue + '0'
}
}
}
if (column.field === 'pkgs') {
if (!/(^[1-9]\d*$)/.test(changeValue)) {
const height = document.body.clientHeight - 100
notification.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
})
notification.error({ message: '件数请输入整数', duration: 3 })
const cNum = changeValue.indexOf('.')
row[column.field] = changeValue.substr(0, cNum)
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
} else {
}
let num = 0
tableData.value.map((item, index) => {
if (item.pkgs) {
num += Number(item.pkgs)
}
})
totalPkgs.value = num
}
if (column.field === 'kgs') {
let num: any = 0
tableData.value.map((item, index) => {
num = (num * 10000 + Number(item.kgs) * 10000) / 10000
// num += Number(item.kgs)
})
num += ''
const pNum = num.split('.')
if (!/\./.test(num)) {
totalKgs.value = num + '.00'
} else if (pNum[1].length < 2) {
totalKgs.value = num + '0'
} else {
totalKgs.value = Number(pNum[0] + '.' + pNum[1].substr(0, 5))
// totalKgs.value = num
}
}
if (column.field === 'cbm') {
let num: any = 0
tableData.value.map((item, index) => {
// num += Number(item.cbm)
num = (num * 10000 + Number(item.cbm) * 10000) / 10000
})
num += ''
const pNum = num.split('.')
if (!/\./.test(num)) {
totalCbm.value = num + '.00'
} else if (pNum[1].length < 2) {
totalCbm.value = num + '0'
} else {
// totalCbm.value = num
totalCbm.value = Number(pNum[0] + '.' + pNum[1].substr(0, 5))
}
}
if (column.field === 'kgs' || column.field === 'tareweight') {
row['weighkgs'] = calc(Number(row['kgs']), Number(row['tareweight']), '+')
const kgsVal = row['weighkgs'] + ''
const kgsIndex: any = kgsVal.includes('.') ? kgsVal.indexOf('.') + 1 : false
const kgsCount: any = kgsVal.includes('.') ? kgsVal.length - kgsIndex : false
if (kgsCount > 4) {
row['weighkgs'] = kgsVal.substr(0, kgsIndex + 5)
} else if (!kgsIndex) {
row['weighkgs'] = kgsVal + '.00'
} else {
const arrayNum = kgsVal.split('.')
if (!/\./.test(kgsVal)) {
row['weighkgs'] = kgsVal + '.00'
} else if (arrayNum[1].length < 2) {
row['weighkgs'] = kgsVal + '0'
}
}
}
if (column.field === 'ctnnum') {
const map = {}
const dest: any[] = []
for (var i = 0; i < tableData.value.length; i++) {
var ai = tableData.value[i]
if (!map[ai.ctnall]) {
dest.push({
ctnall: ai.ctnall,
ctnnum: ai.ctnnum,
})
map[ai.ctnall] = ai
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j]
if (dj.ctnall == ai.ctnall) {
dj.ctnnum = (parseFloat(dj.ctnnum) + parseFloat(ai.ctnnum)).toString()
break
}
}
}
}
changeEmit1(dest)
}
},
cellValueChange: ({ row, column }) => {
console.log(row, column)
},
})
const rowKeyName = 'rowKey'
const rowStyleOption = ref({
clickHighlight: false,
hoverHighlight: false,
})
const clipboardOption = ref({
copy: true,
paste: true,
cut: true,
delete: true,
beforeCopy: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterCopy: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforePaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
const changeValue = data[0][selectionRangeKeys.endColKey]
if (inTableLoad.value) {
return false
}
if (
['pkgs', 'kgs', 'cbm', 'tareweight'].includes(selectionRangeKeys.endColKey) &&
!new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue)
) {
const height = document.body.clientHeight - 100
notification.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
})
notification.error({
message: `输入的${enmuErrorLabel(selectionRangeKeys.endColKey)}不符合规则`,
duration: 3,
})
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
return false
}
if (selectionRangeKeys.endColKey === 'cntrno') {
const res = checkCntrno(changeValue)
if (res !== '') {
const height = document.body.clientHeight - 100
notification.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
})
notification.error({ message: res, duration: 3 })
// row['cntrno'] = ''
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
}
}
},
afterPaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
let changeValue = data[0][selectionRangeKeys.endColKey]
const index = selectionRangeIndexes.startRowIndex
if (inTableLoad.value) {
return false
}
if (['kgs', 'cbm', 'tareweight', 'weighkgs'].includes(selectionRangeKeys.endColKey)) {
changeValue = changeValue + ''
const valIndex = changeValue.includes('.') ? changeValue.indexOf('.') + 1 : false
const valCount = changeValue.length - valIndex
if (valIndex && valCount > 5) {
const height = document.body.clientHeight - 100
notification.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
})
notification.error({ message: '仅支持小数点后五位', duration: 3 })
tableData.value[index][selectionRangeKeys.endColKey] = changeValue.substr(0, valIndex + 5)
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
} else {
const arrayNum = changeValue.split('.')
if (!/\./.test(changeValue)) {
tableData.value[index][selectionRangeKeys.endColKey] = changeValue + '.00'
} else if (arrayNum[1].length < 2) {
tableData.value[index][selectionRangeKeys.endColKey] = changeValue + '0'
}
}
}
if (selectionRangeKeys.endColKey === 'pkgs') {
if (!/(^[1-9]\d*$)/.test(changeValue)) {
const height = document.body.clientHeight - 100
notification.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
})
notification.error({ message: '件数请输入整数', duration: 3 })
const cNum = changeValue.indexOf('.')
tableData.value[index][selectionRangeKeys.endColKey] = changeValue.substr(0, cNum)
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
} else {
}
let num = 0
tableData.value.map((item, index) => {
if (item.pkgs) {
num += Number(item.pkgs)
}
})
totalPkgs.value = num
}
if (selectionRangeKeys.endColKey === 'kgs') {
let num: any = 0
tableData.value.map((item, index) => {
num = (num * 10000 + Number(item.kgs) * 10000) / 10000
// num += Number(item.kgs)
})
num += ''
const pNum = num.split('.')
if (!/\./.test(num)) {
totalKgs.value = num + '.00'
} else if (pNum[1].length < 2) {
totalKgs.value = num + '0'
} else {
totalKgs.value = Number(pNum[0] + '.' + pNum[1].substr(0, 5))
// totalKgs.value = num
}
}
if (selectionRangeKeys.endColKey === 'cbm') {
let num: any = 0
tableData.value.map((item, index) => {
// num += Number(item.cbm)
num = (num * 10000 + Number(item.cbm) * 10000) / 10000
})
num += ''
const pNum = num.split('.')
if (!/\./.test(num)) {
totalCbm.value = num + '.00'
} else if (pNum[1].length < 2) {
totalCbm.value = num + '0'
} else {
// totalCbm.value = num
totalCbm.value = Number(pNum[0] + '.' + pNum[1].substr(0, 5))
}
}
if (selectionRangeKeys.endColKey === 'kgs' || selectionRangeKeys.endColKey === 'tareweight') {
tableData.value[index]['weighkgs'] = calc(
Number(tableData.value[index]['kgs']),
Number(tableData.value[index]['tareweight']),
'+',
)
const kgsVal = tableData.value[index]['weighkgs'] + ''
const kgsIndex: any = kgsVal.includes('.') ? kgsVal.indexOf('.') + 1 : false
const kgsCount: any = kgsVal.includes('.') ? kgsVal.length - kgsIndex : false
if (kgsCount > 4) {
tableData.value[index]['weighkgs'] = kgsVal.substr(0, kgsIndex + 5)
} else if (!kgsIndex) {
tableData.value[index]['weighkgs'] = kgsVal + '.00'
} else {
const arrayNum = kgsVal.split('.')
if (!/\./.test(kgsVal)) {
tableData.value[index]['weighkgs'] = kgsVal + '.00'
} else if (arrayNum[1].length < 2) {
tableData.value[index]['weighkgs'] = kgsVal + '0'
}
}
}
},
beforeCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforeDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
})
const cellSelectionOption = ref({
enable: true,
})
const totalCtnall = ref('')
const BookingLockCtn = ref({})
const moreModelconfirm = ref(false)
const modelColumns = ref([
{
field: '',
key: 'radio',
type: 'radio',
title: '',
width: 40,
operationColumn: true,
align: 'center',
},
{
field: 'ctnall',
key: 'ctnall',
title: '箱型',
align: 'left',
width: 80,
},
{
field: 'ctnnum',
key: 'ctnnum ',
title: '箱量',
align: 'left',
},
{
field: 'cntrno',
key: 'cntrno',
title: '箱号',
align: 'left',
width: 240,
},
{
field: 'sealno',
key: 'sealno',
title: '封号',
align: 'left',
},
{
field: 'pkgs',
key: 'pkgs',
title: '件数',
align: 'left',
},
{
field: 'kindpkgs',
key: 'kindpkgs',
title: '包装',
align: 'left',
width: 130,
},
{
field: 'kgs',
key: 'kgs',
title: '毛重',
align: 'left',
},
{
field: 'cbm',
key: 'cbm',
title: '尺码',
align: 'left',
},
])
const radioOption = ref({
//
selectedRowChange: ({ row }) => {
childModelSelect.value = row
tableData.value.map((item, index) => {
if (item.rowKey === row.rowKey) {
childModelSelectIndex.value = index
}
})
if (tableData.value[childModelSelectIndex.value].ctnDetailInputs) {
tableData.value[childModelSelectIndex.value].ctnDetailInputs.map((item, index) => {
item.rowKey = index
})
childTableData.value = tableData.value[childModelSelectIndex.value].ctnDetailInputs
} else {
childTableData.value = []
}
},
})
const childModelSelect: Ref<any> = ref(null)
const childModelSelectIndex: Ref<any> = ref(null)
const childTableData: Ref<any> = ref([])
const selectChildArr = ref([])
const editChildOption = ref({
beforeCellValueChange: ({ row, column, changeValue }) => {
if (
['pkgs', 'kgs', 'cbm'].includes(column.field) &&
!new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue)
) {
notification.error({
message: `输入的${enmuErrorLabel(column.field)}不符合规则`,
duration: 3,
})
row['cntrno'] = ''
setTimeout(() => {
notification.destroy()
notification.config({
top: `100px`,
duration: 2,
maxCount: 3,
})
}, 2000)
return false
}
},
afterCellValueChange: ({ row, column, changeValue }) => {
let num: any = null
childTableData.value.map((item: any, index) => {
if (row.rowKey === item.rowKey) {
// eslint-disable-next-line no-const-assign
num = index
}
})
childTableData.value[num][column.field] = changeValue
// -
// props.details.ctnInputs[childModelSelect.valueIndex].ctnDetailInputs[num][column.field] = changeValue
that.$forceUpdate()
},
cellValueChange: ({ row, column }) => {
console.log(row, column)
},
})
const checkChildboxOption = ref({
hideSelectAll: false,
//
selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
console.log(row, isSelected, selectedRowKeys)
selectChildArr.value = selectedRowKeys
},
//
selectedAllChange: ({ isSelected, selectedRowKeys }) => {
if (isSelected) {
selectChildArr.value = selectedRowKeys
} else {
selectChildArr.value = []
}
},
})
const clipboardChildOption = ref({
copy: true,
paste: true,
cut: true,
delete: true,
beforeCopy: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterCopy: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforePaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterPaste: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforeCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterCut: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
beforeDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
afterDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
log({ data, selectionRangeIndexes, selectionRangeKeys })
},
})
const columnsAuto = ref([
{
dataIndex: 'CTNALL',
@ -2281,6 +1670,42 @@
list.value[changes[0][0]]['isTemp'] = dict?.value
list.value[changes[0][0]]['isTempName'] = dict?.name
}
//
if (changes[0][1] === 'pkgs') {
let RData = 0
list.value.forEach((e) => {
RData = RData + e.pkgs
})
totalPkgs.value = RData
emit('changeTotal', { type: 'totalPkgs', val: totalPkgs.value })
}
//
if (changes[0][1] === 'kgs') {
let RData = 0
list.value.forEach((e) => {
RData = RData + e.kgs
})
totalKgs.value = RData
emit('changeTotal', { type: 'totalKgs', val: totalKgs.value })
}
//
if (changes[0][1] === 'cbm') {
let RData = 0
list.value.forEach((e) => {
RData = RData + e.cbm
})
totalCbm.value = RData
emit('changeTotal', { type: 'totalCbm', val: totalCbm.value })
}
//
if (changes[0][1] === 'ctnNum') {
let RData = 0
list.value.forEach((e) => {
RData = RData + e.ctnNum
})
totalCtn.value = RData
}
}
},
}

Loading…
Cancel
Save