|
|
|
@ -62,28 +62,11 @@
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="nav" @click="PrintExcel" v-show="list.length !== 0">
|
|
|
|
|
<i class="iconfont icon-jiahao2fill"></i>打印
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-if="details.autoYardImport && !details.autoYardImport.isRead"
|
|
|
|
|
style="display: inline-block; margin-left: 10px; padding-top: 5px"
|
|
|
|
|
>
|
|
|
|
|
<!-- <a-icon
|
|
|
|
|
v-if="details.autoYardImport && details.autoYardImport.status == '已导入'"
|
|
|
|
|
@click="handleOpen"
|
|
|
|
|
type="check-circle"
|
|
|
|
|
theme="filled"
|
|
|
|
|
style="color: green; font-size: 19px; cursor: pointer"
|
|
|
|
|
/>
|
|
|
|
|
<a-icon
|
|
|
|
|
v-if="details.autoYardImport && details.autoYardImport.status == '未导入'"
|
|
|
|
|
@click="handleOpen"
|
|
|
|
|
type="exclamation-circle"
|
|
|
|
|
theme="filled"
|
|
|
|
|
style="color: rgb(197, 194, 16); font-size: 19px; cursor: pointer"
|
|
|
|
|
/> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
@ -139,11 +122,6 @@
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
</hot-table>
|
|
|
|
|
<!-- <div class="model-botton-box">
|
|
|
|
|
<a-button class="btn" type="primary" @click="addChildData">新增</a-button>
|
|
|
|
|
<a-button class="btn btn-delete" @click="removeChildData">删除</a-button>
|
|
|
|
|
<a-button class="btn" type="primary" @click="saveChildData">保存</a-button>
|
|
|
|
|
</div> -->
|
|
|
|
|
<a-spin :spinning="!moreSelectLoad">
|
|
|
|
|
<div class="flex" v-if="!isLockBooking" style="justify-content: space-between">
|
|
|
|
|
<div>
|
|
|
|
@ -244,7 +222,6 @@
|
|
|
|
|
import {
|
|
|
|
|
GetYardData,
|
|
|
|
|
ReadAutoYardImport,
|
|
|
|
|
GetCtnListRefsh,
|
|
|
|
|
GetOpCtnList,
|
|
|
|
|
BatchDelOpCtn,
|
|
|
|
|
GetOpCtnDetailList,
|
|
|
|
@ -252,20 +229,7 @@
|
|
|
|
|
BatchDelOpCtnDetail,
|
|
|
|
|
GetCtnSelectList,
|
|
|
|
|
} from '/@/views/operation/seaexport/api/BookingLedger'
|
|
|
|
|
|
|
|
|
|
import { BasicColumn, BasicTable, useTable } from '/@/components/Table'
|
|
|
|
|
import { goodsTablecolumns } from '/@/views/operation/seaexport/detail/columns'
|
|
|
|
|
import {
|
|
|
|
|
ref,
|
|
|
|
|
Ref,
|
|
|
|
|
watchEffect,
|
|
|
|
|
reactive,
|
|
|
|
|
getCurrentInstance,
|
|
|
|
|
h,
|
|
|
|
|
watch,
|
|
|
|
|
onMounted,
|
|
|
|
|
nextTick,
|
|
|
|
|
} from 'vue'
|
|
|
|
|
import { ref, Ref, watchEffect, getCurrentInstance, watch, onMounted, nextTick } from 'vue'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
const { notification } = useMessage()
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
@ -275,7 +239,6 @@
|
|
|
|
|
import { GetPackageSelectList } from '/@/views/operation/seaexport/api/BookingLedger'
|
|
|
|
|
registerAllModules()
|
|
|
|
|
import * as XLSX from 'xlsx'
|
|
|
|
|
import { log } from 'console'
|
|
|
|
|
// import printJS from 'print-js'
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const props = defineProps({
|
|
|
|
@ -289,10 +252,9 @@
|
|
|
|
|
'handleRefshTable',
|
|
|
|
|
'changeCtnInfo',
|
|
|
|
|
])
|
|
|
|
|
let { ctx: that, proxy }: any = getCurrentInstance()
|
|
|
|
|
watch(
|
|
|
|
|
() => props.details,
|
|
|
|
|
(nval, oval) => {
|
|
|
|
|
(nval) => {
|
|
|
|
|
if (nval.id) {
|
|
|
|
|
GetCtnList(nval)
|
|
|
|
|
}
|
|
|
|
@ -304,24 +266,16 @@
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// --------------------------
|
|
|
|
|
const dataSource = ref<any>([])
|
|
|
|
|
// 箱型字段
|
|
|
|
|
const ctnDict = ref([])
|
|
|
|
|
const weightTypeDict = ref([])
|
|
|
|
|
//包装
|
|
|
|
|
const kindPkgsDict = ref([])
|
|
|
|
|
// 费用名称字典
|
|
|
|
|
const feeDict = ref([])
|
|
|
|
|
// 费用标准字典
|
|
|
|
|
const unitDict = ref([])
|
|
|
|
|
// 币别字典
|
|
|
|
|
const currencyDict = ref([])
|
|
|
|
|
// 表格插件
|
|
|
|
|
const hotTb = ref<any>()
|
|
|
|
|
const list = ref<any>([])
|
|
|
|
|
const moreTList = ref<any>([])
|
|
|
|
|
const moreData = ref<any>([[]])
|
|
|
|
|
const moreList = ref<any>([])
|
|
|
|
|
// 定义表格所有列
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
@ -347,13 +301,6 @@
|
|
|
|
|
width: 80,
|
|
|
|
|
data: 'ctnCode',
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// title: '尺寸',
|
|
|
|
|
// width: 80,
|
|
|
|
|
// data: 'size',
|
|
|
|
|
// type: 'numeric',
|
|
|
|
|
// format: '0',
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
title: '箱型',
|
|
|
|
|
width: 120,
|
|
|
|
@ -383,11 +330,6 @@
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
format: '0',
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// title: '表现形式',
|
|
|
|
|
// width: 80,
|
|
|
|
|
// data: 'ctnAll',
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
title: '箱号',
|
|
|
|
|
width: 80,
|
|
|
|
@ -944,9 +886,6 @@
|
|
|
|
|
: 0 + item.ctnNum
|
|
|
|
|
? parseInt(item.ctnNum)
|
|
|
|
|
: 0
|
|
|
|
|
// totalKgs.value = parseInt(totalKgs.value) + parseInt(item.kgs)
|
|
|
|
|
// totalCbm.value = parseInt(totalCbm.value) + parseInt(item.cbm)
|
|
|
|
|
// totalCtn.value = parseInt(totalCtn.value) + parseInt(item.ctnNum)
|
|
|
|
|
item.rowKey = index
|
|
|
|
|
const weightTypeList = weightTypeDict.value.length
|
|
|
|
|
? weightTypeDict.value
|
|
|
|
@ -1136,14 +1075,6 @@
|
|
|
|
|
moreSelectLoad.value = true
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// selectChildArr.value.map((item, index) => {
|
|
|
|
|
// childTableData.value.map((oitem: any, oindex) => {
|
|
|
|
|
// if (item === oitem.rowKey) {
|
|
|
|
|
// childTableData.value.splice(oindex, 1)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
// 导入 EXCEL
|
|
|
|
|
async function UpExcel(file) {
|
|
|
|
@ -1253,19 +1184,9 @@
|
|
|
|
|
for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xff
|
|
|
|
|
return buf
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 打印
|
|
|
|
|
async function PrintExcel() {
|
|
|
|
|
// printJS({
|
|
|
|
|
// printable: 'printableTable',
|
|
|
|
|
// type: 'html',
|
|
|
|
|
// header: null,
|
|
|
|
|
// targetStyles: ['*'],
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
// -------------------------------
|
|
|
|
|
const loadingTable = ref(false)
|
|
|
|
|
const tableData: any = ref([{}])
|
|
|
|
|
|
|
|
|
|
const selectArr = ref([])
|
|
|
|
|
const totalPkgs: any = ref(0)
|
|
|
|
|
const totalKgs: any = ref(0)
|
|
|
|
@ -1278,13 +1199,11 @@
|
|
|
|
|
// 行选择改变事件
|
|
|
|
|
selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
|
|
|
|
|
changeSelectedRowKeys(selectedRowKeys)
|
|
|
|
|
// selectArr.value = selectedRowKeys
|
|
|
|
|
},
|
|
|
|
|
// 全选改变事件
|
|
|
|
|
selectedAllChange: ({ isSelected, selectedRowKeys }) => {
|
|
|
|
|
if (isSelected) {
|
|
|
|
|
changeSelectedRowKeys(selectedRowKeys)
|
|
|
|
|
// selectArr.value = selectedRowKeys
|
|
|
|
|
} else {
|
|
|
|
|
selectArr.value = []
|
|
|
|
|
}
|
|
|
|
@ -1298,29 +1217,8 @@
|
|
|
|
|
const comparisonFlag = ref(false)
|
|
|
|
|
const yardAutoForm: Ref<yardAutoFormObj | any> = ref({})
|
|
|
|
|
const tableLoaded = ref(false)
|
|
|
|
|
const inTableLoad = ref(false)
|
|
|
|
|
const cellAutofillOption = ref({
|
|
|
|
|
directionX: false,
|
|
|
|
|
directionY: true,
|
|
|
|
|
afterAutofill: ({
|
|
|
|
|
direction,
|
|
|
|
|
sourceSelectionRangeIndexes,
|
|
|
|
|
targetSelectionRangeIndexes,
|
|
|
|
|
sourceSelectionData,
|
|
|
|
|
targetSelectionData,
|
|
|
|
|
}) => {
|
|
|
|
|
console.log('direction::', direction)
|
|
|
|
|
console.log('sourceSelectionRangeIndexes::', sourceSelectionRangeIndexes)
|
|
|
|
|
console.log('targetSelectionRangeIndexes::', targetSelectionRangeIndexes)
|
|
|
|
|
console.log('sourceSelectionData::', sourceSelectionData)
|
|
|
|
|
console.log('targetSelectionData::', targetSelectionData)
|
|
|
|
|
console.log('---')
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const moreModelconfirm = ref(false)
|
|
|
|
|
const childTableData: Ref<any> = ref([])
|
|
|
|
|
const selectChildArr = ref([])
|
|
|
|
|
|
|
|
|
|
const columnsAuto = ref([
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'CTNALL',
|
|
|
|
@ -1396,71 +1294,6 @@
|
|
|
|
|
ctnDict.value = res.data
|
|
|
|
|
})
|
|
|
|
|
tableLoaded.value = true
|
|
|
|
|
// if (Object.keys(props.details).length > 0) {
|
|
|
|
|
// const arr: any[] = []
|
|
|
|
|
// const DtotalCtnall = {}
|
|
|
|
|
// totalPkgs.value = 0
|
|
|
|
|
// totalKgs.value = 0
|
|
|
|
|
// totalCbm.value = 0
|
|
|
|
|
// props.details.ctnInputs.map((item, index) => {
|
|
|
|
|
// arr.push({
|
|
|
|
|
// ...{ rowKey: index },
|
|
|
|
|
// ...item,
|
|
|
|
|
// })
|
|
|
|
|
// if (!Object.keys(DtotalCtnall).includes(item.ctnall)) {
|
|
|
|
|
// const cData = {
|
|
|
|
|
// type: 'ctnall',
|
|
|
|
|
// num: item.ctnnum,
|
|
|
|
|
// }
|
|
|
|
|
// DtotalCtnall[item.ctnall] = cData
|
|
|
|
|
// }
|
|
|
|
|
// if (item.pkgs) {
|
|
|
|
|
// totalPkgs.value = (totalPkgs.value * 100 + Number(item.pkgs) * 100) / 100
|
|
|
|
|
// }
|
|
|
|
|
// if (item.kgs) {
|
|
|
|
|
// let onum: any = (totalKgs.value * 10000 + Number(item.kgs) * 10000) / 10000
|
|
|
|
|
// onum += ''
|
|
|
|
|
// const pNum = onum.split('.')
|
|
|
|
|
// if (!/\./.test(onum)) {
|
|
|
|
|
// totalKgs.value = onum + '.00'
|
|
|
|
|
// } else if (pNum[1].length < 2) {
|
|
|
|
|
// totalKgs.value = onum + '0'
|
|
|
|
|
// } else {
|
|
|
|
|
// totalKgs.value = Number(pNum[0] + '.' + pNum[1].substr(0, 5))
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (item.cbm) {
|
|
|
|
|
// let onum: any = (totalCbm.value * 10000 + Number(item.cbm) * 10000) / 10000
|
|
|
|
|
// onum += ''
|
|
|
|
|
// const pNum = onum.split('.')
|
|
|
|
|
// if (!/\./.test(onum)) {
|
|
|
|
|
// totalCbm.value = onum + '.00'
|
|
|
|
|
// } else if (pNum[1].length < 2) {
|
|
|
|
|
// totalCbm.value = onum + '0'
|
|
|
|
|
// } else {
|
|
|
|
|
// totalCbm.value = Number(pNum[0] + '.' + pNum[1].substr(0, 5))
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// tableData.value = arr
|
|
|
|
|
// tableLoaded.value = true
|
|
|
|
|
// totalCtnall.value = ''
|
|
|
|
|
// emit('changeTotal', { type: 'totalKgs', val: totalKgs.value })
|
|
|
|
|
// emit('changeTotal', { type: 'totalPkgs', val: totalPkgs.value })
|
|
|
|
|
// emit('changeTotal', { type: 'totalCbm', val: totalCbm.value })
|
|
|
|
|
// } else {
|
|
|
|
|
// tableData.value = []
|
|
|
|
|
// tableLoaded.value = true
|
|
|
|
|
// totalCtnall.value = ''
|
|
|
|
|
// totalPkgs.value = 0
|
|
|
|
|
// totalKgs.value = 0
|
|
|
|
|
// totalCbm.value = 0
|
|
|
|
|
// }
|
|
|
|
|
// const obj = {}
|
|
|
|
|
// // this.$options.filters['dictData']('BookingLockCtn').forEach((item) => {
|
|
|
|
|
// // obj[item.code] = true
|
|
|
|
|
// // })
|
|
|
|
|
// BookingLockCtn.value = obj
|
|
|
|
|
}
|
|
|
|
|
function changeSelectedRowKeys(keys) {
|
|
|
|
|
selectArr.value = keys
|
|
|
|
@ -1484,7 +1317,6 @@
|
|
|
|
|
totalCtn.value = DtotalCtn
|
|
|
|
|
}
|
|
|
|
|
function importYarn() {
|
|
|
|
|
// notification.warning({ message: '功能开发中...', duration: 3 })
|
|
|
|
|
if (!props.details.id) {
|
|
|
|
|
notification.error({ message: '请先保存订舱信息', duration: 3 })
|
|
|
|
|
return false
|
|
|
|
@ -1497,14 +1329,11 @@
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
const data = JSON.parse(res.data)
|
|
|
|
|
// const addTable: any[] = []
|
|
|
|
|
|
|
|
|
|
const kindpkgsOld = list.value[0] ? list.value[0].kindPkgs : ''
|
|
|
|
|
// list.value = []
|
|
|
|
|
// const lastNum =
|
|
|
|
|
// list.value.length > 0 ? Number(list.value[list.value.length - 1].rowKey) + 1 : 0
|
|
|
|
|
|
|
|
|
|
data.map((item, index) => {
|
|
|
|
|
const _data = {
|
|
|
|
|
// rowKey: lastNum + index,
|
|
|
|
|
cbm: item.CBM,
|
|
|
|
|
cntrNo: item.CNTRNO,
|
|
|
|
|
ctn: item.CTNALL,
|
|
|
|
@ -1516,17 +1345,9 @@
|
|
|
|
|
ctnNum: 1,
|
|
|
|
|
tareWeight: item.TAREWEIGHT,
|
|
|
|
|
}
|
|
|
|
|
// addTable.push(_data)
|
|
|
|
|
|
|
|
|
|
list.value.push(_data)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// console.log(list.value)
|
|
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// list.value = [...list.value, ...addTable]
|
|
|
|
|
// console.log(list.value)
|
|
|
|
|
// }, 10)
|
|
|
|
|
// that.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
|
notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
}
|
|
|
|
@ -1538,7 +1359,6 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function importsealno() {
|
|
|
|
|
// notification.warning({ message: '功能开发中...', duration: 3 })
|
|
|
|
|
sealnoLoading.value = true
|
|
|
|
|
GetYardData({
|
|
|
|
|
id: props.details.id,
|
|
|
|
@ -1562,26 +1382,6 @@
|
|
|
|
|
list.value[index].ctnNum = 1
|
|
|
|
|
})
|
|
|
|
|
computing()
|
|
|
|
|
// const map = {}
|
|
|
|
|
// const dest: any[] = []
|
|
|
|
|
// for (var i = 0; i < list.value.length; i++) {
|
|
|
|
|
// var ai = list.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
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} else {
|
|
|
|
|
notification.error({ message: '箱量与场站不一致', duration: 3 })
|
|
|
|
|
}
|
|
|
|
@ -1596,7 +1396,6 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function importWeight() {
|
|
|
|
|
// notification.warning({ message: '功能开发中...', duration: 3 })
|
|
|
|
|
if (!props.details.id) {
|
|
|
|
|
notification.error({ message: '请先保存订舱信息', duration: 3 })
|
|
|
|
|
return false
|
|
|
|
@ -1609,11 +1408,10 @@
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
const data = JSON.parse(res.data)
|
|
|
|
|
// const addTable: any[] = []
|
|
|
|
|
|
|
|
|
|
const cntrnoArr: any[] = []
|
|
|
|
|
list.value.map((item: any, index) => {
|
|
|
|
|
if (!item.cntrNo) {
|
|
|
|
|
// delete tableData.value[index]
|
|
|
|
|
list.value.splice(index, 1)
|
|
|
|
|
} else {
|
|
|
|
|
cntrnoArr.push(item.cntrNo)
|
|
|
|
@ -1626,29 +1424,10 @@
|
|
|
|
|
cntrnoArr.push(list.value[i].cntrNo)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// const lastNum =
|
|
|
|
|
// list.value.length > 0 ? Number(list.value[list.value.length - 1].rowKey) + 1 : 0
|
|
|
|
|
|
|
|
|
|
data.map((item, index) => {
|
|
|
|
|
if (cntrnoArr.includes(item.CNTRNO)) {
|
|
|
|
|
// const setWeighkgs = calc(
|
|
|
|
|
// Number(list.value[cntrnoArr.indexOf(item.CNTRNO)].kgs),
|
|
|
|
|
// Number(item.TAREWEIGHT),
|
|
|
|
|
// '+',
|
|
|
|
|
// )
|
|
|
|
|
list.value[cntrnoArr.indexOf(item.CNTRNO)] = {
|
|
|
|
|
// rowKey: list.value[cntrnoArr.indexOf(item.CNTRNO)].rowKey,
|
|
|
|
|
// ctnall: list.value[cntrnoArr.indexOf(item.CNTRNO)].ctnall,
|
|
|
|
|
// ctnnum: list.value[cntrnoArr.indexOf(item.CNTRNO)].ctnnum,
|
|
|
|
|
// cntrNo: list.value[cntrnoArr.indexOf(item.CNTRNO)].cntrNo,
|
|
|
|
|
// sealno: list.value[cntrnoArr.indexOf(item.CNTRNO)].sealno,
|
|
|
|
|
// pkgs: list.value[cntrnoArr.indexOf(item.CNTRNO)].pkgs,
|
|
|
|
|
// kindpkgs: list.value[cntrnoArr.indexOf(item.CNTRNO)].kindpkgs,
|
|
|
|
|
// kgs: list.value[cntrnoArr.indexOf(item.CNTRNO)].kgs,
|
|
|
|
|
// cbm: list.value[cntrnoArr.indexOf(item.CNTRNO)].cbm,
|
|
|
|
|
// tareweight: item.TAREWEIGHT,
|
|
|
|
|
// weightype: list.value[cntrnoArr.indexOf(item.CNTRNO)].weightype,
|
|
|
|
|
// weighkgs: setWeighkgs,
|
|
|
|
|
// weighdate: list.value[cntrnoArr.indexOf(item.CNTRNO)].weighdate,
|
|
|
|
|
cbm: item.CBM,
|
|
|
|
|
cntrNo: item.CNTRNO,
|
|
|
|
|
ctn: item.CTNALL,
|
|
|
|
@ -1672,26 +1451,10 @@
|
|
|
|
|
sealNo: '',
|
|
|
|
|
ctnNum: 1,
|
|
|
|
|
tareWeight: item.TAREWEIGHT,
|
|
|
|
|
// // rowKey: lastNum + index,
|
|
|
|
|
// ctnall: '',
|
|
|
|
|
// ctnnum: '1',
|
|
|
|
|
// cntrNo: '',
|
|
|
|
|
// sealno: '',
|
|
|
|
|
// pkgs: '',
|
|
|
|
|
// kindpkgs: '',
|
|
|
|
|
// kgs: '',
|
|
|
|
|
// cbm: '',
|
|
|
|
|
// tareweight: item.TAREWEIGHT,
|
|
|
|
|
// weightype: '',
|
|
|
|
|
// weighkgs: '',
|
|
|
|
|
// weighdate: '',
|
|
|
|
|
}
|
|
|
|
|
list.value.push(_data)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// list.value = [...list.value, ...addTable]
|
|
|
|
|
// that.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
|
notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
}
|
|
|
|
@ -1701,94 +1464,6 @@
|
|
|
|
|
WeightLoading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function calc(num1, num2, calcStr) {
|
|
|
|
|
var str1 // 转换为字符串的数字
|
|
|
|
|
var str2
|
|
|
|
|
var ws1 = 0 // ws1,ws2 用来存储传入的num的小数点后的数字的位数
|
|
|
|
|
var ws2 = 0 // 赋默认值,解决当整数和小数运算时倍数计算错误导致的结果误差
|
|
|
|
|
var bigger // bigger和smaller用于加,减,除法找出小的那个数字,给后面补0,解决位数不对从而造成的计算错误的问题;乘法需要将结果除两个数字的倍数之和
|
|
|
|
|
var smaller // 例如:加减除法中1.001 + 2.03 ,如果不给2.03进行补0,最后会变成1001+203,数字错位导致结果错误;乘法中1.12*1.1会放大为112*11,所以结果需要除以1000才会是正确的结果,112*11/1000=1.232
|
|
|
|
|
var zeroCount // 需要补充0的个数
|
|
|
|
|
var isExistDot1 // 传入的数字是否存在小数点
|
|
|
|
|
var isExistDot2
|
|
|
|
|
var sum
|
|
|
|
|
var beishu = 1
|
|
|
|
|
// 将数字转换为字符串
|
|
|
|
|
str1 = num1.toString()
|
|
|
|
|
str2 = num2.toString()
|
|
|
|
|
// 是否存在小数点(判断需要计算的数字是不是包含小数)
|
|
|
|
|
isExistDot1 = str1.indexOf('.') != -1
|
|
|
|
|
isExistDot2 = str2.indexOf('.') != -1
|
|
|
|
|
// 取小数点后面的位数
|
|
|
|
|
if (isExistDot1) {
|
|
|
|
|
ws1 = str1.split('.')[1].length
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isExistDot2) {
|
|
|
|
|
ws2 = str2.split('.')[1].length
|
|
|
|
|
}
|
|
|
|
|
// 如ws1 和 ws2 无默认值,如果num1 或 num2 不是小数的话则 ws1 或 ws2 的值将为 undefined
|
|
|
|
|
// bigger 和 smaller 的值会和预期不符
|
|
|
|
|
bigger = ws1 > ws2 ? ws1 : ws2
|
|
|
|
|
smaller = ws1 < ws2 ? ws1 : ws2
|
|
|
|
|
|
|
|
|
|
switch (calcStr) {
|
|
|
|
|
// 加减法找出小的那个数字,给后面补0,解决位数不对从而造成的计算错误的问题
|
|
|
|
|
// 例如:1.001 + 2.03 ,如果不给2.03进行补0,最后会变成1001+203,数字错位导致结果错误
|
|
|
|
|
case '+':
|
|
|
|
|
case '-':
|
|
|
|
|
case '/':
|
|
|
|
|
zeroCount = bigger - smaller
|
|
|
|
|
for (var i = 0; i < zeroCount; i++) {
|
|
|
|
|
if (ws1 == smaller) {
|
|
|
|
|
str1 += '0'
|
|
|
|
|
} else {
|
|
|
|
|
str2 += '0'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
case '*':
|
|
|
|
|
// 乘法需要将结果除两个数字的倍数之和
|
|
|
|
|
bigger = bigger + smaller
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '暂不支持的计算类型,现已支持的有加法、减法、乘法、除法'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 去除数字中的小数点
|
|
|
|
|
str1 = str1.replace('.', '')
|
|
|
|
|
str2 = str2.replace('.', '')
|
|
|
|
|
|
|
|
|
|
// 计算倍数,例如:1.001小数点后有三位,则需要乘 1000 变成 1001,变成整数后精度丢失问题则不会存在
|
|
|
|
|
for (var i = 0; i < bigger; i++) {
|
|
|
|
|
beishu *= 10 // 等价于beishu = beishu * 10;
|
|
|
|
|
}
|
|
|
|
|
num1 = parseInt(str1)
|
|
|
|
|
num2 = parseInt(str2)
|
|
|
|
|
// 进行最终计算并除相应倍数
|
|
|
|
|
switch (calcStr) {
|
|
|
|
|
case '+':
|
|
|
|
|
sum = (num1 + num2) / beishu
|
|
|
|
|
break
|
|
|
|
|
case '-':
|
|
|
|
|
sum = (num1 - num2) / beishu
|
|
|
|
|
break
|
|
|
|
|
case '*':
|
|
|
|
|
sum = (num1 * num2) / beishu
|
|
|
|
|
break
|
|
|
|
|
case '/':
|
|
|
|
|
sum = num1 / num2
|
|
|
|
|
/* 除数与被除数同时放大一定倍数,不影响结果,
|
|
|
|
|
所以对数字进行放大对应倍数并进行补0操作后不用另对倍数做处理 */
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '暂不支持的计算类型,现已支持的有加法、减法、乘法、除法'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sum
|
|
|
|
|
}
|
|
|
|
|
function arrowsWeight() {
|
|
|
|
|
let SelectData: any = []
|
|
|
|
|
let SelectIndex: any
|
|
|
|
@ -1816,8 +1491,6 @@
|
|
|
|
|
: Math.floor(SelectData[0].pkgs / SelectData[0].ctnNum)
|
|
|
|
|
let cbmU: any = (SelectData[0].cbm / SelectData[0].pkgs).toFixed(2)
|
|
|
|
|
let kgsU: any = (SelectData[0].kgs / SelectData[0].pkgs).toFixed(2)
|
|
|
|
|
// kgs: kgs,
|
|
|
|
|
// cbm: cbm,
|
|
|
|
|
Arr.push({ ...SelectData[0], ctnNum: 1, pkgs, cbm: pkgs * cbmU, kgs: pkgs * kgsU })
|
|
|
|
|
}
|
|
|
|
|
list.value.splice(SelectIndex, 1)
|
|
|
|
@ -1832,7 +1505,6 @@
|
|
|
|
|
}
|
|
|
|
|
function handleRefsh() {
|
|
|
|
|
GetCtnList(props.details)
|
|
|
|
|
// emit('handleRefshTable')
|
|
|
|
|
}
|
|
|
|
|
function handleOpen() {
|
|
|
|
|
comparisonFlag.value = true
|
|
|
|
@ -1922,11 +1594,6 @@
|
|
|
|
|
deep: true,
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
// addShortcut({
|
|
|
|
|
// key: 'Ctrl+Shift+A', // 自定义快捷键
|
|
|
|
|
// callback: () => alert('自定义快捷键触发'), // 快捷键回调函数
|
|
|
|
|
// isEditable: false, // 是否在编辑状态下允许使用快捷键
|
|
|
|
|
// }),
|
|
|
|
|
// 表格配置项
|
|
|
|
|
let OTeu = ref(0)
|
|
|
|
|
const settings = {
|
|
|
|
@ -2140,34 +1807,6 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// watch(
|
|
|
|
|
// moreData.value[moreSelectNum.value],
|
|
|
|
|
// (val) => {
|
|
|
|
|
// let a = 0
|
|
|
|
|
// let b = 0
|
|
|
|
|
// val.forEach((item) => {
|
|
|
|
|
// if (item.selected) {
|
|
|
|
|
// a += 1
|
|
|
|
|
// } else {
|
|
|
|
|
// b += 1
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// if (a == 0) {
|
|
|
|
|
// moreAllCheck.value = false
|
|
|
|
|
// }
|
|
|
|
|
// if (b == 0) {
|
|
|
|
|
// moreAllCheck.value = true
|
|
|
|
|
// }
|
|
|
|
|
// if (a != 0 && b != 0) {
|
|
|
|
|
// moreSomeCheck.value = true
|
|
|
|
|
// } else {
|
|
|
|
|
// moreSomeCheck.value = false
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// deep: true,
|
|
|
|
|
// },
|
|
|
|
|
// )
|
|
|
|
|
let isSave = ref([false, false, false])
|
|
|
|
|
function RSaveType() {
|
|
|
|
|
let res = isSave.value.filter((num) => num)
|
|
|
|
@ -2229,7 +1868,6 @@
|
|
|
|
|
// 定义所有单元格发生变化的回调处理
|
|
|
|
|
afterChange(changes, source) {
|
|
|
|
|
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
|
|
|
|
|
let dict: any = {}
|
|
|
|
|
// 计算件数
|
|
|
|
|
if (changes[0][1] === 'pkgs') {
|
|
|
|
|
let total: number = 0
|
|
|
|
@ -2281,7 +1919,6 @@
|
|
|
|
|
const hotmain = ref(null)
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
const hot = hotmain.value.hotInstance
|
|
|
|
|
hot.addHook('afterOnCellMouseDown', function (event, coords, TD) {})
|
|
|
|
|
// 定义表格按键处理逻辑
|
|
|
|
|
hot.addHook('beforeKeyDown', function (event) {
|
|
|
|
|
// 检查按下的是否是特定的键(例如 'Enter')
|
|
|
|
|