|
|
|
@ -50,7 +50,7 @@
|
|
|
|
|
<span class="iconfont icon-refresh-1-copy"></span>
|
|
|
|
|
刷新
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="link" v-repeat size="mini" @click="addboxLine">
|
|
|
|
|
<a-button type="link" size="mini" @click="addboxLine">
|
|
|
|
|
<span class="iconfont icon-new_document"></span>
|
|
|
|
|
添加
|
|
|
|
|
</a-button>
|
|
|
|
@ -284,7 +284,9 @@
|
|
|
|
|
const kindPkgsDict = ref([])
|
|
|
|
|
// 表格插件
|
|
|
|
|
const hotTb = ref<any>()
|
|
|
|
|
const list = ref<any>([])
|
|
|
|
|
const list = ref([{
|
|
|
|
|
selected: false
|
|
|
|
|
}])
|
|
|
|
|
const moreTList = ref<any>([])
|
|
|
|
|
const moreData = ref<any>([[]])
|
|
|
|
|
// 选中的包装下拉数据
|
|
|
|
@ -318,6 +320,7 @@
|
|
|
|
|
title: '箱型',
|
|
|
|
|
width: 60,
|
|
|
|
|
data: 'ctn',
|
|
|
|
|
className: 'ctn-type',
|
|
|
|
|
type: 'dropdown',
|
|
|
|
|
// 下拉框数据,可以同步或者异步返回(异步需要process返回)
|
|
|
|
|
source: async (query, process) => {
|
|
|
|
@ -845,79 +848,86 @@
|
|
|
|
|
sortConditions: [],
|
|
|
|
|
},
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
res.data = JSON.parse(
|
|
|
|
|
JSON.stringify(res.data)
|
|
|
|
|
.replaceAll('"0001-01-01 00:00:00"', '""')
|
|
|
|
|
.replaceAll(':"0"', ':""')
|
|
|
|
|
.replaceAll(':0,', ':"",'),
|
|
|
|
|
)
|
|
|
|
|
list.value.splice(0)
|
|
|
|
|
let data = res.data
|
|
|
|
|
totalPkgs.value = 0
|
|
|
|
|
data.forEach(async (item, index) => {
|
|
|
|
|
totalPkgs.value = totalPkgs.value
|
|
|
|
|
? parseInt(totalPkgs.value)
|
|
|
|
|
: 0 + item.pkgs
|
|
|
|
|
? parseInt(item.pkgs)
|
|
|
|
|
: 0
|
|
|
|
|
totalKgs.value = totalKgs.value
|
|
|
|
|
? parseInt(totalKgs.value)
|
|
|
|
|
: 0 + item.kgs
|
|
|
|
|
? parseInt(item.kgs)
|
|
|
|
|
: 0
|
|
|
|
|
totalCbm.value = totalCbm.value
|
|
|
|
|
? parseInt(totalCbm.value)
|
|
|
|
|
: 0 + item.cbm
|
|
|
|
|
? parseInt(item.cbm)
|
|
|
|
|
: 0
|
|
|
|
|
totalCtn.value = totalCtn.value
|
|
|
|
|
? parseInt(totalCtn.value)
|
|
|
|
|
: 0 + item.ctnNum
|
|
|
|
|
? parseInt(item.ctnNum)
|
|
|
|
|
: 0
|
|
|
|
|
item.rowKey = index
|
|
|
|
|
const weightTypeList = await getDictOption('weight_type')
|
|
|
|
|
if (!weightTypeDict.value.length) {
|
|
|
|
|
// res.data = JSON.parse(
|
|
|
|
|
// JSON.stringify(res.data)
|
|
|
|
|
// .replaceAll('"0001-01-01 00:00:00"', '""')
|
|
|
|
|
// .replaceAll(':"0"', ':""')
|
|
|
|
|
// .replaceAll(':0,', ':"",'),
|
|
|
|
|
// )
|
|
|
|
|
const { data } = res
|
|
|
|
|
if (data.length == 0) {
|
|
|
|
|
list.value = [{
|
|
|
|
|
selectd: false
|
|
|
|
|
}]
|
|
|
|
|
} else {
|
|
|
|
|
list.value = []
|
|
|
|
|
totalPkgs.value = 0
|
|
|
|
|
data.forEach(async (item, index) => {
|
|
|
|
|
totalPkgs.value = totalPkgs.value
|
|
|
|
|
? parseInt(totalPkgs.value)
|
|
|
|
|
: 0 + item.pkgs
|
|
|
|
|
? parseInt(item.pkgs)
|
|
|
|
|
: 0
|
|
|
|
|
totalKgs.value = totalKgs.value
|
|
|
|
|
? parseInt(totalKgs.value)
|
|
|
|
|
: 0 + item.kgs
|
|
|
|
|
? parseInt(item.kgs)
|
|
|
|
|
: 0
|
|
|
|
|
totalCbm.value = totalCbm.value
|
|
|
|
|
? parseInt(totalCbm.value)
|
|
|
|
|
: 0 + item.cbm
|
|
|
|
|
? parseInt(item.cbm)
|
|
|
|
|
: 0
|
|
|
|
|
totalCtn.value = totalCtn.value
|
|
|
|
|
? parseInt(totalCtn.value)
|
|
|
|
|
: 0 + item.ctnNum
|
|
|
|
|
? parseInt(item.ctnNum)
|
|
|
|
|
: 0
|
|
|
|
|
item.rowKey = index
|
|
|
|
|
const weightTypeList = await getDictOption('weight_type')
|
|
|
|
|
if (!weightTypeDict.value.length) {
|
|
|
|
|
weightTypeList.forEach((e) => {
|
|
|
|
|
weightTypeDict.value.push(e)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
weightTypeList.forEach((e) => {
|
|
|
|
|
weightTypeDict.value.push(e)
|
|
|
|
|
if (e.value == item.weightType) {
|
|
|
|
|
item.weightTypeName = e.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
weightTypeList.forEach((e) => {
|
|
|
|
|
if (e.value == item.weightType) {
|
|
|
|
|
item.weightTypeName = e.name
|
|
|
|
|
const kindPkgsList = kindPkgsDict.value.length
|
|
|
|
|
? kindPkgsDict.value
|
|
|
|
|
: (await GetPackageSelectList())?.data
|
|
|
|
|
if (!kindPkgsDict.value.length) {
|
|
|
|
|
kindPkgsDict.value.splice(0)
|
|
|
|
|
kindPkgsList.forEach((e) => {
|
|
|
|
|
kindPkgsDict.value.push(e)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const kindPkgsList = kindPkgsDict.value.length
|
|
|
|
|
? kindPkgsDict.value
|
|
|
|
|
: (await GetPackageSelectList())?.data
|
|
|
|
|
if (!kindPkgsDict.value.length) {
|
|
|
|
|
kindPkgsDict.value.splice(0)
|
|
|
|
|
kindPkgsList.forEach((e) => {
|
|
|
|
|
kindPkgsDict.value.push(e)
|
|
|
|
|
if (e.id == item.kindPkgs) {
|
|
|
|
|
item.kindPkgsName = e.packageName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const isTempList = [
|
|
|
|
|
{
|
|
|
|
|
name: '是',
|
|
|
|
|
value: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '否',
|
|
|
|
|
value: false,
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
isTempList.forEach((e) => {
|
|
|
|
|
if (e.value == item.isTemp) {
|
|
|
|
|
item.isTempName = e.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
kindPkgsList.forEach((e) => {
|
|
|
|
|
if (e.id == item.kindPkgs) {
|
|
|
|
|
item.kindPkgsName = e.packageName
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const isTempList = [
|
|
|
|
|
{
|
|
|
|
|
name: '是',
|
|
|
|
|
value: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '否',
|
|
|
|
|
value: false,
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
isTempList.forEach((e) => {
|
|
|
|
|
if (e.value == item.isTemp) {
|
|
|
|
|
item.isTempName = e.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
list.value.push(item)
|
|
|
|
|
})
|
|
|
|
|
list.value = data
|
|
|
|
|
}
|
|
|
|
|
hotmain.value.hotInstance.loadData(list.value)
|
|
|
|
|
// 不是可编辑页面禁用表格
|
|
|
|
|
if (source != 'edit') {
|
|
|
|
|
hotTb.value.hotInstance.updateSettings({
|
|
|
|
@ -967,7 +977,10 @@
|
|
|
|
|
|
|
|
|
|
// 添加行
|
|
|
|
|
function addboxLine() {
|
|
|
|
|
list.value.push({})
|
|
|
|
|
list.value.push({
|
|
|
|
|
selected: false
|
|
|
|
|
})
|
|
|
|
|
hotmain.value.hotInstance.loadData(list.value)
|
|
|
|
|
}
|
|
|
|
|
const deleteFlag = ref(false)
|
|
|
|
|
// 校验是否选中行
|
|
|
|
@ -1332,7 +1345,7 @@
|
|
|
|
|
}
|
|
|
|
|
function importYarn() {
|
|
|
|
|
if (!props.details.id) {
|
|
|
|
|
notification.error({ message: '请先保存订舱信息', duration: 3 })
|
|
|
|
|
createMessage.warning('请先保存订舱信息')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
loadingTable.value = true
|
|
|
|
@ -1343,19 +1356,20 @@
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
const data = JSON.parse(res.data)
|
|
|
|
|
const kindpkgsOld = list.value[0] ? list.value[0].kindPkgs : ''
|
|
|
|
|
// 回填船名航次
|
|
|
|
|
if (data.length) {
|
|
|
|
|
// 导入去重
|
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
|
if (list.value.length) {
|
|
|
|
|
list.value.forEach(row => {
|
|
|
|
|
if (data[i].CNTRNO == row.cntrNo) {
|
|
|
|
|
if (data[i].CNTRNO === row.cntrNo) {
|
|
|
|
|
data.splice(i, 1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (data.length) {
|
|
|
|
|
// 如果还有数据则发出提示
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: createVNode(
|
|
|
|
@ -1373,22 +1387,25 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
data.map((item, index) => {
|
|
|
|
|
const _data = {
|
|
|
|
|
cbm: item.CBM,
|
|
|
|
|
cntrNo: item.CNTRNO,
|
|
|
|
|
ctn: item.CTNALL,
|
|
|
|
|
ctnCode: item.CtnCode,
|
|
|
|
|
kgs: item.KGS,
|
|
|
|
|
kindpkgs: kindpkgsOld || item.KINDPKGS,
|
|
|
|
|
pkgs: item.PKGS,
|
|
|
|
|
sealNo: item.SEALNO,
|
|
|
|
|
ctnNum: 1,
|
|
|
|
|
tareWeight: item.TAREWEIGHT,
|
|
|
|
|
}
|
|
|
|
|
list.value.push(_data)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const newData = data.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
cbm: item.CBM,
|
|
|
|
|
cntrNo: item.CNTRNO,
|
|
|
|
|
ctn: item.CTNALL,
|
|
|
|
|
ctnCode: item.CtnCode,
|
|
|
|
|
kgs: item.KGS,
|
|
|
|
|
kindpkgs: item.KINDPKGS,
|
|
|
|
|
pkgs: item.PKGS,
|
|
|
|
|
sealNo: item.SEALNO,
|
|
|
|
|
ctnNum: 1,
|
|
|
|
|
tareWeight: item.TAREWEIGHT
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
list.value = [...list.value, ...newData]
|
|
|
|
|
// const kindpkgsOld = list.value[0] ? list.value[0].kindPkgs : ''
|
|
|
|
|
hotmain.value.hotInstance.loadData(list.value)
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
loadingTable.value = false
|
|
|
|
|
computing()
|
|
|
|
@ -1635,7 +1652,7 @@
|
|
|
|
|
)
|
|
|
|
|
// 表格配置项
|
|
|
|
|
const settings = {
|
|
|
|
|
height: '208',
|
|
|
|
|
height: 'auto',
|
|
|
|
|
autoWrapRow: true,
|
|
|
|
|
autoWrapCol: true,
|
|
|
|
|
// 每行的高度
|
|
|
|
@ -1988,3 +2005,6 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|