|
|
|
@ -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,14 +848,19 @@
|
|
|
|
|
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
|
|
|
|
|
// 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
|
|
|
|
@ -916,8 +924,10 @@
|
|
|
|
|
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 = {
|
|
|
|
|
}
|
|
|
|
|
const newData = data.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
cbm: item.CBM,
|
|
|
|
|
cntrNo: item.CNTRNO,
|
|
|
|
|
ctn: item.CTNALL,
|
|
|
|
|
ctnCode: item.CtnCode,
|
|
|
|
|
kgs: item.KGS,
|
|
|
|
|
kindpkgs: kindpkgsOld || item.KINDPKGS,
|
|
|
|
|
kindpkgs: item.KINDPKGS,
|
|
|
|
|
pkgs: item.PKGS,
|
|
|
|
|
sealNo: item.SEALNO,
|
|
|
|
|
ctnNum: 1,
|
|
|
|
|
tareWeight: item.TAREWEIGHT,
|
|
|
|
|
tareWeight: item.TAREWEIGHT
|
|
|
|
|
}
|
|
|
|
|
list.value.push(_data)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
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>
|
|
|
|
|