lijingjia 4 months ago
commit 56b1c09923

@ -24,7 +24,14 @@
v-model="allCheckL" v-model="allCheckL"
:indeterminate="someCheckL" :indeterminate="someCheckL"
/> />
<hot-table :data="Llist" :settings="Lsettings"> </hot-table> <hot-table :data="Llist" :settings="Lsettings">
<img
v-show="!Llist.length"
class="hot-tb-no-data"
src="../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
</div> </div>
</div> </div>
<div class="BoxUnit"> <div class="BoxUnit">
@ -39,7 +46,14 @@
v-model="allCheckR" v-model="allCheckR"
:indeterminate="someCheckR" :indeterminate="someCheckR"
/> />
<hot-table :data="Rlist" :settings="Rsettings"></hot-table> <hot-table :data="Rlist" :settings="Rsettings">
<img
v-show="!Rlist.length"
class="hot-tb-no-data"
src="../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
</div> </div>
</div> </div>
</div> </div>

@ -5,7 +5,7 @@
--> -->
<template> <template>
<div class="fee-field"> <div class="fee-field">
<div class='flex'> <div class="flex">
<h2>费用字段</h2> <h2>费用字段</h2>
<div> <div>
<a-button type="primary" size="small" @click="addRow"></a-button> <a-button type="primary" size="small" @click="addRow"></a-button>
@ -20,17 +20,38 @@
</div> </div>
</div> </div>
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div style="position: relative;"> <div style="position: relative">
<input class="ds-tb-check" type="checkbox" v-model="allCheck" :indeterminate="someCheck"> <input class="ds-tb-check" type="checkbox" v-model="allCheck" :indeterminate="someCheck" />
<hot-table ref="hotTb" :data="list" :settings="settings"></hot-table> <hot-table ref="hotTb" :data="list" :settings="settings">
<img
v-show="!list.length"
class="hot-tb-no-data"
src="../../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
</div> </div>
</a-spin> </a-spin>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted, defineProps, watch, nextTick, defineComponent, defineExpose, watchEffect, inject } from 'vue' import {
ref,
onMounted,
defineProps,
watch,
nextTick,
defineComponent,
defineExpose,
watchEffect,
inject,
} from 'vue'
// //
import { GetFeeCodeSelectList, GetClientListByCode, GetFeeCurrencySelectList } from '/@/api/common' import {
GetFeeCodeSelectList,
GetClientListByCode,
GetFeeCurrencySelectList,
} from '/@/api/common'
import { GetFeeTemplateDetailList, BatchDelFeeTemplateDetail } from '../api' import { GetFeeTemplateDetailList, BatchDelFeeTemplateDetail } from '../api'
// //
import { feeUnitDict } from '/@/hooks/dict/index' import { feeUnitDict } from '/@/hooks/dict/index'
@ -41,14 +62,15 @@
import { registerAllModules } from 'handsontable/registry' import { registerAllModules } from 'handsontable/registry'
import 'handsontable/dist/handsontable.full.min.css' import 'handsontable/dist/handsontable.full.min.css'
defineComponent({ defineComponent({
HotTable, HotColumn HotTable,
HotColumn,
}) })
registerAllModules(); registerAllModules()
const { createMessage, notification } = useMessage() const { createMessage, notification } = useMessage()
const props = defineProps({ const props = defineProps({
id: { id: {
type: String type: String,
} },
}) })
// //
const currencyDict = ref([]) const currencyDict = ref([])
@ -85,7 +107,7 @@
currency: '', currency: '',
feeEnName: '', feeEnName: '',
customerName: '', customerName: '',
customerType: '' customerType: '',
}) })
} }
// //
@ -95,13 +117,15 @@
type: 'checkbox', type: 'checkbox',
title: ' ', title: ' ',
width: 32, width: 32,
className: "htCenter", className: 'htCenter',
readOnly: false readOnly: false,
}, { },
{
title: '序号', title: '序号',
width: 130, width: 130,
readOnly: true readOnly: true,
}, { },
{
title: '费用名称', title: '费用名称',
width: 130, width: 130,
data: 'feeName', data: 'feeName',
@ -110,12 +134,13 @@
source: async (query, process) => { source: async (query, process) => {
const res = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data const res = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
if (!feeDict.value.length) feeDict.value = res if (!feeDict.value.length) feeDict.value = res
const dict = res.map(res => { const dict = res.map((res) => {
return res.name return res.name
}) })
process(dict) process(dict)
} },
}, { },
{
title: '费用英文名称', title: '费用英文名称',
width: 130, width: 130,
data: 'feeEnName', data: 'feeEnName',
@ -123,12 +148,13 @@
source: async (query, process) => { source: async (query, process) => {
const res = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data const res = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
if (!feeDict.value.length) feeDict.value = res if (!feeDict.value.length) feeDict.value = res
const dict = res.map(res => { const dict = res.map((res) => {
return res.enName return res.enName
}) })
process(dict) process(dict)
} },
}, { },
{
title: '结算对象', title: '结算对象',
width: 130, width: 130,
data: 'customerName', data: 'customerName',
@ -138,9 +164,9 @@
const rowIndex = hotTb.value.hotInstance.countRows() const rowIndex = hotTb.value.hotInstance.countRows()
const code = list.value[rowIndex - 1].customerType const code = list.value[rowIndex - 1].customerType
if (code) { if (code) {
GetClientListByCode({ code }).then(res => { GetClientListByCode({ code }).then((res) => {
const { data } = res const { data } = res
data.forEach(item => { data.forEach((item) => {
item['label'] = item.shortName item['label'] = item.shortName
item['value'] = item.codeName item['value'] = item.codeName
}) })
@ -154,81 +180,92 @@
process([]) process([])
} }
}, },
}, { },
{
title: '客户类别', title: '客户类别',
width: 130, width: 130,
data: 'customerTypeText', data: 'customerTypeText',
type: 'dropdown', type: 'dropdown',
source: async (query, process) => { source: async (query, process) => {
const results = await getDictOption('djy_cust_prop') const results = await getDictOption('djy_cust_prop')
const dict = results.map(item => { const dict = results.map((item) => {
return item.name return item.name
}) })
process(dict) process(dict)
} },
}, { },
{
title: '单位标准', title: '单位标准',
width: 130, width: 130,
data: 'unitText', data: 'unitText',
type: 'dropdown', type: 'dropdown',
source: async (query, process) => { source: async (query, process) => {
if (unitDict.value && unitDict.value.length) { if (unitDict.value && unitDict.value.length) {
const dict = unitDict.value.map(item => { const dict = unitDict.value.map((item) => {
return item.name return item.name
}) })
process(dict) process(dict)
} else { } else {
const results = await feeUnitDict() const results = await feeUnitDict()
unitDict.value = results unitDict.value = results
const dict = results.map(item => { const dict = results.map((item) => {
return item.name return item.name
}) })
process(dict) process(dict)
} }
} },
}, { },
{
title: '不含税单价', title: '不含税单价',
width: 120, width: 120,
data: 'noTaxPrice', data: 'noTaxPrice',
type: 'numeric' type: 'numeric',
}, { },
{
title: '单价', title: '单价',
width: 120, width: 120,
data: 'unitPrice', data: 'unitPrice',
type: 'numeric', type: 'numeric',
format: '0.00' format: '0.00',
}, { },
{
title: '数量', title: '数量',
width: 120, width: 120,
data: 'quantity', data: 'quantity',
type: 'numeric', type: 'numeric',
format: '0' format: '0',
}, { },
{
title: '金额', title: '金额',
width: 120, width: 120,
data: 'amount', data: 'amount',
type: 'numeric' type: 'numeric',
}, { },
{
title: '不含税金额', title: '不含税金额',
width: 120, width: 120,
data: 'noTaxAmount', data: 'noTaxAmount',
type: 'numeric', type: 'numeric',
format: '0.00' format: '0.00',
}, { },
{
title: '税率', title: '税率',
width: 120, width: 120,
data: 'taxRate', data: 'taxRate',
type: 'numeric' type: 'numeric',
}, { },
{
title: '汇率', title: '汇率',
width: 120, width: 120,
data: 'exchangeRate', data: 'exchangeRate',
type: 'numeric' type: 'numeric',
}, { },
{
title: '备注', title: '备注',
width: 120, width: 120,
data: 'note' data: 'note',
}, { },
{
title: '币别', title: '币别',
width: 80, width: 80,
data: 'currency', data: 'currency',
@ -238,40 +275,45 @@
process(currencyDict.value) process(currencyDict.value)
} else { } else {
const results = await GetFeeCurrencySelectList() const results = await GetFeeCurrencySelectList()
const dict = results.data?.map(res => { const dict = results.data?.map((res) => {
return res.codeName return res.codeName
}) })
currencyDict.value = dict currencyDict.value = dict
process(dict) process(dict)
} }
} },
}, { },
{
title: '销项税率', title: '销项税率',
width: 100, width: 100,
data: 'accTaxRate', data: 'accTaxRate',
type: 'numeric' type: 'numeric',
}, { },
{
title: '是否机密', title: '是否机密',
width: 100, width: 100,
data: 'isOpen', data: 'isOpen',
type: 'checkbox' type: 'checkbox',
}, { },
{
title: '是否垫付', title: '是否垫付',
width: 100, width: 100,
data: 'isAdvancedPay', data: 'isAdvancedPay',
type: 'checkbox' type: 'checkbox',
}, { },
{
title: '是否禁开发票', title: '是否禁开发票',
width: 120, width: 120,
data: 'isInvoice', data: 'isInvoice',
type: 'checkbox' type: 'checkbox',
}, { },
{
title: 'FRT', title: 'FRT',
width: 120, width: 120,
data: 'feeFrt', data: 'feeFrt',
type: 'dropdown', type: 'dropdown',
source: ['PP', 'CC'] source: ['PP', 'CC'],
} },
] ]
// //
const settings = { const settings = {
@ -285,7 +327,7 @@
// //
hiddenColumns: { hiddenColumns: {
columns: [1], columns: [1],
indicators: true indicators: true,
}, },
columnSorting: true, columnSorting: true,
// //
@ -308,11 +350,11 @@
// //
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') { if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict = {} let dict = {}
changes.forEach(res => { changes.forEach((res) => {
// //
if (res[1] === 'feeName') { if (res[1] === 'feeName') {
// //
const item = feeDict.value.filter(item => { const item = feeDict.value.filter((item) => {
return item.name === changes[0][3] return item.name === changes[0][3]
}) })
if (item) dict = item[0] if (item) dict = item[0]
@ -332,12 +374,11 @@
}) })
// //
if (changes[0][1] === 'feeEnName') { if (changes[0][1] === 'feeEnName') {
} }
// //
if (changes[0][1] === 'customerTypeText') { if (changes[0][1] === 'customerTypeText') {
getDictOption('djy_cust_prop').then(res => { getDictOption('djy_cust_prop').then((res) => {
const item = res.filter(item => { const item = res.filter((item) => {
return item.name === changes[0][3] return item.name === changes[0][3]
}) })
if (item) dict = item[0] if (item) dict = item[0]
@ -346,7 +387,7 @@
} }
// //
if (changes[0][1] === 'unitText') { if (changes[0][1] === 'unitText') {
const item = unitDict.value.filter(item => { const item = unitDict.value.filter((item) => {
return item.name === changes[0][3] return item.name === changes[0][3]
}) })
if (item) dict = item[0] if (item) dict = item[0]
@ -354,7 +395,7 @@
} }
// //
if (changes[0][1] === 'currencyName') { if (changes[0][1] === 'currencyName') {
const item = currencyDict.value.filter(item => { const item = currencyDict.value.filter((item) => {
return item.name === changes[0][3] return item.name === changes[0][3]
}) })
if (item) dict = item[0] if (item) dict = item[0]
@ -365,20 +406,24 @@
// //
if (changes[0][1] === 'noTaxPrice') { if (changes[0][1] === 'noTaxPrice') {
// //
list.value[index].unitPrice = (changes[0][3] || 0) * ((list.value[index].taxRate || 0) / 100 + 1) list.value[index].unitPrice =
(changes[0][3] || 0) * ((list.value[index].taxRate || 0) / 100 + 1)
// //
list.value[index].amount = (list.value[index].unitPrice || 0) * (list.value[index].quantity || 0) list.value[index].amount =
(list.value[index].unitPrice || 0) * (list.value[index].quantity || 0)
// //
list.value[index].noTaxAmount = (changes[0][3] || 0) * (list.value[index].quantity || 0) list.value[index].noTaxAmount = (changes[0][3] || 0) * (list.value[index].quantity || 0)
} }
// //
if (changes[0][1] === 'unitPrice') { if (changes[0][1] === 'unitPrice') {
// //
list.value[index].noTaxPrice = (changes[0][3] || 0) / ((list.value[index].taxRate || 0) / 100 + 1) list.value[index].noTaxPrice =
(changes[0][3] || 0) / ((list.value[index].taxRate || 0) / 100 + 1)
// //
list.value[index].amount = (changes[0][3] || 0) * (list.value[index].quantity || 0) list.value[index].amount = (changes[0][3] || 0) * (list.value[index].quantity || 0)
// //
list.value[index].noTaxAmount = (list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0) list.value[index].noTaxAmount =
(list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0)
} }
// //
if (changes[0][1] === 'quantity') { if (changes[0][1] === 'quantity') {
@ -390,12 +435,14 @@
// //
if (changes[0][1] === 'taxRate') { if (changes[0][1] === 'taxRate') {
// //
list.value[index].noTaxPrice = ((list.value[index].unitPrice || 0) / ((changes[0][3] || 0) / 100 + 1)) list.value[index].noTaxPrice =
(list.value[index].unitPrice || 0) / ((changes[0][3] || 0) / 100 + 1)
// //
list.value[index].noTaxAmount = (list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0) list.value[index].noTaxAmount =
} (list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0)
} }
} }
},
} }
const setTableData = () => { const setTableData = () => {
const data = inject('temFieldData') const data = inject('temFieldData')
@ -405,7 +452,7 @@
} }
} }
defineExpose({ defineExpose({
validate validate,
}) })
onMounted(() => { onMounted(() => {
setTableData() setTableData()
@ -425,10 +472,11 @@
}) })
}) })
watch( watch(
list.value, (val) => { list.value,
(val) => {
let a = 0 let a = 0
let b = 0 let b = 0
val.forEach(item => { val.forEach((item) => {
if (item.selected) { if (item.selected) {
a += 1 a += 1
} else { } else {
@ -446,14 +494,15 @@
} else { } else {
someCheck.value = false someCheck.value = false
} }
}, { },
deep: true {
} deep: true,
},
) )
// //
const deleteRow = async () => { const deleteRow = async () => {
const ids = [] const ids = []
list.value.forEach(item => { list.value.forEach((item) => {
if (item.selected && item.id) ids.push(item.id) if (item.selected && item.id) ids.push(item.id)
}) })
if (ids.length) { if (ids.length) {
@ -462,37 +511,40 @@
loading.value = false loading.value = false
createMessage.success(data.message) createMessage.success(data.message)
} }
const res = list.value.filter(item => { const res = list.value.filter((item) => {
return !item.selected return !item.selected
}) })
list.value = res list.value = res
hotTb.value.hotInstance.loadData(res) hotTb.value.hotInstance.loadData(res)
} }
// idid // idid
watch(() => props.id, async (v) => { watch(
() => props.id,
async (v) => {
const postData = { const postData = {
pageCondition: { pageCondition: {
pageIndex: 1, pageIndex: 1,
pageSize: 1000, pageSize: 1000,
sortConditions: [] sortConditions: [],
}, },
queryCondition: JSON.stringify([ queryCondition: JSON.stringify([
{ FieldName: 'TemplateId', FieldValue: v, ConditionalType: 1 } { FieldName: 'TemplateId', FieldValue: v, ConditionalType: 1 },
]) ]),
} }
const res = await GetFeeTemplateDetailList(postData) const res = await GetFeeTemplateDetailList(postData)
list.value = res.data list.value = res.data
hotTb.value.hotInstance.loadData(res.data) hotTb.value.hotInstance.loadData(res.data)
}) },
)
watchEffect(() => { watchEffect(() => {
// //
if (allCheck.value) { if (allCheck.value) {
list.value.forEach(item => { list.value.forEach((item) => {
item.selected = true item.selected = true
}) })
} else { } else {
// //
list.value.forEach(item => { list.value.forEach((item) => {
item.selected = false item.selected = false
}) })
} }
@ -510,7 +562,7 @@
} }
.ant-select { .ant-select {
width: 100%; width: 100%;
text-align: left text-align: left;
} }
.active-td { .active-td {
border: 1px solid blue; border: 1px solid blue;

@ -15,7 +15,14 @@
<div class="nav"> <i class="iconfont icon-shanchu1"></i><span>删除</span> </div> <div class="nav"> <i class="iconfont icon-shanchu1"></i><span>删除</span> </div>
</div> </div>
<div class="table-box"> <div class="table-box">
<hot-table ref="hotTb" :data="list" :settings="settings"></hot-table> <hot-table ref="hotTb" :data="list" :settings="settings">
<img
v-show="!list.length"
class="hot-tb-no-data"
src="../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
</div> </div>
<!--右下角按钮--> <!--右下角按钮-->
<template #footer> <template #footer>

@ -21,7 +21,14 @@
</a-popconfirm> </a-popconfirm>
</div> </div>
</div> </div>
<hot-table ref="hotTb" :data="list" :settings="settings"></hot-table> <hot-table ref="hotTb" :data="list" :settings="settings">
<img
v-show="!list.length"
class="hot-tb-no-data"
src="../../../../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
<!--右下角按钮--> <!--右下角按钮-->
<template #footer> <template #footer>
<a-button <a-button

@ -21,7 +21,14 @@
</a-popconfirm> </a-popconfirm>
</div> </div>
</div> </div>
<hot-table ref="hotTb" :data="list" :settings="settings"></hot-table> <hot-table ref="hotTb" :data="list" :settings="settings">
<img
v-show="!list.length"
class="hot-tb-no-data"
src="../../../../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
</div> </div>
</div> </div>
</a-spin> </a-spin>

@ -4,7 +4,7 @@
<div> <div>
<div class="flex" v-if="!isLockBooking" style="justify-content: space-between"> <div class="flex" v-if="!isLockBooking" style="justify-content: space-between">
<div> <div>
<a-button type="link" size="mini" v-show="list.length !== 0" @click="openDialog"> <a-button type="link" size="mini" @click="openDialog">
<span class="iconfont icon-liebiao1"></span> <span class="iconfont icon-liebiao1"></span>
多品名 多品名
</a-button> </a-button>
@ -88,7 +88,14 @@
:indeterminate="someCheck" :indeterminate="someCheck"
v-if="list.length !== 0" v-if="list.length !== 0"
/> />
<hot-table ref="hotmain" :data="list" :settings="settings"></hot-table> <hot-table ref="hotmain" :data="list" :settings="settings">
<img
v-show="!list.length"
class="hot-tb-no-data"
src="../../../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
</div> </div>
<div class="table-calc"> <div class="table-calc">
合计 合计
@ -117,7 +124,14 @@
@cancel="handleModelCancel" @cancel="handleModelCancel"
> >
<div class="model-content"> <div class="model-content">
<hot-table ref="hotTb" :data="moreTList" :settings="moreTSettings"></hot-table> <hot-table ref="hotTb" :data="moreTList" :settings="moreTSettings">
<img
v-show="!moreTList.length"
class="hot-tb-no-data"
src="../../../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
<div class="model-botton-box"> <div class="model-botton-box">
<a-button class="btn" type="primary" @click="addChildData"></a-button> <a-button class="btn" type="primary" @click="addChildData"></a-button>
<a-button class="btn btn-delete" @click="removeChildData"></a-button> <a-button class="btn btn-delete" @click="removeChildData"></a-button>
@ -136,7 +150,14 @@
:data="moreData[moreSelectNum]" :data="moreData[moreSelectNum]"
v-if="moreSelectLoad" v-if="moreSelectLoad"
:settings="moreSettings" :settings="moreSettings"
></hot-table> >
<img
v-show="!moreData[moreSelectNum].length"
class="hot-tb-no-data"
src="../../../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
</div> </div>
</a-spin> </a-spin>
</div> </div>
@ -918,6 +939,9 @@
if (nval !== '') { if (nval !== '') {
moreSelectLoad.value = false moreSelectLoad.value = false
let ctnId = moreTList.value[nval].id let ctnId = moreTList.value[nval].id
console.log(ctnId, 'ctnId', nval)
if (ctnId) {
GetOpCtnDetailList({ GetOpCtnDetailList({
queryCondition: JSON.stringify([ queryCondition: JSON.stringify([
{ {
@ -933,11 +957,15 @@
}, },
}).then((res) => { }).then((res) => {
moreData.value[moreSelectNum.value] = res.data moreData.value[moreSelectNum.value] = res.data
// res.data.forEach(e=>{
// })
moreSelectLoad.value = true moreSelectLoad.value = true
}) })
} else {
setTimeout(() => {
console.log(moreData.value, moreSelectNum.value, moreData.value[moreSelectNum.value])
moreData.value[moreSelectNum.value].splice(0)
moreSelectLoad.value = true
}, 100)
}
} }
}) })
@ -1380,202 +1408,206 @@
checkboxOption.value.selectedRowKeys = keys checkboxOption.value.selectedRowKeys = keys
} }
function importYarn() { function importYarn() {
if (!props.details.id) { notification.warning({ message: '功能开发中...', duration: 3 })
notification.error({ message: '请先保存订舱信息', duration: 3 }) // if (!props.details.id) {
return false // notification.error({ message: '', duration: 3 })
// return false
// }
// YarnLoading.value = true
// GetYardData({
// id: props.details.id,
// isWeb: false,
// })
// .then((res) => {
// if (res.succeeded) {
// const data = JSON.parse(res.data)
// console.log(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,
// // ctnall: item.CTNALL,
// // ctnnum: '1',
// // cntrno: item.CNTRNO,
// // sealno: item.SEALNO,
// // ctncode: item.CtnCode,
// // pkgs: item.PKGS,
// // kindpkgs: kindpkgsOld || item.KINDPKGS,
// // kgs: item.KGS,
// // cbm: item.CBM,
// // tareweight: item.TAREWEIGHT,
// // weightype: '',
// // weighkgs: '',
// // weighdate: item.WEIGHDATE,
// // }
// // addTable.push(_data)
// // })
// // tableData.value = [...tableData.value, ...addTable]
// // that.$forceUpdate()
// } else {
// notification.error({ message: res.message, duration: 3 })
// }
// YarnLoading.value = false
// })
// .catch((err) => {
// YarnLoading.value = false
// })
} }
YarnLoading.value = true function importsealno() {
GetYardData({ notification.warning({ message: '功能开发中...', duration: 3 })
id: props.details.id, // sealnoLoading.value = true
isWeb: false, // GetYardData({
}) // id: props.details.id,
.then((res) => { // isWeb: false,
if (res.succeeded) { // })
const data = JSON.parse(res.data) // .then((res) => {
console.log(data) // if (res.succeeded) {
// let type = true
// tableData.value.forEach((item) => {
// if (item.sealno || item.cntrno) {
// notification.error({ message: '', duration: 3 })
// type = false
// }
// })
// if (type) {
// const data = JSON.parse(res.data)
// if (data.length == tableData.value.length) {
// data.forEach((item, index) => {
// tableData.value[index].sealno = item.SEALNO
// tableData.value[index].cntrno = item.CNTRNO
// tableData.value[index].ctnnum = 1
// })
// 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)
// } else {
// notification.error({ message: '', duration: 3 })
// }
// }
// } else {
// notification.error({ message: res.message, duration: 3 })
// }
// sealnoLoading.value = false
// })
// .catch((err) => {
// sealnoLoading.value = false
// })
}
function importWeight() {
notification.warning({ message: '功能开发中...', duration: 3 })
// if (!props.details.id) {
// notification.error({ message: '', duration: 3 })
// return false
// }
// WeightLoading.value = true
// GetYardData({
// id: props.details.id,
// isWeb: false,
// })
// .then((res) => {
// if (res.succeeded) {
// const data = JSON.parse(res.data)
// const addTable: any[] = [] // const addTable: any[] = []
// const kindpkgsOld = list.value[0] ? list.value[0].kindPkgs : '' // const cntrnoArr: any[] = []
// list.value = [] // tableData.value.map((item: any, index) => {
// if (!item.cntrno) {
// // delete tableData.value[index]
// tableData.value.splice(index, 1)
// } else {
// cntrnoArr.push(item.cntrno)
// }
// })
// for (let i = tableData.value.length - 1; i >= 0; i--) {
// if (!tableData.value[i].cntrno) {
// tableData.value.splice(i, 1)
// } else {
// cntrnoArr.push(tableData.value[i].cntrno)
// }
// }
// const lastNum = // const lastNum =
// list.value.length > 0 ? Number(list.value[list.value.length - 1].rowKey) + 1 : 0 // tableData.value.length > 0
// ? Number(tableData.value[tableData.value.length - 1].rowKey) + 1
// : 0
// data.map((item, index) => { // data.map((item, index) => {
// if (cntrnoArr.includes(item.CNTRNO)) {
// const setWeighkgs = calc(
// Number(tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kgs),
// Number(item.TAREWEIGHT),
// '+',
// )
// tableData.value[cntrnoArr.indexOf(item.CNTRNO)] = {
// rowKey: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].rowKey,
// ctnall: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].ctnall,
// ctnnum: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].ctnnum,
// cntrno: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].cntrno,
// sealno: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].sealno,
// pkgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].pkgs,
// kindpkgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kindpkgs,
// kgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kgs,
// cbm: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].cbm,
// tareweight: item.TAREWEIGHT,
// weightype: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].weightype,
// weighkgs: setWeighkgs,
// weighdate: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].weighdate,
// }
// } else {
// const _data = { // const _data = {
// rowKey: lastNum + index, // rowKey: lastNum + index,
// ctnall: item.CTNALL, // ctnall: '',
// ctnnum: '1', // ctnnum: '1',
// cntrno: item.CNTRNO, // cntrno: '',
// sealno: item.SEALNO, // sealno: '',
// ctncode: item.CtnCode, // pkgs: '',
// pkgs: item.PKGS, // kindpkgs: '',
// kindpkgs: kindpkgsOld || item.KINDPKGS, // kgs: '',
// kgs: item.KGS, // cbm: '',
// cbm: item.CBM,
// tareweight: item.TAREWEIGHT, // tareweight: item.TAREWEIGHT,
// weightype: '', // weightype: '',
// weighkgs: '', // weighkgs: '',
// weighdate: item.WEIGHDATE, // weighdate: '',
// } // }
// addTable.push(_data) // addTable.push(_data)
// }
// }) // })
// tableData.value = [...tableData.value, ...addTable] // tableData.value = [...tableData.value, ...addTable]
// that.$forceUpdate() // that.$forceUpdate()
} else { // } else {
notification.error({ message: res.message, duration: 3 }) // notification.error({ message: res.message, duration: 3 })
} // }
YarnLoading.value = false // WeightLoading.value = false
}) // })
.catch((err) => { // .catch((err) => {
YarnLoading.value = false // WeightLoading.value = false
}) // })
}
function importsealno() {
sealnoLoading.value = true
GetYardData({
id: props.details.id,
isWeb: false,
})
.then((res) => {
if (res.succeeded) {
let type = true
tableData.value.forEach((item) => {
if (item.sealno || item.cntrno) {
notification.error({ message: '请清空所有箱封号后再引入', duration: 3 })
type = false
}
})
if (type) {
const data = JSON.parse(res.data)
if (data.length == tableData.value.length) {
data.forEach((item, index) => {
tableData.value[index].sealno = item.SEALNO
tableData.value[index].cntrno = item.CNTRNO
tableData.value[index].ctnnum = 1
})
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)
} else {
notification.error({ message: '箱量与场站不一致', duration: 3 })
}
}
} else {
notification.error({ message: res.message, duration: 3 })
}
sealnoLoading.value = false
})
.catch((err) => {
sealnoLoading.value = false
})
} }
function changeEmit1(arr) { function changeEmit1(arr) {
emit('changectnall', arr) emit('changectnall', arr)
} }
function importWeight() {
if (!props.details.id) {
notification.error({ message: '请先保存订舱信息', duration: 3 })
return false
}
WeightLoading.value = true
GetYardData({
id: props.details.id,
isWeb: false,
})
.then((res) => {
if (res.succeeded) {
const data = JSON.parse(res.data)
const addTable: any[] = []
const cntrnoArr: any[] = []
tableData.value.map((item: any, index) => {
if (!item.cntrno) {
// delete tableData.value[index]
tableData.value.splice(index, 1)
} else {
cntrnoArr.push(item.cntrno)
}
})
for (let i = tableData.value.length - 1; i >= 0; i--) {
if (!tableData.value[i].cntrno) {
tableData.value.splice(i, 1)
} else {
cntrnoArr.push(tableData.value[i].cntrno)
}
}
const lastNum =
tableData.value.length > 0
? Number(tableData.value[tableData.value.length - 1].rowKey) + 1
: 0
data.map((item, index) => {
if (cntrnoArr.includes(item.CNTRNO)) {
const setWeighkgs = calc(
Number(tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kgs),
Number(item.TAREWEIGHT),
'+',
)
tableData.value[cntrnoArr.indexOf(item.CNTRNO)] = {
rowKey: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].rowKey,
ctnall: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].ctnall,
ctnnum: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].ctnnum,
cntrno: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].cntrno,
sealno: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].sealno,
pkgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].pkgs,
kindpkgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kindpkgs,
kgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kgs,
cbm: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].cbm,
tareweight: item.TAREWEIGHT,
weightype: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].weightype,
weighkgs: setWeighkgs,
weighdate: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].weighdate,
}
} else {
const _data = {
rowKey: lastNum + index,
ctnall: '',
ctnnum: '1',
cntrno: '',
sealno: '',
pkgs: '',
kindpkgs: '',
kgs: '',
cbm: '',
tareweight: item.TAREWEIGHT,
weightype: '',
weighkgs: '',
weighdate: '',
}
addTable.push(_data)
}
})
tableData.value = [...tableData.value, ...addTable]
that.$forceUpdate()
} else {
notification.error({ message: res.message, duration: 3 })
}
WeightLoading.value = false
})
.catch((err) => {
WeightLoading.value = false
})
}
function calc(num1, num2, calcStr) { function calc(num1, num2, calcStr) {
var str1 // var str1 //
var str2 var str2

@ -944,7 +944,14 @@
</div> </div>
<!-- v-if="preOrderLoad" --> <!-- v-if="preOrderLoad" -->
<div class="table-box"> <div class="table-box">
<hot-table ref="hotTb" :data="list" :settings="settings"></hot-table> <hot-table ref="hotTb" :data="list" :settings="settings">
<img
v-show="!list.length"
class="hot-tb-no-data"
src="../../../../../assets/images/nodata.png"
alt=""
/>
</hot-table>
</div> </div>
</div> </div>
</a-col> </a-col>

Loading…
Cancel
Save