szh-new
张同海 5 months ago
parent 9a0676e6aa
commit 7e6621f4e3

@ -201,7 +201,7 @@
rowId.value = data.record.id
const res: API.DataResult = await getCodeGoodsTypeInfo({ id: unref(rowId) })
plainOptions.value.splice(0)
if (res?.data?.content) {
if (res?.data?.content && JSON.parse(res.data.content).columns) {
JSON.parse(res.data.content).columns.forEach((item) => {
let type = true
res.data.copyFields.split(',').forEach((e) => {
@ -218,7 +218,6 @@
res.data.copyFields.split(',').forEach((e) => {
JSON.parse(res.data.content).columns.forEach((item) => {
console.log(item, e, 11111111111)
if (item.field == e) {
fromAllLabel.value.push(item)
}
@ -251,18 +250,18 @@
// if (checkedList.value && checkedList.value.length) {
// formData.copyFields = String(checkedList.value)
// }
if (fromAllLabel.value && fromAllLabel.value.length) {
formData.copyFields = ''
fromAllLabel.value.forEach((e) => {
if (formData.copyFields == '') {
formData.copyFields = e.field
} else {
formData.copyFields = `${formData.copyFields},${e.field}`
}
})
console.log(formData.copyFields)
}
if (fromAllLabel.value && fromAllLabel.value.length) {
formData.copyFields = ''
fromAllLabel.value.forEach((e) => {
if (formData.copyFields == '') {
formData.copyFields = e.field
} else {
formData.copyFields = `${formData.copyFields},${e.field}`
}
})
console.log(formData.copyFields)
}
loading.value = true
const res: API.DataResult = await EditFormCopy(formData)
loading.value = false

@ -28,7 +28,11 @@
<a-row class="CsBottom" :gutter="5">
<a-col :span="17" class="bottomTableL">
<a-spin :spinning="spinningL">
<BasicTable @register="registerTableL" @selection-change="selectionChange">
<BasicTable
class="ds-table"
@register="registerTableL"
@selection-change="selectionChange"
>
<template #toolbar>
<div class="buttonGroup">
<div class="nav" @click="addDetail">
@ -57,7 +61,7 @@
</a-col>
<a-col :span="7" class="bottomTableR">
<a-spin :spinning="spinningR">
<BasicTable @register="registerTableR">
<BasicTable class="ds-table" @register="registerTableR">
<template #toolbar>
<div class="buttonGroup">
<a-popconfirm
@ -79,7 +83,7 @@
</a-row>
</a-tab-pane>
<a-tab-pane key="2" tab="附件">
<BasicTable @register="registerTableFile">
<BasicTable class="ds-table" @register="registerTableFile">
<template #toolbar>
<div class="buttonGroup">
<div class="nav">
@ -179,7 +183,6 @@
const [registerTableL, { getSelectRows: getSelectRowsL, setTableData: setTableDataL }] = useTable(
{
title: '',
rowSelection: { type: 'checkbox' },
columns: columnsL,
pagination: true,
@ -388,14 +391,14 @@
</script>
<style lang="less" scoped>
/deep/.ant-table-container {
height: calc(100vh - 366px);
height: calc(100vh - 301px);
.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);
height: calc(100vh - 300px);
}
}
}

@ -11,33 +11,33 @@
<div class="FormBox">
<BasicForm @register="registerForm" />
</div>
<div class="TableBox">
<div class="BoxUnit">
<div class="model-botton-box">
<a-upload
:file-list="fileList"
:before-upload="beforeUpload"
name="file"
:custom-request="uploadFile"
>
<a-button class="btn" type="primary">导入对账excel</a-button>
</a-upload>
<!-- <a-button class="btn" type="primary" @click="Addlist"></a-button> -->
<!-- <a-button class="btn btn-delete" @click="Dellist"></a-button> -->
</div>
<div style="position: relative">
<a-spin :spinning="TableSpinning">
<input
class="ds-tb-check"
type="checkbox"
v-model="allCheck"
:indeterminate="someCheck"
/>
<hot-table ref="hotTb" :data="list" :settings="Lsettings"> </hot-table>
</a-spin>
</div>
</div>
</div>
<BasicTable class="ds-table" @register="registerTable">
<template #tableTitle>
<a-upload
:file-list="fileList"
:before-upload="beforeUpload"
name="file"
:custom-request="uploadFile"
>
<a-button type="link">
<span class="iconfont icon-xiazai"></span>
导入对账excel
</a-button>
</a-upload>
<a-button type="link">
<span class="iconfont icon-xiazai" @click="Fnawait"></span>
</a-button>
<a-button type="link"
><span class="iconfont icon-xiazai" @click="Fnawait"></span></a-button
>
<a-button type="link"
><span class="iconfont icon-xiazai" @click="Fnawait"></span></a-button
>
<a-button type="link"
><span class="iconfont icon-xiazai" @click="Fnawait"></span></a-button
>
</template>
</BasicTable>
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
@ -71,14 +71,11 @@
import { ApiEdit, ApiInfo, ApiBasicsList, ApiImport } from './api'
import { GetClientListByCode } from '/@/api/common'
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema } from './columns'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { formSchema, formcolumns, columns } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
const { notification, createMessage } = useMessage()
import { HotTable } from '@handsontable/vue3'
import { BasicModal, useModalInner } from '/@/components/Modal'
import { registerAllModules } from 'handsontable/registry'
import 'handsontable/dist/handsontable.full.min.css'
registerAllModules()
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
// ------------------------------------------------------------------------------
@ -89,8 +86,6 @@
const rowId = ref('')
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
allCheck.value = false
someCheck.value = false
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
@ -98,10 +93,11 @@
rowId.value = data.record.id
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) {
reload()
setFieldsValue({
...res.data,
})
await GetTableData()
// await GetTableData()
}
setModalProps({ confirmLoading: false })
} else {
@ -109,37 +105,11 @@
}
setModalProps({ loading: false })
})
const TableSpinning = ref(false)
async function GetTableData() {
TableSpinning.value = true
let ApiData = {
queryCondition: JSON.stringify([
{
FieldName: 'checkId',
FieldValue: rowId.value,
ConditionalType: 1,
},
]),
pageCondition: {
pageIndex: 1,
pageSize: 9999,
sortConditions: [],
},
}
const res: API.DataResult = await ApiBasicsList(ApiData)
if (res.succeeded) {
list.value.splice(0)
list.value.push(...res.data)
} else {
setModalProps({ confirmLoading: false })
}
TableSpinning.value = false
}
//
async function handleSave(exit) {
try {
const values = await validate()
values.feeList = list.value
// values.feeList = getRawDataSource()
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await ApiEdit(values)
console.log(res)
@ -167,7 +137,6 @@
}
}
function FnClose() {
list.value.splice(0)
closeModal()
}
async function refresh() {
@ -184,307 +153,58 @@
schemas: formSchema,
showActionButtonGroup: false,
})
// ------------------------------------------------------------------------------
//
const allCheck = ref(false)
//
const someCheck = ref(false)
const list = ref<any>([])
watchEffect(() => {
//
if (allCheck.value) {
list.value.forEach((item) => {
item.selected = true
})
} else {
//
list.value.forEach((item) => {
item.selected = false
// ------------------------------------------------------------------------------
const [registerTable, { reload, getRawDataSource }] = useTable({
title: '',
api: async (p) => {
const res: API.DataResult = await ApiBasicsList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
}
})
watch(
list.value,
(val) => {
let a = 0
let b = 0
val.forEach((item) => {
if (item.selected) {
a += 1
} else {
b += 1
}
})
if (a == 0) {
allCheck.value = false
}
if (b == 0) {
allCheck.value = true
},
beforeFetch: (p) => {
const postParam: API.PageRequest = {
queryCondition: JSON.stringify([
{
FieldName: 'checkId',
FieldValue: rowId.value,
ConditionalType: 1,
},
]),
pageCondition: {
pageIndex: p.current,
pageSize: p.pageSize,
sortConditions: [],
},
}
if (a != 0 && b != 0) {
someCheck.value = true
if (p.field) {
postParam.pageCondition.sortConditions = [
{
sortField: p.field,
listSortDirection: p.order == 'ascend' ? 0 : 1,
},
]
} else {
someCheck.value = false
postParam.pageCondition.sortConditions = []
}
},
{
deep: true,
},
)
const hotTb = ref()
//
const companyDict = ref([])
//
const vesselDict = ref([])
const isEqualData = ref([
{
name: '是',
value: true,
},
{
name: '否',
value: false,
},
])
const Columns = [
{
data: 'selected',
type: 'checkbox',
title: ' ',
width: 32,
className: 'htCenter',
readOnly: false,
},
{
title: '主键Id',
width: 120,
data: 'id',
},
{
title: '对账Id',
width: 120,
data: 'checkId',
},
{
title: '结算单位Id',
width: 120,
data: 'customerId',
},
{
title: '船名Id',
width: 120,
data: 'vesselId',
},
{
title: '操作员Id',
width: 120,
data: 'operatorId',
},
{
title: '揽货人Id',
width: 120,
data: 'saleId',
},
{
title: '主提单号',
width: 120,
data: 'mblno',
},
{
title: '本地RMB金额',
width: 120,
type: 'numeric',
data: 'rmbLocalAmount',
},
{
title: '本地USD金额',
width: 120,
type: 'numeric',
data: 'usdLocalAmount',
},
{
title: '对账RMB金额',
width: 120,
type: 'numeric',
data: 'rmbCheckAmount',
},
{
title: '对账USD金额',
width: 120,
type: 'numeric',
data: 'usdCheckAmount',
},
{
title: 'RMB差异金额',
width: 120,
type: 'numeric',
data: 'rmbDifferenceAmount',
},
{
title: 'USD差异金额',
width: 120,
type: 'numeric',
data: 'usdDifferenceAmount',
},
{
title: '结算单位',
width: 130,
data: 'customerName',
type: 'dropdown',
source: async (query, process) => {
const rowIndex = hotTb.value.hotInstance.getActiveEditor().row
const code = list.value[rowIndex]?.customerType || null
GetClientListByCode({ code }).then((res) => {
const { data } = res
data.forEach((item) => {
item['label'] = item.shortName
item['value'] = item.codeName
})
companyDict.value = data
const dict = data.map((item) => {
return item.codeName + '-' + item.shortName
})
process(dict)
})
},
},
{
title: '开船日期',
width: 120,
data: 'etd',
type: 'date',
dateFormat: 'YYYY-MM-DD',
},
{
title: '船名',
width: 120,
data: 'vessel',
type: 'dropdown',
source: async (query, process) => {
let data = optionsStore.getOptionsByCode('GetVesselSelectList')
vesselDict.value = data
const dict = data.map((item) => {
return item.vesselName
})
process(dict)
},
},
{
title: '海关航次',
width: 120,
data: 'voyno',
},
{
title: '操作员',
width: 120,
data: 'operatorName',
type: 'dropdown',
source: async (query, process) => {
let data = optionsStore.getOptionsByCode('GetCustomerServiceList')
vesselDict.value = data
const dict = data.map((item) => {
return item.userName
})
process(dict)
},
},
{
title: '揽货人',
width: 120,
data: 'saleName',
type: 'dropdown',
source: async (query, process) => {
let data = optionsStore.getOptionsByCode('GetSaleList')
vesselDict.value = data
const dict = data.map((item) => {
return item.userName
})
process(dict)
},
},
{
title: '是否一致',
width: 80,
data: 'isEqual',
type: 'dropdown',
source: async (query, process) => {
const dict = isEqualData.value.map((res) => {
return res.name
})
process(dict)
},
},
]
const Lsettings = {
height: '400',
// width: '100%',
autoWrapRow: true,
autoWrapCol: true,
//
rowHeights: 32,
fixedColumnsLeft: 1,
//
hiddenColumns: {
columns: [1, 2, 3, 4, 5, 6],
indicators: true,
},
columnSorting: true,
//
// columnSorting: {
// column: 2, //
// sortOrder: ['asc', 'desc'] //
// },
//
// afterValidate: function (isValid, value, row, prop, source) {
// if (!isValid) {
// hotTb.value.hotInstance.setDataAtRowProp(row, prop, '')
// }
// },
columns: Columns,
// ()
licenseKey: 'non-commercial-and-evaluation',
enterMoves: 'row',
//
afterChange(changes, source) {
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict = {}
changes.forEach((res) => {
//
if (res[1] === 'customerName') {
const item: any = companyDict.value.filter((item: any) => {
return changes[0][3].includes(item.codeName + '-' + item.shortName)
})
if (item) dict = item[0]
list.value[res[0]]['customerId'] = dict['id']
}
//
if (res[1] === 'vessel') {
const item: any = vesselDict.value.filter((item: any) => {
return changes[0][3].includes(item.vesselName)
})
if (item) dict = item[0]
list.value[res[0]]['vesselId'] = dict['id']
}
//
if (res[1] === 'operatorName') {
const item: any = vesselDict.value.filter((item: any) => {
return changes[0][3].includes(item.userName)
})
if (item) dict = item[0]
list.value[res[0]]['operatorId'] = dict['id']
}
//
if (res[1] === 'saleName') {
const item: any = vesselDict.value.filter((item: any) => {
return changes[0][3].includes(item.userName)
})
if (item) dict = item[0]
list.value[res[0]]['saleId'] = dict['id']
}
})
}
},
}
return postParam
},
columns: formcolumns,
isTreeTable: false,
pagination: true,
striped: true,
useSearchForm: false,
showTableSetting: false,
bordered: true,
showIndexColumn: true,
indexColumnProps: {
width: 60,
},
canResize: true,
resizeHeightOffset: 35,
immediate: false,
})
// EXCEL
const fileList = ref([])
function beforeUpload(file) {
@ -497,64 +217,15 @@
formData.append('file', file.file)
ApiImport({
data: formData,
// parameter: { LinkId: Did, TypeCode: 'other', TypeName: '' },
}).then(async (res) => {
if (res.succeeded) {
await GetTableData()
await reload()
} else {
notification.error({ message: res.message, duration: 3 })
}
})
}
function Addlist() {
list.value.push({})
}
async function Dellist() {
const data = await validate()
if (data.id) {
let ApiData: any = { id: data.id, ids: [] }
list.value.forEach((e, i) => {
if (e.selected && e.id) {
ApiData.ids.push(e.id)
}
})
} else {
list.value.forEach((e, i) => {
if (e.selected) {
list.value.splice(i, 1)
}
})
}
function Fnawait() {
notification.warning({ message: '等待开发', duration: 3 })
}
</script>
<style lang="less" scoped>
.FormBox {
// height: 100px;
}
.TableBox {
display: flex;
.BoxUnit {
flex: 1;
.model-botton-box {
margin: 40px 0 20px 20px;
.btn {
margin-right: 10px;
}
.btn-delete {
border: 1px solid #ff6646;
background: #fdf2f0;
color: #ff6646;
&:hover {
border: 1px solid #ff6646 !important;
background: #fdf2f0 !important;
color: #ff6646 !important;
opacity: 0.7;
}
}
}
}
}
</style>

@ -95,11 +95,87 @@ export const columns: BasicColumn[] = [
export const searchFormSchema: FormSchema[] = [
{
field: 'autoBillNo',
label: '自动对账编号',
field: 'customerId',
label: '对账客户',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
allowClear: true,
showSearch: true,
api: () => {
return new Promise((resolve) => {
const arr = getOptions('controller')
resolve(arr)
})
},
labelField: 'name',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
field: 'billName',
label: '对账单名称',
component: 'Input',
colProps: { span: 4 },
},
{
field: 'startTime',
label: '起始时间',
component: 'DatePicker',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: {
showTime: true,
allowClear: true,
},
},
{
field: 'endTime',
label: '结束时间',
component: 'DatePicker',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: {
showTime: true,
allowClear: true,
},
},
{
field: 'settlerId',
label: '结算人',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
allowClear: true,
showSearch: true,
api: () => {
return new Promise((resolve) => {
const arr = getOptions('controller')
resolve(arr)
})
},
labelField: 'name',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
]
let businessTypeData = [
{ label: '全部', value: 0 },
@ -338,199 +414,87 @@ export const formSchema: FormSchema[] = [
]
export const formcolumns: BasicColumn[] = [
{
title: '自动对账编号',
dataIndex: 'ctnSize0',
width: 150,
},
{
title: '结算对象',
dataIndex: 'ctnSize1',
width: 150,
},
{
title: '收付方向',
dataIndex: 'ctnSize2',
width: 150,
},
{
title: '对账状态',
dataIndex: 'ctnSize3',
title: '主提单号',
dataIndex: 'mblno',
sorter: true,
width: 150,
},
{
title: '开始日期',
dataIndex: 'ctnSize4',
title: '本地RMB金额',
dataIndex: 'rmbLocalAmount',
sorter: true,
width: 150,
},
{
title: '结束日期',
dataIndex: 'ctnSize5',
title: '本地USD金额',
dataIndex: 'usdLocalAmount',
sorter: true,
width: 150,
},
{
title: '对账人',
dataIndex: 'ctnSize5',
title: '对账RMB金额',
dataIndex: 'rmbCheckAmount',
sorter: true,
width: 150,
},
{
title: '操作日期',
dataIndex: 'ctnSize5',
title: '对账USD金额',
dataIndex: 'usdCheckAmount',
sorter: true,
width: 150,
},
{
title: '备注',
dataIndex: 'ctnSize5',
title: 'RMB差异金额',
dataIndex: 'rmbDifferenceAmount',
sorter: true,
width: 150,
},
{
title: '对账情况',
dataIndex: 'ctnSize5',
title: 'USD差异金额',
dataIndex: 'usdDifferenceAmount',
sorter: true,
width: 150,
},
{
title: '是否包含已对账',
dataIndex: 'ctnSize5',
title: '结算单位',
dataIndex: 'customerName',
sorter: true,
width: 150,
},
{
title: '费用状态',
dataIndex: 'ctnSize5',
title: '开船日期',
dataIndex: 'etd',
sorter: true,
width: 150,
},
{
title: '对账单编号',
dataIndex: 'ctnSize5',
title: '船名',
dataIndex: 'vessel',
sorter: true,
width: 150,
},
{
title: 'RMB对账金额',
dataIndex: 'ctnSize5',
title: '海关航次',
dataIndex: 'voyno',
sorter: true,
width: 150,
},
{
title: 'USD对账金额',
dataIndex: 'ctnSize5',
title: '操作员',
dataIndex: 'operatorName',
sorter: true,
width: 150,
},
{
title: 'RMB本地金额',
dataIndex: 'ctnSize5',
title: '揽货人',
dataIndex: 'saleName',
sorter: true,
width: 150,
},
{
title: 'USD本地金额',
dataIndex: 'ctnSize5',
title: '是否一致',
dataIndex: 'isEqual',
sorter: true,
width: 150,
},
]
export const formsearchFormSchema: FormSchema[] = [
// {
// field: 'ctnSize0',
// label: '自动对账编号',
// component: 'Input',
// colProps: { span: 5 },
// },
// {
// field: 'ctnSize0',
// label: '结算对象',
// component: 'Input',
// colProps: { span: 5 },
// },
// {
// field: 'ctnSize0',
// label: '对账方式',
// component: 'Input',
// colProps: { span: 5 },
// },
// {
// field: 'ctnSize0',
// label: '对账状态',
// component: 'Input',
// colProps: { span: 5 },
// },
// {
// field: 'ctnSize0',
// label: '对账单编号',
// component: 'Input',
// colProps: { span: 4 },
// },
// {
// field: 'ctnSize0',
// label: '起始时间',
// component: 'Input',
// colProps: { span: 5 },
// },
// {
// field: 'ctnSize0',
// label: '结算时间',
// component: 'Input',
// colProps: { span: 5 },
// },
// {
// field: 'ctnSize0',
// label: '操作人',
// component: 'Input',
// colProps: { span: 5 },
// },
// {
// field: 'ctnSize0',
// label: '操作时间',
// component: 'Input',
// colProps: { span: 5 },
// },
// {
// field: 'ctnSize0',
// label: '业务类型',
// component: 'Input',
// colProps: { span: 4 },
// },
// {
// field: 'ctnSize0',
// label: '费用范围',
// component: 'Input',
// colProps: { span: 4 },
// },
// {
// field: 'ctnSize0',
// label: '结算方式',
// component: 'Input',
// colProps: { span: 4 },
// },
// {
// field: 'ctnSize0',
// label: '币别',
// component: 'Input',
// colProps: { span: 4 },
// },
// {
// field: 'ctnSize0',
// label: '费用状态',
// component: 'Input',
// colProps: { span: 3 },
// },
// {
// field: 'ctnSize0',
// label: '核算单位',
// component: 'Input',
// colProps: { span: 3 },
// },
// {
// field: 'ctnSize0',
// label: '包含已对账',
// component: 'Input',
// colProps: { span: 3 },
// },
// {
// field: 'ctnSize0',
// label: '费用类别',
// component: 'Input',
// colProps: { span: 3 },
// },
// {
// field: 'ctnSize0',
// label: '备注',
// component: 'Input',
// colProps: { span: 24 },
// },
]

@ -1,18 +1,24 @@
<template>
<div>
<BasicTable class="ds-table" @register="registerTable">
<template #tableTitle>
<template #toolbar>
<a-button type="link" size="mini" @click="handleCreate">
<span class="iconfont icon-jiahao2fill"></span>
添加
<span class="iconfont icon-new_document"></span>
新建
</a-button>
<!-- <div class="nav" @click="Fnawait">
<i
class="iconfont icon-a-wendangcaozuoxiazaishangchuanshanchuxinzengfujianyasuochakan-01"
></i
>导入
</div> -->
<a-popconfirm
title="确定删除当前选中数据?"
ok-text="是"
cancel-text="否"
@confirm="Fnawait"
>
<a-button type="link">
<span class="iconfont icon-shanchu1"></span>
删除
</a-button>
</a-popconfirm>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
@ -75,13 +81,42 @@
postParam.pageCondition.sortConditions = []
}
let condition: API.ConditionItem[] = []
if (!!data.autoBillNo) {
if (!!data.customerId) {
condition.push({
FieldName: 'autoBillNo',
FieldValue: data.autoBillNo,
FieldName: 'customerId',
FieldValue: data.customerId,
ConditionalType: 1,
})
}
if (!!data.billName) {
condition.push({
FieldName: 'billName',
FieldValue: data.billName,
ConditionalType: 1,
})
}
if (!!data.startTime) {
condition.push({
FieldName: 'startTime',
FieldValue: data.startTime,
ConditionalType: 1,
})
}
if (!!data.endTime) {
condition.push({
FieldName: 'endTime',
FieldValue: data.endTime,
ConditionalType: 1,
})
}
if (!!data.settlerId) {
condition.push({
FieldName: 'settlerId',
FieldValue: data.settlerId,
ConditionalType: 1,
})
}
postParam.queryCondition = JSON.stringify(condition)
return postParam
},

Loading…
Cancel
Save