|
|
|
@ -5,35 +5,160 @@
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="ds-sea-lading-info">
|
|
|
|
|
<!-- 按钮操作栏 -->
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<!-- 提单信息表 -->
|
|
|
|
|
<BasicTable
|
|
|
|
|
class="ds-table-detail"
|
|
|
|
|
style="width: 370px"
|
|
|
|
|
:canRowSelect="true"
|
|
|
|
|
:row-selection="{ selectedRowKeys: state.rowKeys, onChange: selectiChange }"
|
|
|
|
|
rowKey="id"
|
|
|
|
|
@register="registerTable"
|
|
|
|
|
@row-click="onRowClick"
|
|
|
|
|
></BasicTable>
|
|
|
|
|
<!-- 提单信息详情 -->
|
|
|
|
|
<a-tabs v-model:activeKey="activeKey" class="ds-sea-child-tab">
|
|
|
|
|
<a-tab-pane key="1" tab="提单信息" size="small">
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<!-- 收发通表单 -->
|
|
|
|
|
<BasicForm style="flex: 1;" @register="registerForm" />
|
|
|
|
|
<!-- 集装箱组件 -->
|
|
|
|
|
<container
|
|
|
|
|
class="ml15"
|
|
|
|
|
style="width: 700px;"
|
|
|
|
|
></container>
|
|
|
|
|
</div>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
<a-tab-pane key="2" tab="其他信息" size="small">
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
<a-spin :spinning="loading">
|
|
|
|
|
<!-- 按钮操作栏 -->
|
|
|
|
|
<div class="btn-box flex">
|
|
|
|
|
<div>
|
|
|
|
|
<a-button type="link" @click="msg">
|
|
|
|
|
<span class="iconfont icon-a-17Btuichu"></span>
|
|
|
|
|
调入主单信息
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="link" @click="msg">
|
|
|
|
|
<span class="iconfont icon-time"></span>
|
|
|
|
|
历史引入
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="link" @click="msg">
|
|
|
|
|
<span class="iconfont icon-touzijilu"></span>
|
|
|
|
|
合票出单
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="link" @click="msg">
|
|
|
|
|
<span class="iconfont icon-a-17Btuichu"></span>
|
|
|
|
|
EDI报文导出
|
|
|
|
|
<span class="iconfont icon-30jiantouxiangxiafill"></span>
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<a-button type="link" @click="create">
|
|
|
|
|
<span class="iconfont icon-icon_tianjia"></span>
|
|
|
|
|
新建
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="link" @click="save">
|
|
|
|
|
<span class="iconfont icon-a-17Btuichu"></span>
|
|
|
|
|
保存
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
:visible="deleteFlag"
|
|
|
|
|
title="确定要删除勾选的数据?"
|
|
|
|
|
ok-text="确定"
|
|
|
|
|
cancel-text="取消"
|
|
|
|
|
@confirm="deleteRow"
|
|
|
|
|
@cancel="cancelDelete"
|
|
|
|
|
@click="checkDelete"
|
|
|
|
|
>
|
|
|
|
|
<a-button type="link" >
|
|
|
|
|
<span class="iconfont icon-shanchu1"></span>
|
|
|
|
|
删除
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<!-- 提单信息表 -->
|
|
|
|
|
<BasicTable
|
|
|
|
|
class="ds-table-detail"
|
|
|
|
|
style="width: 370px"
|
|
|
|
|
:canRowSelect="true"
|
|
|
|
|
:row-selection="{ selectedRowKeys: state.rowKeys, onChange: selectiChange }"
|
|
|
|
|
rowKey="id"
|
|
|
|
|
@register="registerTable"
|
|
|
|
|
@row-click="onRowClick"
|
|
|
|
|
></BasicTable>
|
|
|
|
|
<!-- 提单信息详情 -->
|
|
|
|
|
<a-tabs v-model:activeKey="activeKey" class="ds-sea-child-tab">
|
|
|
|
|
<a-tab-pane key="1" tab="提单信息" size="small">
|
|
|
|
|
<div class="flex card-box">
|
|
|
|
|
<!-- 收发通表单 -->
|
|
|
|
|
<BasicForm style="flex: 1;" @register="registerForm" />
|
|
|
|
|
<!-- 集装箱组件 -->
|
|
|
|
|
<div style="width: 650px;">
|
|
|
|
|
<!-- 集装箱表单 -->
|
|
|
|
|
<BasicForm style="margin-bottom: 0;" @register="containerForm" />
|
|
|
|
|
<container
|
|
|
|
|
ref="contBox"
|
|
|
|
|
class="ml15"
|
|
|
|
|
:id="id"
|
|
|
|
|
></container>
|
|
|
|
|
<a-form
|
|
|
|
|
v-model="formData"
|
|
|
|
|
class="ant-form-small"
|
|
|
|
|
layout="vertical"
|
|
|
|
|
>
|
|
|
|
|
<a-row :gutter="15">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="代理">
|
|
|
|
|
<a-select
|
|
|
|
|
v-model:value="formData.agentId"
|
|
|
|
|
width="300px"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
>
|
|
|
|
|
<a-select-option v-for="item in getOptions('agentcn')" :key="item.id" :value="item.id">
|
|
|
|
|
{{ item.shortName }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="18">
|
|
|
|
|
<a-form-item label="AGENT">
|
|
|
|
|
<a-input style="height: 26px" v-model:value="formData.agentContent" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-box mt15" style="border-top: 1px solid #E8EBED;">
|
|
|
|
|
<!-- ETD表单 -->
|
|
|
|
|
<BasicForm style="margin-top: 8px;" @register="ETDForm" />
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="7">
|
|
|
|
|
<a-form
|
|
|
|
|
v-model="formData"
|
|
|
|
|
class="ant-form-small cntrSealNo"
|
|
|
|
|
style="margin-top: -15px ;"
|
|
|
|
|
layout="vertical"
|
|
|
|
|
>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<a-form-item label="箱号封号">
|
|
|
|
|
<a-textarea v-model:value="formData.cntrSealNo" :autoSize="{ minRows: 10, maxRows: 10 }" placeholder="请输入" allow-clear />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" style="margin-top: 26px;">
|
|
|
|
|
<a-form-item label="唛头">
|
|
|
|
|
<a-textarea v-model:value="formData.marks" :autoSize="{ minRows: 9, maxRows: 9 }" placeholder="请输入" allow-clear />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="10">
|
|
|
|
|
<a-form
|
|
|
|
|
v-model="formData"
|
|
|
|
|
class="ant-form-small"
|
|
|
|
|
style="margin: -15px -12px 0 15px"
|
|
|
|
|
layout="vertical"
|
|
|
|
|
>
|
|
|
|
|
<a-form-item label="货物描述">
|
|
|
|
|
<a-textarea v-model:value="formData.description" :autoSize="{ minRows: 21, maxRows: 21 }" style="height: 409px" placeholder="请输入" allow-clear />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="7">
|
|
|
|
|
<BasicForm
|
|
|
|
|
class="pkg"
|
|
|
|
|
style="margin: -15px -12px 0 27px;"
|
|
|
|
|
@register="CountForm"
|
|
|
|
|
@submit="submit"
|
|
|
|
|
/>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<!-- 签单方式表单 -->
|
|
|
|
|
<BasicForm style="margin-top: -10px;" class="issue-form" @register="issueForm" />
|
|
|
|
|
</div>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
<a-tab-pane key="2" tab="其他信息" size="small">
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
</a-spin>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
@ -41,12 +166,20 @@
|
|
|
|
|
import { BasicTable, useTable } from '/@/components/Table'
|
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form/index'
|
|
|
|
|
import { GetSeaExportBillManageList } from '../../api/BookingLedger'
|
|
|
|
|
import { formSchema1 } from './ladingInfo'
|
|
|
|
|
import { formSchema1, formSchema2, formSchema3, formSchema4, formSchema5 } from './ladingInfo'
|
|
|
|
|
import { getOptions } from '/@/hooks/dict'
|
|
|
|
|
import container from './container.vue'
|
|
|
|
|
import { EditSeaExportBillManage, BatchDelBillManageCtn } from '../../api/BookingLedger'
|
|
|
|
|
// 引入提示信息
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
// 业务id
|
|
|
|
|
id: {
|
|
|
|
|
type: String
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 详情信息
|
|
|
|
|
details: { type: Object, default: {} }
|
|
|
|
|
})
|
|
|
|
|
const activeKey = ref('1')
|
|
|
|
|
// 信息已选项
|
|
|
|
@ -54,30 +187,109 @@
|
|
|
|
|
rowKeys: []
|
|
|
|
|
})
|
|
|
|
|
const selectiChange = (v) => {
|
|
|
|
|
if (v.length = 1) {
|
|
|
|
|
state.rowKeys = v
|
|
|
|
|
} else {
|
|
|
|
|
state.rowKeys = [v[v.length - 1]]
|
|
|
|
|
state.rowKeys = v
|
|
|
|
|
if (v.length == 0) {
|
|
|
|
|
resetFields1()
|
|
|
|
|
resetFields2()
|
|
|
|
|
resetFields3()
|
|
|
|
|
resetFields4()
|
|
|
|
|
resetFields5()
|
|
|
|
|
formData.agentId = ''
|
|
|
|
|
formData.agentContent = ''
|
|
|
|
|
formData.cntrSealNo = ''
|
|
|
|
|
formData.description = ''
|
|
|
|
|
formData.marks = ''
|
|
|
|
|
}
|
|
|
|
|
setFormValue()
|
|
|
|
|
}
|
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] =
|
|
|
|
|
// 提单信息第一个表单
|
|
|
|
|
const [registerForm, { setFieldsValue: setFieldsValue1, validate: validate1, resetFields: resetFields1 }] =
|
|
|
|
|
useForm({
|
|
|
|
|
labelWidth: 150,
|
|
|
|
|
schemas: formSchema1,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
// 提单信息第二个表单
|
|
|
|
|
const [ETDForm, { setFieldsValue: setFieldsValue2, validate: validate2, resetFields: resetFields2 }] =
|
|
|
|
|
useForm({
|
|
|
|
|
labelWidth: 150,
|
|
|
|
|
schemas: formSchema2,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
// 箱数或件数表单
|
|
|
|
|
const [CountForm, { setFieldsValue: setFieldsValue3, validate: validate3, resetFields: resetFields3 }] =
|
|
|
|
|
useForm({
|
|
|
|
|
labelWidth: 150,
|
|
|
|
|
schemas: formSchema3,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
// 签单方式表单
|
|
|
|
|
const [issueForm, { setFieldsValue: setFieldsValue4, validate: validate4, resetFields: resetFields4 }] =
|
|
|
|
|
useForm({
|
|
|
|
|
labelWidth: 150,
|
|
|
|
|
schemas: formSchema4,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
// 集装箱上面的表单
|
|
|
|
|
const [containerForm, { setFieldsValue: setFieldsValue5, validate: validate5, resetFields: resetFields5 }] =
|
|
|
|
|
useForm({
|
|
|
|
|
labelWidth: 150,
|
|
|
|
|
schemas: formSchema5,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
// 行点击事件
|
|
|
|
|
const onRowClick = (record) => {
|
|
|
|
|
// 更新选中状态
|
|
|
|
|
const newSelectedRowKeys = [...state.rowKeys];
|
|
|
|
|
if (newSelectedRowKeys.includes(record.id)) {
|
|
|
|
|
newSelectedRowKeys.splice(newSelectedRowKeys.indexOf(record.id), 1);
|
|
|
|
|
} else {
|
|
|
|
|
newSelectedRowKeys.push(record.id);
|
|
|
|
|
state.rowKeys = [record?.id]
|
|
|
|
|
setSelectedRows([record])
|
|
|
|
|
setFormValue()
|
|
|
|
|
}
|
|
|
|
|
// 删除
|
|
|
|
|
const deleteFlag = ref(false)
|
|
|
|
|
// 校验是否选中行
|
|
|
|
|
const checkDelete = () => {
|
|
|
|
|
if (state.rowKeys.length == 0) {
|
|
|
|
|
return createMessage.warning('请勾选要删除的数据!')
|
|
|
|
|
}
|
|
|
|
|
state.rowKeys = newSelectedRowKeys
|
|
|
|
|
deleteFlag.value = true
|
|
|
|
|
}
|
|
|
|
|
// 删除选中行
|
|
|
|
|
const deleteRow = () => {
|
|
|
|
|
loading.value = true
|
|
|
|
|
deleteFlag.value = false
|
|
|
|
|
BatchDelBillManageCtn({ id: props.id, ids: state.rowKeys }).then(res => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
reload()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 取消删除
|
|
|
|
|
const cancelDelete = () => {
|
|
|
|
|
deleteFlag.value = false
|
|
|
|
|
}
|
|
|
|
|
// 设置表单的值
|
|
|
|
|
const setFormValue = () => {
|
|
|
|
|
const row = getSelectRows()[0]
|
|
|
|
|
setFieldsValue1({
|
|
|
|
|
...row
|
|
|
|
|
})
|
|
|
|
|
setFieldsValue2({
|
|
|
|
|
...row
|
|
|
|
|
})
|
|
|
|
|
setFieldsValue3({
|
|
|
|
|
...row
|
|
|
|
|
})
|
|
|
|
|
setFieldsValue4({
|
|
|
|
|
...row
|
|
|
|
|
})
|
|
|
|
|
setFieldsValue5({
|
|
|
|
|
...row
|
|
|
|
|
})
|
|
|
|
|
formData.agentId = row.agentId
|
|
|
|
|
formData.agentContent = row.agentContent
|
|
|
|
|
formData.cntrSealNo = row.cntrSealNo
|
|
|
|
|
formData.description = row.description
|
|
|
|
|
formData.marks = row.marks
|
|
|
|
|
}
|
|
|
|
|
const [registerTable, { reload }] = useTable({
|
|
|
|
|
const [registerTable, { reload, getSelectRows, setSelectedRows }] = useTable({
|
|
|
|
|
api: async (p) => {
|
|
|
|
|
const res: API.DataResult = await GetSeaExportBillManageList(p)
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
@ -85,7 +297,6 @@
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
beforeFetch: (p) => {
|
|
|
|
|
console.log(p)
|
|
|
|
|
const postParam: API.PageRequest = {
|
|
|
|
|
pageCondition: {
|
|
|
|
|
pageIndex: p.page,
|
|
|
|
@ -105,28 +316,10 @@
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: '分提单号',
|
|
|
|
|
dataIndex: 'customerName',
|
|
|
|
|
dataIndex: 'hblno',
|
|
|
|
|
width: 90,
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '提单模版',
|
|
|
|
|
dataIndex: 'customerName',
|
|
|
|
|
width: 70,
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '提单类型',
|
|
|
|
|
dataIndex: 'customerName',
|
|
|
|
|
width: 70,
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '提单签',
|
|
|
|
|
dataIndex: 'customerName',
|
|
|
|
|
width: 70,
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
isTreeTable: false,
|
|
|
|
|
pagination: true,
|
|
|
|
@ -137,15 +330,391 @@
|
|
|
|
|
showIndexColumn: false,
|
|
|
|
|
canResize: false
|
|
|
|
|
})
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
// 代理表单
|
|
|
|
|
const formData = reactive({
|
|
|
|
|
agentId: '',
|
|
|
|
|
agentContent: '',
|
|
|
|
|
cntrSealNo: '',
|
|
|
|
|
description: '',
|
|
|
|
|
marks: ''
|
|
|
|
|
})
|
|
|
|
|
async function submit() {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
let data = getFieldsValue3()
|
|
|
|
|
let SS = data.pkgs
|
|
|
|
|
if (SS) {
|
|
|
|
|
let GetStringNum = (str) => {
|
|
|
|
|
var num = 0
|
|
|
|
|
if (str == null || str == '') return num
|
|
|
|
|
if (str.length == 0) return num
|
|
|
|
|
var if_find = false
|
|
|
|
|
var str_num = ''
|
|
|
|
|
for (var i = 0; i < str.length; i += 1) {
|
|
|
|
|
var member = str.substr(i, 1)
|
|
|
|
|
if (
|
|
|
|
|
member == '0' ||
|
|
|
|
|
member == '1' ||
|
|
|
|
|
member == '2' ||
|
|
|
|
|
member == '3' ||
|
|
|
|
|
member == '4' ||
|
|
|
|
|
member == '5' ||
|
|
|
|
|
member == '6' ||
|
|
|
|
|
member == '7' ||
|
|
|
|
|
member == '8' ||
|
|
|
|
|
member == '9' ||
|
|
|
|
|
member == '.' ||
|
|
|
|
|
member == '-'
|
|
|
|
|
) {
|
|
|
|
|
if (!if_find) {
|
|
|
|
|
str_num = str_num + member
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if_find = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return str_num
|
|
|
|
|
}
|
|
|
|
|
let ToEn = (a) => {
|
|
|
|
|
// eslint-disable-next-line no-array-constructor
|
|
|
|
|
const arr1 = new Array('', ' thousand', ' million', ' billion')
|
|
|
|
|
const b = a.length
|
|
|
|
|
let f: any = null
|
|
|
|
|
let h = 0
|
|
|
|
|
let g = ''
|
|
|
|
|
const e = Math.ceil(b / 3)
|
|
|
|
|
const k = b - e * 3
|
|
|
|
|
g = ''
|
|
|
|
|
for (f = k; f < b; f += 3) {
|
|
|
|
|
++h
|
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
|
const num3 = f >= 0 ? a.substring(f, f + 3) : a.substring(0, k + 3)
|
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
|
const strEng = English(num3)
|
|
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
|
|
if (strEng != '') {
|
|
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
|
|
if (g != '') g += ' '
|
|
|
|
|
g += English(num3) + arr1[e - h]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return g
|
|
|
|
|
}
|
|
|
|
|
let English = (a) => {
|
|
|
|
|
// eslint-disable-next-line no-array-constructor
|
|
|
|
|
var arr2 = new Array(
|
|
|
|
|
'zero',
|
|
|
|
|
'ten',
|
|
|
|
|
'twenty',
|
|
|
|
|
'thirty',
|
|
|
|
|
'forty',
|
|
|
|
|
'fifty',
|
|
|
|
|
'sixty',
|
|
|
|
|
'seventy',
|
|
|
|
|
'eighty',
|
|
|
|
|
'ninety',
|
|
|
|
|
)
|
|
|
|
|
// eslint-disable-next-line no-array-constructor
|
|
|
|
|
var arr3 = new Array(
|
|
|
|
|
'zero',
|
|
|
|
|
'one',
|
|
|
|
|
'two',
|
|
|
|
|
'three',
|
|
|
|
|
'four',
|
|
|
|
|
'five',
|
|
|
|
|
'six',
|
|
|
|
|
'seven',
|
|
|
|
|
'eight',
|
|
|
|
|
'nine',
|
|
|
|
|
)
|
|
|
|
|
// eslint-disable-next-line no-array-constructor
|
|
|
|
|
var arr4 = new Array(
|
|
|
|
|
'ten',
|
|
|
|
|
'eleven',
|
|
|
|
|
'twelve',
|
|
|
|
|
'thirteen',
|
|
|
|
|
'fourteen',
|
|
|
|
|
'fifteen',
|
|
|
|
|
'sixteen',
|
|
|
|
|
'seventeen',
|
|
|
|
|
'eighteen',
|
|
|
|
|
'nineteen',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
let strRet = ''
|
|
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
|
|
if (a.length == 3 && a.substr(0, 3) != '000') {
|
|
|
|
|
if (a.substr(0, 1) != '0') {
|
|
|
|
|
strRet += arr3[a.substr(0, 1)] + ' hundred'
|
|
|
|
|
if (a.substr(1, 2) != '00') strRet += ' and '
|
|
|
|
|
} else {
|
|
|
|
|
strRet += ' and '
|
|
|
|
|
}
|
|
|
|
|
a = a.substring(1)
|
|
|
|
|
}
|
|
|
|
|
if (a.length == 2) {
|
|
|
|
|
if (a.substr(0, 1) == '0') a = a.substring(1)
|
|
|
|
|
else if (a.substr(0, 1) == '1') strRet += arr4[a.substr(1, 2)]
|
|
|
|
|
else {
|
|
|
|
|
strRet += arr2[a.substr(0, 1)]
|
|
|
|
|
if (a.substr(1, 1) != '0') strRet += '-'
|
|
|
|
|
a = a.substring(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (a.length == 1 && a.substr(0, 1) != '0') strRet += arr3[a.substr(0, 1)]
|
|
|
|
|
return strRet
|
|
|
|
|
}
|
|
|
|
|
SS = SS.toString()
|
|
|
|
|
const i = SS.indexOf('\n')
|
|
|
|
|
let num = 0
|
|
|
|
|
let strKind: any = ''
|
|
|
|
|
let enCapital = ''
|
|
|
|
|
if (i > 0) {
|
|
|
|
|
const slist = SS.split('\n')
|
|
|
|
|
for (let i = 0; i < slist.length; i += 1) {
|
|
|
|
|
const member = slist[i]
|
|
|
|
|
const strNum: any = GetStringNum(member)
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
strKind = member.substring(strNum.length)
|
|
|
|
|
}
|
|
|
|
|
num = parseFloat(num).add(parseFloat(strNum))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (strKind !== '') {
|
|
|
|
|
enCapital = strKind
|
|
|
|
|
} else {
|
|
|
|
|
strKind = data.kindPkgsName ? data.kindPkgsName : ''
|
|
|
|
|
enCapital = ToEn(num).toUpperCase() + ' ' + strKind + ' ONLY.'
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
const strNum: any = GetStringNum(SS)
|
|
|
|
|
strKind = SS.substring(strNum.length) ? SS.substring(strNum.length) : ''
|
|
|
|
|
if (strKind !== '') {
|
|
|
|
|
enCapital = strKind
|
|
|
|
|
} else {
|
|
|
|
|
strKind = data.kindPkgsName ? data.kindPkgsName : ''
|
|
|
|
|
enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
setFieldsValue4({ totalNo: enCapital })
|
|
|
|
|
} else {
|
|
|
|
|
setFieldsValue4({ totalNo: '' })
|
|
|
|
|
}
|
|
|
|
|
}, 0)
|
|
|
|
|
}
|
|
|
|
|
function ToEn(a) {
|
|
|
|
|
// eslint-disable-next-line no-array-constructor
|
|
|
|
|
const arr1 = new Array('', ' thousand', ' million', ' billion')
|
|
|
|
|
const b = a.length
|
|
|
|
|
let f: any = null
|
|
|
|
|
let h = 0
|
|
|
|
|
let g = ''
|
|
|
|
|
const e = Math.ceil(b / 3)
|
|
|
|
|
const k = b - e * 3
|
|
|
|
|
g = ''
|
|
|
|
|
for (f = k; f < b; f += 3) {
|
|
|
|
|
++h
|
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
|
const num3 = f >= 0 ? a.substring(f, f + 3) : a.substring(0, k + 3)
|
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
|
const strEng = English(num3)
|
|
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
|
|
if (strEng != '') {
|
|
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
|
|
if (g != '') g += ' '
|
|
|
|
|
g += English(num3) + arr1[e - h]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return g
|
|
|
|
|
}
|
|
|
|
|
function English(a) {
|
|
|
|
|
// eslint-disable-next-line no-array-constructor
|
|
|
|
|
var arr2 = new Array(
|
|
|
|
|
'zero',
|
|
|
|
|
'ten',
|
|
|
|
|
'twenty',
|
|
|
|
|
'thirty',
|
|
|
|
|
'forty',
|
|
|
|
|
'fifty',
|
|
|
|
|
'sixty',
|
|
|
|
|
'seventy',
|
|
|
|
|
'eighty',
|
|
|
|
|
'ninety',
|
|
|
|
|
)
|
|
|
|
|
// eslint-disable-next-line no-array-constructor
|
|
|
|
|
var arr3 = new Array(
|
|
|
|
|
'zero',
|
|
|
|
|
'one',
|
|
|
|
|
'two',
|
|
|
|
|
'three',
|
|
|
|
|
'four',
|
|
|
|
|
'five',
|
|
|
|
|
'six',
|
|
|
|
|
'seven',
|
|
|
|
|
'eight',
|
|
|
|
|
'nine',
|
|
|
|
|
)
|
|
|
|
|
// eslint-disable-next-line no-array-constructor
|
|
|
|
|
var arr4 = new Array(
|
|
|
|
|
'ten',
|
|
|
|
|
'eleven',
|
|
|
|
|
'twelve',
|
|
|
|
|
'thirteen',
|
|
|
|
|
'fourteen',
|
|
|
|
|
'fifteen',
|
|
|
|
|
'sixteen',
|
|
|
|
|
'seventeen',
|
|
|
|
|
'eighteen',
|
|
|
|
|
'nineteen',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
let strRet = ''
|
|
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
|
|
if (a.length == 3 && a.substr(0, 3) != '000') {
|
|
|
|
|
if (a.substr(0, 1) != '0') {
|
|
|
|
|
strRet += arr3[a.substr(0, 1)] + ' hundred'
|
|
|
|
|
if (a.substr(1, 2) != '00') strRet += ' and '
|
|
|
|
|
} else {
|
|
|
|
|
strRet += ' and '
|
|
|
|
|
}
|
|
|
|
|
a = a.substring(1)
|
|
|
|
|
}
|
|
|
|
|
if (a.length == 2) {
|
|
|
|
|
if (a.substr(0, 1) == '0') a = a.substring(1)
|
|
|
|
|
else if (a.substr(0, 1) == '1') strRet += arr4[a.substr(1, 2)]
|
|
|
|
|
else {
|
|
|
|
|
strRet += arr2[a.substr(0, 1)]
|
|
|
|
|
if (a.substr(1, 1) != '0') strRet += '-'
|
|
|
|
|
a = a.substring(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (a.length == 1 && a.substr(0, 1) != '0') strRet += arr3[a.substr(0, 1)]
|
|
|
|
|
return strRet
|
|
|
|
|
}
|
|
|
|
|
function GetStringNum(str) {
|
|
|
|
|
var num = 0
|
|
|
|
|
if (str == null || str == '') return num
|
|
|
|
|
if (str.length == 0) return num
|
|
|
|
|
var if_find = false
|
|
|
|
|
var str_num = ''
|
|
|
|
|
for (var i = 0; i < str.length; i += 1) {
|
|
|
|
|
var member = str.substr(i, 1)
|
|
|
|
|
if (
|
|
|
|
|
member == '0' ||
|
|
|
|
|
member == '1' ||
|
|
|
|
|
member == '2' ||
|
|
|
|
|
member == '3' ||
|
|
|
|
|
member == '4' ||
|
|
|
|
|
member == '5' ||
|
|
|
|
|
member == '6' ||
|
|
|
|
|
member == '7' ||
|
|
|
|
|
member == '8' ||
|
|
|
|
|
member == '9' ||
|
|
|
|
|
member == '.' ||
|
|
|
|
|
member == '-'
|
|
|
|
|
) {
|
|
|
|
|
if (!if_find) {
|
|
|
|
|
str_num = str_num + member
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if_find = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return str_num
|
|
|
|
|
}
|
|
|
|
|
// 集装箱
|
|
|
|
|
const contBox = ref(null)
|
|
|
|
|
// 新建
|
|
|
|
|
const create = () => {
|
|
|
|
|
state.rowKeys = []
|
|
|
|
|
resetFields1()
|
|
|
|
|
resetFields2()
|
|
|
|
|
resetFields3()
|
|
|
|
|
resetFields4()
|
|
|
|
|
resetFields5()
|
|
|
|
|
formData.agentId = ''
|
|
|
|
|
formData.agentContent = ''
|
|
|
|
|
formData.cntrSealNo = ''
|
|
|
|
|
formData.description = ''
|
|
|
|
|
formData.marks = ''
|
|
|
|
|
}
|
|
|
|
|
// 保存
|
|
|
|
|
const save = async() => {
|
|
|
|
|
const form1 = await validate1()
|
|
|
|
|
const form2 = await validate2()
|
|
|
|
|
const form3 = await validate3()
|
|
|
|
|
const form4 = await validate4()
|
|
|
|
|
const form5 = await validate5()
|
|
|
|
|
const postData = Object.assign(form1, form2, form3, form4, form5, formData, { businessId: props.id })
|
|
|
|
|
postData['ctnInfo'] = contBox.value.list
|
|
|
|
|
loading.value = true
|
|
|
|
|
EditSeaExportBillManage(postData).then(res => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
createMessage.success('保存成功!')
|
|
|
|
|
reload()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const msg = () => {
|
|
|
|
|
createMessage.warning('功能开发中...')
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.ds-sea-lading-info {
|
|
|
|
|
padding-right: 20px;
|
|
|
|
|
.ds-sea-child-tab {
|
|
|
|
|
flex: 1;
|
|
|
|
|
margin-left: 16px;
|
|
|
|
|
}
|
|
|
|
|
.ant-form-small {
|
|
|
|
|
margin: 15px 0 15px 15px;
|
|
|
|
|
}
|
|
|
|
|
.card-box {
|
|
|
|
|
padding: 0 20px 0 5px;
|
|
|
|
|
border: 1px solid #E8EBED;
|
|
|
|
|
border-top: none;
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
}
|
|
|
|
|
.ant-col-3 {
|
|
|
|
|
max-width: 14.28%;
|
|
|
|
|
}
|
|
|
|
|
.ant-col-7 {
|
|
|
|
|
max-width: 28.56%;
|
|
|
|
|
.ant-col-24 {
|
|
|
|
|
.ant-form-item-control-input {
|
|
|
|
|
// height: 180px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.ant-col-10 {
|
|
|
|
|
max-width: 42.84%;
|
|
|
|
|
}
|
|
|
|
|
.btn-box {
|
|
|
|
|
margin: 5px -5px;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
.pkg {
|
|
|
|
|
.ant-row>div:nth-child(1), .ant-row>div:nth-child(4), .ant-row>div:nth-child(6) {
|
|
|
|
|
.ant-form-item-control-input-content>div {
|
|
|
|
|
height: 70px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.cntrSealNo {
|
|
|
|
|
.ant-form-item-control-input-content {
|
|
|
|
|
height: 180px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.issue-form {
|
|
|
|
|
.ant-col-12 {
|
|
|
|
|
.ant-form-item-control-input-content {
|
|
|
|
|
height: 65px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.ant-input-disabled {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: -1px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|