数据存储优化

szh-new
lijingjia 5 months ago
commit c550d114b1

@ -75,13 +75,13 @@
type: Array,
default: () => {
return []
}
},
},
// ID
id: {
type: String,
default: ''
}
default: '',
},
})
const emits = defineEmits(['broInsert'])
//
@ -110,7 +110,7 @@
feeEnName: '',
quantity: 1,
exchangeRate: 1,
feeType: props.tbType == 'receive' ? 1 : 2
feeType: props.tbType == 'receive' ? 1 : 2,
}
//
const list = ref([])
@ -159,7 +159,7 @@
if (!feeDict.value.length) feeDict.value = res
console.log(res)
const dict = res.map((res) => {
return res.code + '-' +res.name
return res.code + '-' + res.name
})
process(dict)
},
@ -203,9 +203,9 @@
const code = list.value[rowIndex - 1].customerType
console.log(list.value[rowIndex - 1])
if (code) {
GetClientListByCode({ code }).then(res => {
GetClientListByCode({ code }).then((res) => {
const { data } = res
data.forEach(item => {
data.forEach((item) => {
item['label'] = item.shortName
item['value'] = item.codeName
})
@ -216,7 +216,7 @@
process(dict)
})
} else {
createMessage.warning("请先选择客户类别!")
createMessage.warning('请先选择客户类别!')
process([])
}
},
@ -267,7 +267,7 @@
width: 120,
data: 'noTaxPrice',
type: 'numeric',
readOnly: true
readOnly: true,
},
{
title: '不含税金额',
@ -275,7 +275,7 @@
data: 'noTaxAmount',
type: 'numeric',
format: '0.00',
readOnly: true
readOnly: true,
},
{
title: '金额',
@ -359,8 +359,9 @@
title: '录入人',
width: 100,
data: 'createByName',
readOnly: true
}, {
readOnly: true,
},
{
title: '录入日期',
width: 100,
data: 'createTime',
@ -388,13 +389,15 @@
title: '修改人',
width: 100,
data: 'updateByName',
readOnly: true
}, {
readOnly: true,
},
{
title: '修改日期',
width: 100,
data: 'updateTime',
readOnly: true
}, {
readOnly: true,
},
{
title: '发票申请金额',
width: 100,
data: 'orderInvoiceAmount',
@ -431,7 +434,7 @@
//
hiddenColumns: {
columns: [1, 2],
indicators: true
indicators: true,
},
//
enterMoves: 'row',
@ -528,34 +531,54 @@
//
if (changes[0][1] === 'noTaxPrice') {
//
list.value[index].unitPrice = Number((changes[0][3] || 0) * ((list.value[index].taxRate || 0) / 100 + 1)).toFixed(6)
list.value[index].unitPrice = Number(
(changes[0][3] || 0) * ((list.value[index].taxRate || 0) / 100 + 1),
).toFixed(6)
//
list.value[index].amount = Number((list.value[index].unitPrice || 0) * (list.value[index].quantity || 0)).toFixed(6)
list.value[index].amount = Number(
(list.value[index].unitPrice || 0) * (list.value[index].quantity || 0),
).toFixed(6)
//
list.value[index].noTaxAmount = Number((changes[0][3] || 0) * (list.value[index].quantity || 0)).toFixed(6)
list.value[index].noTaxAmount = Number(
(changes[0][3] || 0) * (list.value[index].quantity || 0),
).toFixed(6)
}
//
if (changes[0][1] === 'unitPrice') {
//
list.value[index].noTaxPrice = Number((changes[0][3] || 0) / ((list.value[index].taxRate || 0) / 100 + 1)).toFixed(6)
list.value[index].noTaxPrice = Number(
(changes[0][3] || 0) / ((list.value[index].taxRate || 0) / 100 + 1),
).toFixed(6)
//
list.value[index].amount = Number((changes[0][3] || 0) * (list.value[index].quantity || 0)).toFixed(6)
list.value[index].amount = Number(
(changes[0][3] || 0) * (list.value[index].quantity || 0),
).toFixed(6)
//
list.value[index].noTaxAmount = Number((list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0)).toFixed(6)
list.value[index].noTaxAmount = Number(
(list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0),
).toFixed(6)
}
//
if (changes[0][1] === 'quantity') {
//
list.value[index].amount = Number((changes[0][3] || 0) * (list.value[index].unitPrice || 0)).toFixed(6)
list.value[index].amount = Number(
(changes[0][3] || 0) * (list.value[index].unitPrice || 0),
).toFixed(6)
//
list.value[index].noTaxAmount = Number((changes[0][3] || 0) * (list.value[index].noTaxPrice || 0)).toFixed(6)
list.value[index].noTaxAmount = Number(
(changes[0][3] || 0) * (list.value[index].noTaxPrice || 0),
).toFixed(6)
}
//
if (changes[0][1] === 'taxRate') {
//
list.value[index].noTaxPrice = Number((list.value[index].unitPrice || 0) / ((changes[0][3] || 0) / 100 + 1)).toFixed(6)
list.value[index].noTaxPrice = Number(
(list.value[index].unitPrice || 0) / ((changes[0][3] || 0) / 100 + 1),
).toFixed(6)
//
list.value[index].noTaxAmount = Number((list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0)).toFixed(6)
list.value[index].noTaxAmount = Number(
(list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0),
).toFixed(6)
}
}
},
@ -567,14 +590,16 @@
items: list.value.filter((res) => {
return res.feeStatus == 1
}),
businessType: 1
businessType: 1,
}
loading.value = true
SubmitFee(postData).then(res => {
SubmitFee(postData)
.then((res) => {
loading.value = false
init()
createMessage.success(res.message)
}).catch(() => {
})
.catch(() => {
loading.value = false
})
}
@ -582,32 +607,36 @@
const submit = (arr) => {
loading.value = true
const ids = []
arr.forEach(res => {
arr.forEach((res) => {
if (res.id) ids.push(res.id)
})
if (ids.length == arr.length) {
ApplyAudit({ id: '', ids }).then(res => {
ApplyAudit({ id: '', ids })
.then((res) => {
loading.value = false
createMessage.success(res.message)
init()
}).catch(() => {
})
.catch(() => {
loading.value = false
})
} else {
const postData = {
BusinessId: props.id,
items: arr
items: arr,
}
SubmitFee(postData).then(res => {
SubmitFee(postData).then((res) => {
const { data } = res
const ids = data.map(item => {
const ids = data.map((item) => {
return item.id
})
ApplyAudit({ ids }).then(res => {
ApplyAudit({ ids })
.then((res) => {
loading.value = false
createMessage.success(res.message)
init()
}).catch(() => {
})
.catch(() => {
loading.value = false
})
})
@ -616,11 +645,13 @@
//
const revoke = (ids) => {
loading.value = true
Withdraw({ ids }).then(res => {
Withdraw({ ids })
.then((res) => {
loading.value = false
createMessage.success(res.message)
init()
}).catch(() => {
})
.catch(() => {
loading.value = false
})
}
@ -700,14 +731,15 @@
pageCondition: {
pageIndex: 1,
pageSize: 1000,
sortConditions: []
sortConditions: [],
},
queryCondition: JSON.stringify([
{ FieldName: 'BusinessId', FieldValue: props.id, ConditionalType: 1 },
{ FieldName: 'FeeType', FieldValue: props.tbType == 'receive' ? 1 : 2, ConditionalType: 1 },
])
]),
}
GetList(postData).then(res => {
GetList(postData)
.then((res) => {
loading.value = false
const { data } = res
data.forEach((item, index) => {
@ -722,7 +754,7 @@
oldData = JSON.parse(JSON.stringify(data))
if (data.length != 0) {
hotTb.value.hotInstance.updateSettings({
cells: function(row, col) {
cells: function (row, col) {
//
const props = { readOnly: true }
// STATUS=0
@ -750,7 +782,7 @@
} else {
return
}
}
},
})
}
hotTb.value.hotInstance.loadData(list.value)
@ -761,7 +793,7 @@
}
onMounted(() => {
const hot = hotTb.value.hotInstance
hot.addHook('afterOnCellMouseDown', function(event, coords, TD) {})
hot.addHook('afterOnCellMouseDown', function (event, coords, TD) {})
//
hot.addHook('beforeKeyDown', function (event) {
// 'Enter'
@ -797,13 +829,13 @@
row.forEach((item) => {
list.value.push(item)
})
}
},
)
watch(
() => props.id,
() => {
init()
}
},
)
watch(
list.value,

@ -7,14 +7,15 @@
height: 28px;
line-height: 26px;
color: #000;
font-size: 12px !important;
.iconfont {
margin-right: 6px;
font-size: 14px !important;
}
span {
&.iconfont{
font-size: 18px !important;
font-size: 16px !important;
}
}
&:hover {

@ -17,5 +17,6 @@
@import url('/@/styles/buttonGroup.scss');
.nav {
margin-top: 20px !important;
padding: 0 2px;
}
</style>

@ -381,11 +381,15 @@
height: calc(100vh - 366px);
.ant-table-body {
max-height: none !important;
height: calc(100% - 50px) !important;
.ant-table-placeholder {
display: none;
.ant-table-expanded-row-fixed {
height: calc(100vh - 365px);
}
}
}
}
</style>
<style lang="less">
@import url('/@/styles/buttonGroup.scss');

@ -158,11 +158,42 @@
}
})
if (ToRType) {
//
if (Array.isArray(data[e])) {
othercondition.push(
{
FieldName: e,
FieldValue: data[e][0],
ConditionalType: 3,
},
{
FieldName: e,
FieldValue: data[e][1],
ConditionalType: 5,
},
)
} else {
othercondition.push({
FieldName: e,
FieldValue: data[e],
ConditionalType: 1,
})
}
} else {
//
if (Array.isArray(data[e])) {
condition.push(
{
FieldName: e,
FieldValue: data[e][0],
ConditionalType: 3,
},
{
FieldName: e,
FieldValue: data[e][1],
ConditionalType: 5,
},
)
} else {
condition.push({
FieldName: e,
@ -171,6 +202,7 @@
})
}
}
}
})
}
postParam.otherQueryCondition = JSON.stringify(othercondition)

@ -7,14 +7,36 @@ import {
GetFeeCodeSelectList,
GetFeeCurrencySelectList,
} from '/@/views/operation/CustomerReconciliation/api.js'
import {
GetClientStlModeSelectList,
GetVesselSelectList,
GetVoynoSelectList,
GetAgentCnClientList,
GetClientPortSelectList,
} from '/@/views/operation/seaexport/api/BookingLedger.js'
import { GetClientListByCode } from '/@/api/common'
import { billTypeData } from '/@/views/operation/CustomerReconciliation/detail/detailColumns'
export const RQueryArr = ['currency']
export const TFData = [
{ value: true, label: '是' },
{ value: false, label: '否' },
]
export const RQueryArr = [
'customerId',
'createTime',
'billType',
'isDebit',
'stlName',
'currency',
'feeName',
'forwarderId',
'dischargePortId',
'loadPortId',
]
// 表单
export const schemas: FormSchema[] = [
{ field: 'mblno', component: 'Input', label: '主提单号', colProps: { span: 4 } },
{
label: '币别',
field: 'currency',
label: '费用对象',
field: 'customerId',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
@ -23,14 +45,14 @@ export const schemas: FormSchema[] = [
return {
api: () => {
return new Promise((resolve) => {
GetFeeCurrencySelectList().then((res) => {
console.log(res, 111111111111111111111111)
GetClientListByCode().then((res) => {
console.log(res)
resolve(res)
})
})
},
immediate: false,
labelField: 'name',
labelField: 'shortName',
valueField: 'codeName',
resultField: 'data',
filterOption: (input: string, option: any) => {
@ -39,39 +61,35 @@ export const schemas: FormSchema[] = [
}
},
},
// {
// label: '费用对象',
// field: 'customerId',
// component: 'ApiSelect',
// required: false,
// dynamicDisabled: false,
// colProps: { span: 4 },
// componentProps: () => {
// return {
// api: () => {
// return new Promise((resolve) => {
// GetFeeCodeSelectList().then((res) => {
// res.data.forEach((item) => {
// item.label = item.code + '-' + item.name
// })
// resolve(res)
// })
// })
// },
// immediate: false,
// valueField: 'id',
// resultField: 'data',
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// }
// },
// },
// { field: 'field1', component: 'Input', label: '编号检索', colProps: { span: 4 } },
// { field: 'field2', component: 'DatePicker', label: '从业务日期', colProps: { span: 4 } },
// { field: 'field3', component: 'DatePicker', label: '到业务日期', colProps: { span: 3 } },
// { field: 'field4', component: 'DatePicker', label: '从费用日期', colProps: { span: 3 } },
// { field: 'field5', component: 'DatePicker', label: '到费用日期', colProps: { span: 3 } },
{
field: 'customNo',
component: 'Input',
label: '编号检索',
dynamicDisabled: false,
colProps: { span: 4 },
},
{
field: 'etd',
label: '业务日期',
component: 'RangePicker',
required: false,
dynamicDisabled: false,
colProps: { span: 7 },
componentProps: {
allowClear: true,
},
},
{
field: 'createTime',
label: '费用日期',
component: 'RangePicker',
required: false,
dynamicDisabled: false,
colProps: { span: 6 },
componentProps: {
allowClear: true,
},
},
{
field: 'CZ',
component: 'Button',
@ -89,52 +107,130 @@ export const schemas: FormSchema[] = [
}
},
},
// {
// field: 'billType',
// component: 'Select',
// componentProps: {
// options: billTypeData,
// },
// label: '收付类型',
// colProps: { span: 2 },
// },
// { field: 'field7', component: 'Select', label: 'FRT', colProps: { span: 2 } },
// { field: 'field7', component: 'Select', label: '包含已到账', colProps: { span: 2 } },
// { field: 'field7', component: 'Select', label: '是否开票', colProps: { span: 2 } },
// { field: 'field7', component: 'Select', label: '是否垫付', colProps: { span: 2 } },
// { field: 'field6', component: 'Select', label: '委托单位', colProps: { span: 3 } },
// {
// label: '费用名称',
// field: 'field9',
// component: 'ApiSelect',
// required: false,
// dynamicDisabled: false,
// colProps: { span: 3 },
// componentProps: () => {
// return {
// api: () => {
// return new Promise((resolve) => {
// GetFeeCodeSelectList().then((res) => {
// res.data.forEach((item) => {
// item.label = item.code + '-' + item.name
// })
// resolve(res)
// })
// })
// },
// immediate: false,
// valueField: 'id',
// resultField: 'data',
{
field: 'billType',
component: 'Select',
componentProps: {
options: billTypeData,
},
label: '收付类型',
colProps: { span: 2 },
},
{
field: 'isDebit',
component: 'Select',
label: '是否对账',
dynamicDisabled: false,
colProps: { span: 2 },
componentProps: {
options: TFData,
},
},
{
label: '结算方式',
field: 'stlName',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
api: GetClientStlModeSelectList,
immediate: false,
labelField: 'stlName',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
label: '币别',
field: 'currency',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 3 },
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
immediate: false,
labelField: 'name',
valueField: 'codeName',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
label: '费用名称',
field: 'feeName',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
GetFeeCodeSelectList().then((res) => {
res.data.forEach((item) => {
item.label = item.code + '-' + item.name
})
resolve(res)
})
})
},
immediate: false,
valueField: 'id',
resultField: 'data',
// mode: 'multiple',
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// }
// },
// },
// { field: 'field9', component: 'Select', label: '费用范围', colProps: { span: 3 } },
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
field: 'isSeaFreight',
component: 'Select',
label: '是否海运费',
dynamicDisabled: false,
colProps: { span: 3 },
componentProps: ({ formModel }) => {
return {
options: TFData,
onchange: (e) => {
if (e) {
formModel.feeName = '海运费'
}
},
}
},
},
{
label: '船名',
field: 'vessel',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 3 },
componentProps: () => {
return {
api: GetVesselSelectList,
labelField: 'vesselName',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
field: 'CS',
component: 'Button',
@ -152,15 +248,112 @@ export const schemas: FormSchema[] = [
}
},
},
// { field: 'field9', component: 'Select', label: '船名', colProps: { span: 4 } },
// { field: 'field9', component: 'Input', label: '航次', colProps: { span: 4 } },
// { field: 'field7', component: 'Select', label: '含海运费业务', colProps: { span: 2 } },
// { field: 'field7', component: 'Switch', label: '记忆查询', colProps: { span: 2 } },
// { field: 'field9', component: 'Select', label: '港口(国外)', colProps: { span: 3 } },
// { field: 'field9', component: 'Select', label: '港口(国内)', colProps: { span: 3 } },
// { field: 'field9', component: 'Select', label: '国外代理', colProps: { span: 3 } },
{
label: '航次',
field: 'voyno',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
api: GetVoynoSelectList,
immediate: false,
labelField: 'voyNo',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
label: '国外代理',
field: 'forwarderId',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
api: GetAgentCnClientList,
labelField: 'shortName',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (e) {
formModel.forwarder = obj.label
} else {
formModel.forwarder = ''
}
},
}
},
},
{
label: '港口(国外)',
field: 'dischargePortId',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 3 },
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
GetClientPortSelectList().then((res) => {
res.data.forEach((item) => {
if (item.ediCode) item.cnName = item.ediCode + '/' + item.cnName
})
resolve(res)
})
})
},
immediate: false,
labelField: 'cnName',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
label: '港口(国内)',
field: 'loadPortId',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
GetClientPortSelectList().then((res) => {
res.data.forEach((item) => {
if (item.ediCode) item.cnName = item.ediCode + '/' + item.cnName
})
resolve(res)
})
})
},
immediate: false,
labelField: 'cnName',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
]
//左列表
export const columnsL: BasicColumn[] = [
{ title: '业务类型', dataIndex: 'businessTypeName', align: 'left' },
{ title: '委托单位', dataIndex: 'customerName', align: 'left' },

@ -62,7 +62,7 @@
@visibleChange="handleVisibleChange"
@confirm="openPreOrderFun"
>
<button> <span class="iconfont icon-yunshu1" style="font-size: 14px"></span> 舱单 </button>
<button> <span class="iconfont icon-yunshu1" style="font-size: 14px"></span> 舱单</button>
</a-popconfirm>
<!-- <button @click="openModel('paper')">
<span class="iconfont icon-zhizhishu" style="font-size: 18px"></span>下货纸

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save