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