feature-JimuReport-1106-yjl
lijingjia 3 weeks ago
commit 323fa26fb2

@ -509,7 +509,14 @@ export function GetCarrierSelectList(params) {
params,
})
}
// // 船公司下拉 客户端
// export function GetCarrierSelectList(params) {
// return request({
// url: '/mainApi/ClientCommon/GetCarrierSelectList',
// method: 'get',
// params,
// })
// }
// 切换组织机构
export function ChangeOrg(params) {
return request({

@ -8,42 +8,6 @@
@ok="handleSave"
>
<BasicForm @register="registerForm" />
<div class="HotTable">
<div>
<a-button type="link" @click="TableAdd" class="pl0">
<span class="iconfont icon-new_document"></span>
新增
</a-button>
<a-popconfirm
title="确定要删除所选数据?"
ok-text="确定"
cancel-text="取消"
@confirm="FnClickDel"
>
<a-button type="link" class="pl0">
<span class="iconfont icon-shanchu21"></span>
删除
</a-button>
</a-popconfirm>
</div>
<div style="position: relative">
<input
class="ds-tb-check ds-goods-tb-check"
type="checkbox"
v-model="allCheck"
:indeterminate="someCheck"
v-if="list.length !== 0"
/>
<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>
<a-button
@ -74,15 +38,12 @@
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, watchEffect, watch } from 'vue'
import { ref, computed, unref } from 'vue'
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { CADformSchema } from './columns'
import { editClientBank, getClientBankInfo } from './api'
import { useMessage } from '/@/hooks/web/useMessage'
import { HotTable } from '@handsontable/vue3'
import { registerAllModules } from 'handsontable/registry'
registerAllModules()
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -97,9 +58,6 @@
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
list.value.splice(0)
allCheck.value = false
someCheck.value = false
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
rowId.value = data.record.id
@ -110,9 +68,6 @@
setFieldsValue({
...res.data,
})
res.data.invoiceHeaders.forEach((item) => {
list.value.push(item)
})
}
setModalProps({ confirmLoading: false })
} else {
@ -126,7 +81,7 @@
async function handleSave(exit) {
try {
const values = await validate()
values.invoiceHeaders = list.value
setModalProps({ confirmLoading: true, loading: true })
// TODO custom api
@ -152,131 +107,7 @@
setModalProps({ confirmLoading: false, loading: false })
}
}
// ---------------------------------------
const list = ref<any>([])
//
const allCheck = ref(false)
//
const someCheck = ref(false)
const hotTb = ref()
watchEffect(() => {
//
if (allCheck.value) {
list.value.forEach((item: any) => {
item.selected = true
})
} else {
//
list.value.forEach((item: any) => {
item.selected = false
})
}
})
watch(
list.value,
(val) => {
let a = 0
let b = 0
val.forEach((item: any) => {
if (item.selected) {
a += 1
} else {
b += 1
}
})
if (a == 0) {
allCheck.value = false
}
if (b == 0) {
allCheck.value = true
}
if (a != 0 && b != 0) {
someCheck.value = true
} else {
someCheck.value = false
}
},
{
deep: true,
},
)
const columns = [
{
data: 'selected',
type: 'checkbox',
title: ' ',
width: 32,
className: 'htCenter',
readOnly: false,
},
{
title: '主键ID',
width: 200,
data: 'id',
},
{
title: '关联ID',
width: 200,
data: 'relativeId',
},
{
title: '发票抬头',
width: 200,
data: 'header',
},
{
title: '地址电话',
width: 300,
data: 'addressTel',
},
]
const settings = {
height: '260',
autoWrapRow: true,
autoWrapCol: true,
//
rowHeights: 26,
fixedColumnsLeft: 1,
//
hiddenColumns: {
columns: [1, 2],
indicators: true,
},
//
enterMoves: 'row',
columnSorting: true,
//
afterValidate: function (isValid, value, row, prop, source) {
if (!isValid) {
hotTb.value.hotInstance.setDataAtRowProp(row, prop, '')
}
},
columns: columns,
// ()
licenseKey: 'non-commercial-and-evaluation',
//
async afterChange(changes, source) {},
}
function TableAdd() {
if (rowId.value) {
list.value.push({ selected: false, relativeId: rowId.value })
} else {
notification.warning({ message: '请先保存', duration: 3 })
}
}
function FnClickDel() {
if (rowId.value) {
list.value.forEach((e: any, i) => {
if (e.selected) {
if (e.id) {
list.value.splice(i, 1)
}
}
})
} else {
notification.warning({ message: '请先保存', duration: 3 })
}
}
async function refresh() {
const res: API.DataResult = await getClientBankInfo({ id: unref(rowId) })
if (res.succeeded) {
@ -284,10 +115,6 @@
setFieldsValue({
...res.data,
})
list.value.splice(0)
res.data.invoiceHeaders.forEach((item) => {
list.value.push(item)
})
}
}
</script>

@ -64,7 +64,7 @@ const res14: API.DataResult = await GetTenantBanks({ currency: 'CNY' })
if (res14.succeeded) {
rmbAccountData = []
res14.data.forEach((e) => {
rmbAccountData.push({ label: e.accountName, value: e.id, ...e })
rmbAccountData.push({ label: `${e.bankName}-${e.bankAccountNo}`, value: e.id, ...e })
})
}
let usdAccountData: any = []
@ -72,7 +72,7 @@ const res15: API.DataResult = await GetTenantBanks({ currency: 'USD' })
if (res15.succeeded) {
usdAccountData = []
res15.data.forEach((e) => {
usdAccountData.push({ label: e.accountName, value: e.id, ...e })
usdAccountData.push({ label: `${e.bankName}-${e.bankAccountNo}`, value: e.id, ...e })
})
}
export const EditformSchema: FormSchema[] = [

@ -52,7 +52,7 @@
//
import { formSchema } from './columns'
//
import { ApiEdit, ApiBulkEdit, ApiInfo } from './api'
import { ApiEdit, ApiBulkEdit, ApiBulkEditDetails, ApiInfo } from './api'
import { feeUnitDict } from '/@/hooks/dict/index'
//
import { useMessage } from '/@/hooks/web/useMessage'
@ -73,14 +73,29 @@
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, getFieldsValue, validate, updateSchema }] =
useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const [
registerForm,
{
resetFields,
setFieldsValue,
appendSchemaByField,
removeSchemaByField,
getFieldsValue,
validate,
updateSchema,
},
] = useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const unitArr = ref<any>([])
const BulkInfoArr = ref<any>([])
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(
async (data) => {
unitArr.value.forEach((item) => {
removeSchemaByField(`${item}unitP`)
})
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
@ -129,13 +144,54 @@
feeField.value.condition = res.data.condition
// detailId.value = res.data.id
}
} else if (isBulk.value) {
detailId.value = ''
setFieldsValue({
customerName: props.customerName,
customerId: props.customerId,
isBulk: true,
})
//
const UnitList = await feeUnitDict()
unitArr.value.splice(0)
BulkInfoArr.value.splice(0)
ids.value.forEach(async (e) => {
const res: any = await ApiInfo({ id: unref(e) })
BulkInfoArr.value.push(res.data)
if (res.succeeded) {
res.data.details.forEach((item: any) => {
if (unitArr.value.indexOf(item.unit) == -1) {
unitArr.value.push(item.unit)
UnitList.forEach((Unit: any) => {
if (item.unit == Unit.value) {
appendSchemaByField(
[
{
field: `${Unit.value}unitP`,
label: `${Unit.label}含税单价`,
component: 'Input',
colProps: { span: 6 },
componentProps: {
placeholder: `${Unit.label}含税单价`,
},
},
],
undefined,
)
}
})
}
})
}
})
feeField.value.SetData([])
feeField.value.condition = ''
} else {
detailId.value = ''
setFieldsValue({
customerName: props.customerName,
customerId: props.customerId,
saleOrgId: userStore.getUserInfo.userOrgs[0].orgId,
isBulk: isBulk.value ? true : false,
})
feeField.value.SetData([])
feeField.value.condition = ''
@ -164,7 +220,9 @@
detailId.value = res.data.id
}
}
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
const getTitle = computed(() =>
!unref(isUpdate) ? (!unref(isBulk) ? '批量编辑' : '新增') : '编辑',
)
//
const feeField = ref()
async function handleSave(exit) {
@ -181,6 +239,18 @@
let res: any = null
console.log(isBulk.value, 11111111111)
if (isBulk.value) {
let ApiDetailsData: any = []
//
BulkInfoArr.value.forEach((e) => {
e.details.forEach((item) => {
unitArr.value.forEach((item2) => {
if (item2 == item.unit && values[`${item2}unitP`]) {
ApiDetailsData.push({ ...item, taxUnitPrice: values[`${item2}unitP`] })
}
})
})
})
await ApiBulkEditDetails(ApiDetailsData)
let ApiData: any = []
ids.value.forEach((e) => {
ApiData.push({ ...values, id: e })

@ -5,7 +5,12 @@ import { Tag } from 'ant-design-vue'
import { getDictOption } from '/@/utils/dictUtil'
import { useUserStore } from '/@/store/modules/user'
const userStore: any = useUserStore()
import { getOrgList, GetClientPortSelectList, GetCarrierSelectList } from '/@/api/common'
import {
getOrgList,
GetClientPortSelectList,
GetCarrierSelectList,
GetSupplierListByCode,
} from '/@/api/common'
import {
GetClientLanesSelectList,
GetAgentCnClientList,
@ -32,13 +37,17 @@ GetCarrierSelectList().then((res) => {
carrierIdList.value = res.data
})
const forwarderIdList = ref([])
GetAgentCnClientList().then((res) => {
GetSupplierListByCode().then((res) => {
forwarderIdList.value = res.data
})
const mblFrtCodeList = ref([])
GetClientFrtSelectList().then((res) => {
mblFrtCodeList.value = res.data
})
const PortList = ref([])
GetClientPortSelectList().then((res) => {
PortList.value = res.data
})
// 业务来源明细数据
const sourceDetailId = ref<any>([])
export const columns: BasicColumn[] = [
@ -78,12 +87,34 @@ export const columns: BasicColumn[] = [
{
title: '起运港',
dataIndex: 'polCode',
sorter: true,
width: 200,
customRender: ({ record }) => {
let name = ''
PortList.value.some((item: any) => {
if (record.polCode == item.ediCode) {
name = `${item.cnName}/${item.portName}`
return true
}
})
return name
},
},
{
title: '卸货港',
dataIndex: 'podCode',
sorter: true,
width: 200,
customRender: ({ record }) => {
let name = ''
PortList.value.some((item: any) => {
if (record.podCode == item.ediCode) {
name = `${item.cnName}/${item.portName}`
return true
}
})
return name
},
},
{
dataIndex: 'laneId',
@ -137,12 +168,12 @@ export const columns: BasicColumn[] = [
dataIndex: 'forwarderId',
title: '订舱口',
sorter: true,
width: 200,
width: 280,
customRender: ({ record }) => {
let name = ''
forwarderIdList.value.some((item: any) => {
if (record.forwarderId == item.id) {
name = item.shortName
name = item.pinYinCode
return true
}
})
@ -275,12 +306,32 @@ export const viewColumns: BasicColumn[] = [
dataIndex: 'polCode',
sorter: true,
width: 200,
customRender: ({ record }) => {
let name = ''
PortList.value.some((item: any) => {
if (record.polCode == item.ediCode) {
name = `${item.cnName}/${item.portName}`
return true
}
})
return name
},
},
{
title: '卸货港',
dataIndex: 'podCode',
sorter: true,
width: 200,
customRender: ({ record }) => {
let name = ''
PortList.value.some((item: any) => {
if (record.podCode == item.ediCode) {
name = `${item.cnName}/${item.portName}`
return true
}
})
return name
},
},
{
dataIndex: 'laneName',
@ -547,16 +598,19 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
label: '订舱口',
field: 'forwarderId',
label: '订舱口',
component: 'ApiSelect',
required: false,
// labelSlot: 'yardId',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
api: GetAgentCnClientList,
labelField: 'shortName',
api: GetSupplierListByCode,
params: { code: 'Booking' },
labelField: 'pinYinCode',
showName: 'description',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
@ -927,16 +981,19 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '订舱口',
field: 'forwarderId',
label: '订舱口',
component: 'ApiSelect',
required: false,
// labelSlot: 'yardId',
dynamicDisabled: false,
colProps: { span: 6 },
componentProps: ({ formModel }) => {
return {
api: GetAgentCnClientList,
labelField: 'shortName',
api: GetSupplierListByCode,
params: { code: 'Booking' },
labelField: 'pinYinCode',
showName: 'description',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {

@ -11,10 +11,14 @@
<span class="iconfont icon-new_document"></span>
添加
</a-button>
<a-button type="link" @click="BulkEdit">
<a-button type="link" @click="copyRow">
<span class="iconfont icon-fuzhi"></span>
复制
</a-button>
<!-- <a-button type="link" @click="BulkEdit">
<span class="iconfont icon-dengjizongshu"></span>
批量编辑
</a-button>
</a-button> -->
<a-popconfirm
title="确定删除当前选中数据?"
ok-text="是"
@ -204,7 +208,7 @@
//
let unitDict = []
//
const list = ref([])
const list = ref<any>([])
//
const feeDict = ref([])
//
@ -302,29 +306,6 @@
className: 'htCenter',
readOnly: false,
},
// {
// 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: 130,
@ -357,7 +338,7 @@
{
title: '单位标准',
width: 130,
data: 'unit',
data: 'unitText',
type: 'dropdown',
source: async (query, process) => {
if (unitDict.value && unitDict.value.length) {
@ -425,6 +406,7 @@
data: 'unitPrice',
type: 'numeric',
format: '0.00',
readOnly: true,
},
{
title: '汇率',
@ -468,161 +450,6 @@
data: 'isAdvancedPay',
type: 'checkbox',
},
// {
// title: '',
// width: 130,
// data: 'feeEnName',
// type: 'dropdown',
// source: async (query, process) => {
// const res = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
// if (!feeDict.value.length) feeDict.value = res
// const dict = res.map((res) => {
// return res.enName
// })
// process(dict)
// },
// },
// {
// title: '',
// width: 130,
// data: 'customerTypeText',
// type: 'dropdown',
// source: async (query, process) => {
// const results = await getDictOption('djy_cust_prop')
// const dict = results.map((item) => {
// return item.value + '-' + item.name
// })
// process(dict)
// },
// },
// {
// title: '',
// width: 120,
// data: 'quantity',
// type: 'numeric',
// format: '0',
// },
// {
// title: '',
// width: 120,
// data: 'noTaxPrice',
// type: 'numeric',
// readOnly: true,
// },
// {
// title: '',
// width: 120,
// data: 'noTaxAmount',
// type: 'numeric',
// format: '0.00',
// readOnly: true,
// },
// {
// title: '',
// width: 120,
// data: 'amount',
// type: 'numeric',
// },
// {
// title: '',
// width: 120,
// data: 'note',
// },
// {
// title: '',
// width: 100,
// data: 'accTaxAmount',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'accAmount',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'isOpen',
// type: 'checkbox',
// },
// {
// title: 'FRT',
// width: 120,
// data: 'feeFrt',
// type: 'dropdown',
// source: ['PP', 'CC'],
// },
// {
// title: '',
// width: 100,
// data: 'createByName',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'createTime',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'settlementAmount',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'invoiceAmount',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'debitNo',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'updateByName',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'updateTime',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'orderInvoiceAmount',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'debitNo',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'auditOperator',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'auditDate',
// readOnly: true,
// },
]
//
const settings = {
@ -659,21 +486,8 @@
afterChange(changes, source) {
//
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict = {}
let dict: any = {}
changes.forEach((res) => {
// //
// if (changes[0][1] === 'feeTypeName') {
// const res = [
// { label: '', value: 1 },
// { label: '', value: 2 },
// ]
// const item = res.filter((item) => {
// return item.label === changes[0][3]
// })
// if (item) dict = item[0]
// list.value[changes[0][0]]['feeType'] = dict?.value
// list.value[changes[0][0]]['feeTypeName'] = dict?.label
// }
//
if (changes[0][1] === 'customerName') {
const item = companyDict.value.filter((item) => {
@ -691,61 +505,43 @@
})
if (item) dict = item[0]
// feeType
console.log(dict)
list.value[res[0]]['feeName'] = changes[0][3].split('-')[1]
list.value[res[0]]['feeCode'] = dict['code']
list.value[res[0]]['feeId'] = dict['id']
list.value[res[0]]['unit'] = dict['defaultUnit']
list.value[res[0]]['unitText'] = dict['defaultUnitName']
list.value[res[0]]['currency'] = dict['defaultCurrency']
if (dict['defaultCurrency'] == 'RMB') {
list.value[res[0]]['exchangeRate'] = 1
} else {
list.value[res[0]]['exchangeRate'] = '【根据设置汇率生成】'
}
list.value[res[0]]['taxRate'] = dict['taxRate']
list.value[res[0]]['isInvoice'] = dict['isInvoice']
list.value[res[0]]['isAdvancedPay'] = dict['isAdvancedPay']
// list.value[res[0]]['feeEnName'] = dict['enName']
// list.value[res[0]]['unitText'] = dict['defaultUnitName']
// list.value[res[0]]['customerTypeText'] = dict['defaultDebitName']
// list.value[res[0]]['customerType'] = dict['defaultDebit']
// list.value[res[0]]['isOpen'] = dict['isOpen']
// list.value[res[0]]['feeFrt'] = dict['feeFrt']
}
})
//
if (changes[0][1] === 'currency') {
if (changes[0][3] == 'RMB') {
list.value[changes[0][0]]['exchangeRate'] = 1
} else {
list.value[changes[0][0]]['exchangeRate'] = '【根据设置汇率生成】'
}
}
//
if (changes[0][1] === 'unit') {
if (changes[0][1] === 'unitText') {
const item = unitDict.value.filter((item) => {
return changes[0][3].includes(item.name)
})
if (item) dict = item[0]
if (!/^[\u3400-\u9FBF]+$/.test(dict.label)) {
list.value[changes[0][0]]['isCtn'] = true
}
list.value[changes[0][0]]['unit'] = dict?.value
// list.value[changes[0][0]]['unitText'] = changes[0][3].split('-')[1]
//
// const text = list.value[changes[0][0]]['unitText']
// if (text == '') {
// list.value[changes[0][0]]['quantity'] = 1
// } else if (text == '') {
// list.value[changes[0][0]]['quantity'] = props.details.pkgs
// } else if (text == '') {
// list.value[changes[0][0]]['quantity'] = props.details.kgs
// } else if (text == '') {
// list.value[changes[0][0]]['quantity'] = props.details.cbm
// } else if (text == '') {
// let r = props.details.kgs
// const k = (props.details.pkgs || 0) / 1000
// if (k > r) {
// r = k
// }
// list.value[changes[0][0]]['quantity'] = r
list.value[changes[0][0]]['unitText'] = dict?.label
}
// //
// if (changes[0][1] === 'currencyName') {
// const item = currencyDict.value.filter((item) => {
// return item.name === changes[0][3]
// })
// if (item) dict = item[0]
// list.value[changes[0][0]]['currency'] = dict?.codeName
// }
// ============================
// //
// if (changes[0][1] === 'feeEnName') {
// }
//
if (changes[0][1] === 'customerTypeText') {
@ -758,61 +554,6 @@
list.value[changes[0][0]]['customerTypeText'] = changes[0][3].split('-')[1]
})
}
// //
// const index = changes[0][0]
// //
// 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].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)
// }
// //
// 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].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)
// }
// //
// if (changes[0][1] === 'quantity') {
// //
// 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)
// }
// //
// 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].noTaxAmount = Number(
// (list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0),
// ).toFixed(6)
// }
}
},
}
@ -889,6 +630,13 @@
deep: true,
},
)
const copyRow = () => {
list.value.forEach((item: any) => {
if (item.selected) {
list.value.push({ ...item, id: '' })
}
})
}
//
const deleteRow = async () => {
// list.value.forEach((item: any, index) => {

@ -4,7 +4,7 @@
<template #tableTitle>
<!-- <span class="title">自动费用模板</span> -->
<div class="ShowView">
<a-switch @change="ChangeView" v-model:checked="ShowView" />
<a-switch @change="ChangeView" v-model:checked="ShowView" :loading="ShowViewLoading" />
<span class="ShowViewText">按费用显示</span>
</div>
<a-button type="link" @click="handleCreate">
@ -72,6 +72,7 @@
})
const [registerModal, { openModal }] = useModal()
const ShowView = ref(false)
const ShowViewLoading = ref(false)
const [registerTable, { reload, getSelectRows, setProps, getForm, getPaginationRef }] = useTable({
title: '',
api: async (p) => {
@ -82,6 +83,7 @@
res = await ApiList(p)
}
return new Promise((resolve) => {
ShowViewLoading.value = false
resolve({ data: [...res.data], total: res.count })
})
},
@ -106,6 +108,7 @@
},
})
async function ChangeView(e) {
ShowViewLoading.value = true
if (e) {
setProps({
columns: viewColumns,
@ -142,14 +145,13 @@
}
function handleAudit(record: Recordable) {
openModal(true, {
record,
// record: { clientId: props.clientId, ...record },
record: { ...record, id: ShowView.value ? record.templateId : record.id },
isUpdate: true,
})
}
function copyBooking(record) {
openModal(true, {
record,
record: { ...record, id: ShowView.value ? record.templateId : record.id },
isUpdate: false,
isCopy: true,
})
@ -165,7 +167,7 @@
return false
} else {
ApiData.ids = select.map((item) => {
return item.id
return ShowView.value ? item.templateId : item.id
})
}

@ -68,7 +68,7 @@ if (res14.succeeded) {
rmbAccountData = []
res14.data.forEach((e) => {
if (e.accountName && e.id) {
rmbAccountData.push({ label: e.accountName, value: e.id, ...e })
rmbAccountData.push({ label: `${e.bankName}-${e.bankAccountNo}`, value: e.id, ...e })
}
})
}
@ -78,7 +78,7 @@ if (res15.succeeded) {
usdAccountData = []
res15.data.forEach((e) => {
if (e.accountName && e.id) {
usdAccountData.push({ label: e.accountName, value: e.id, ...e })
usdAccountData.push({ label: `${e.bankName}-${e.bankAccountNo}`, value: e.id, ...e })
}
})
}
@ -1541,20 +1541,20 @@ export const Tablecolumns: BasicColumn[] = [
width: 120,
},
{
title: '银行地址',
title: '银行SWIFT',
dataIndex: 'bankAddress',
align: 'left',
width: 120,
},
{
title: '财务软件代码',
dataIndex: 'financeSoftCode',
title: '所在国',
dataIndex: 'countryName',
align: 'left',
width: 120,
},
{
title: '科目代码',
dataIndex: 'subjectCode',
title: '银行地址',
dataIndex: 'bankAddress',
align: 'left',
width: 120,
},
@ -1565,22 +1565,23 @@ export const Tablecolumns: BasicColumn[] = [
width: 120,
},
{
title: '银行账号',
dataIndex: 'bankAccountNo',
align: 'left',
width: 120,
},
{
title: '银行SWIFT',
dataIndex: 'swift',
title: '财务软件代码',
dataIndex: 'financeSoftCode',
align: 'left',
width: 120,
},
{
title: '所在国',
dataIndex: 'countryName',
title: '状态',
dataIndex: 'status',
align: 'left',
width: 120,
customRender: ({ text }) => {
if (text == 0) {
return <Tag color="success"></Tag>
} else {
return <Tag color="error"></Tag>
}
},
},
{
title: '是否开票默认账户',
@ -1595,6 +1596,49 @@ export const Tablecolumns: BasicColumn[] = [
}
},
},
{
title: '发票抬头',
dataIndex: 'invoiceHeader',
align: 'left',
width: 120,
},
{
title: '开票税号',
dataIndex: 'invoiceTaxNo',
align: 'left',
width: 120,
},
{
title: '开票地址',
dataIndex: 'invoiceAddress',
align: 'left',
width: 120,
},
{
title: '开票电话',
dataIndex: 'invoiceTel',
align: 'left',
width: 120,
},
{
title: '寄发票地址',
dataIndex: 'sendInvoiceAddress',
align: 'left',
width: 120,
},
{
title: '财务软件代码',
dataIndex: 'financeSoftCode',
align: 'left',
width: 120,
},
{
title: '科目代码',
dataIndex: 'subjectCode',
align: 'left',
width: 120,
},
{
title: '备注',
dataIndex: 'note',
@ -1653,36 +1697,6 @@ export const CADformSchema: FormSchema[] = [
component: 'Input',
colProps: { span: 6 },
},
{
field: 'bankAddress',
label: '银行地址',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'financeSoftCode',
label: '财务软件代码',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'subjectCode',
label: '科目代码',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'bankAgentName',
label: '代理银行名称',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'bankAccountNo',
label: '银行账号',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'swift',
label: '银行SWIFT',
@ -1701,7 +1715,6 @@ export const CADformSchema: FormSchema[] = [
label: '国家地区',
component: 'Select',
colProps: { span: 6 },
componentProps: ({ formModel }) => {
return {
options: ClientCountryList,
@ -1723,21 +1736,16 @@ export const CADformSchema: FormSchema[] = [
},
},
{
field: 'isInvoiceDefault',
label: '是否开票默认账户',
component: 'Switch',
field: 'bankAddress',
label: '银行地址',
component: 'Input',
colProps: { span: 12 },
},
{
field: 'bankAgentName',
label: '代理银行名称',
component: 'Input',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
// options: [
// { label: '是', value: true },
// { label: '否', value: false },
// ],
},
},
{
field: 'status',
@ -1752,10 +1760,88 @@ export const CADformSchema: FormSchema[] = [
unCheckedValue: 1,
},
},
{
field: 'isInvoiceDefault',
label: '是否开票默认账户',
component: 'Switch',
colProps: { span: 6 },
defaultValue: false,
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
},
{
label: '',
field: 'Space1',
component: 'Space',
colProps: {
span: 6,
},
},
{
field: 'invoiceHeader',
label: '发票抬头',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'invoiceTaxNo',
label: '开票税号',
component: 'Input',
colProps: { span: 6 },
},
// {
// field: 'invoiceTaxNo',
// label: '纳税人识别号',
// component: 'Input',
// colProps: { span: 6 },
// },
// {
// field: 'invoiceAddress',
// label: '开票地址/电话',
// component: 'Input',
// colProps: { span: 12 },
// },
{
field: 'invoiceAddress',
label: '开票地址',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'invoiceTel',
label: '开票电话',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'sendInvoiceAddress',
label: '寄发票地址',
component: 'Input',
colProps: { span: 12 },
},
{
field: 'financeSoftCode',
label: '财务软件代码',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'subjectCode',
label: '科目代码',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'note',
label: '备注',
component: 'Input',
colProps: { span: 18 },
component: 'InputTextArea',
colProps: { span: 24 },
componentProps: {
rows: 3,
},
},
]

@ -52,7 +52,7 @@
//
import { formSchema } from './columns'
//
import { ApiEdit, ApiBulkEdit, ApiInfo } from './api'
import { ApiEdit, ApiBulkEdit, ApiBulkEditDetails, ApiInfo } from './api'
import { feeUnitDict } from '/@/hooks/dict/index'
//
import { useMessage } from '/@/hooks/web/useMessage'
@ -74,14 +74,29 @@
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, getFieldsValue, validate, updateSchema }] =
useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const [
registerForm,
{
resetFields,
setFieldsValue,
appendSchemaByField,
removeSchemaByField,
getFieldsValue,
validate,
updateSchema,
},
] = useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const unitArr = ref<any>([])
const BulkInfoArr = ref<any>([])
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(
async (data) => {
unitArr.value.forEach((item) => {
removeSchemaByField(`${item}unitP`)
})
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
@ -152,13 +167,53 @@
feeField.value.condition = res.data.condition
// detailId.value = res.data.id
}
} else if (isBulk.value) {
detailId.value = ''
setFieldsValue({
customerName: props.customerName,
customerId: props.customerId,
isBulk: true,
})
//
const UnitList = await feeUnitDict()
unitArr.value.splice(0)
BulkInfoArr.value.splice(0)
ids.value.forEach(async (e) => {
const res: any = await ApiInfo({ id: unref(e) })
BulkInfoArr.value.push(res.data)
if (res.succeeded) {
res.data.details.forEach((item: any) => {
if (unitArr.value.indexOf(item.unit) == -1) {
unitArr.value.push(item.unit)
UnitList.forEach((Unit: any) => {
if (item.unit == Unit.value) {
appendSchemaByField(
[
{
field: `${Unit.value}unitP`,
label: `${Unit.label}含税单价`,
component: 'Input',
colProps: { span: 6 },
componentProps: {
placeholder: `${Unit.label}含税单价`,
},
},
],
undefined,
)
}
})
}
})
}
})
feeField.value.SetData([])
feeField.value.condition = ''
} else {
detailId.value = ''
setFieldsValue({
customerName: props.customerName,
customerId: props.customerId,
// saleOrgId: userStore.getUserInfo.userOrgs[0].orgId,
isBulk: isBulk.value ? true : false,
})
feeField.value.SetData([])
feeField.value.condition = ''
@ -187,13 +242,14 @@
detailId.value = res.data.id
}
}
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
const getTitle = computed(() =>
!unref(isUpdate) ? (!unref(isBulk) ? '新增' : '批量编辑') : '编辑',
)
//
const feeField = ref()
async function handleSave(exit) {
try {
const feeList = JSON.parse(JSON.stringify(feeField.value.validate()))
console.log(feeList, 11111111111)
let type = true
feeList.forEach((item) => {
if (item.exchangeRate == '【根据设置汇率生成】') {
@ -203,23 +259,30 @@
type = false
}
})
console.log(type, 11111111111)
if (!type) {
createMessage.warning('费用明细列表含税单价为必填项!')
throw new Error('费用明细列表含税单价为必填项!')
}
console.log(22222222)
const values = await validate()
console.log(values, 11111111111)
values['details'] = feeList
values['condition'] = feeField.value.condition
values['isShared'] = true
loading.value = true
console.log(loading.value, 11111111111)
setModalProps({ confirmLoading: true, loading: true })
let res: any = null
console.log(isBulk.value, 11111111111)
if (isBulk.value) {
let ApiDetailsData: any = []
//
BulkInfoArr.value.forEach((e) => {
e.details.forEach((item) => {
unitArr.value.forEach((item2) => {
if (item2 == item.unit && values[`${item2}unitP`]) {
ApiDetailsData.push({ ...item, taxUnitPrice: values[`${item2}unitP`] })
}
})
})
})
await ApiBulkEditDetails(ApiDetailsData)
let ApiData: any = []
ids.value.forEach((e) => {
ApiData.push({ ...values, id: e })

@ -10,6 +10,7 @@ import {
GetClientPortSelectList,
GetCarrierSelectList,
GetClientListByCode,
GetSupplierListByCode,
} from '/@/api/common'
import {
GetClientLanesSelectList,
@ -37,7 +38,7 @@ GetCarrierSelectList().then((res) => {
carrierIdList.value = res.data
})
const forwarderIdList = ref([])
GetAgentCnClientList().then((res) => {
GetSupplierListByCode().then((res) => {
forwarderIdList.value = res.data
})
const mblFrtCodeList = ref([])
@ -48,6 +49,10 @@ const businessTypeList = ref([])
getDictOption('business_type').then((res) => {
businessTypeList.value = res
})
const PortList = ref([])
GetClientPortSelectList().then((res) => {
PortList.value = res.data
})
// 业务来源明细数据
const sourceDetailId = ref<any>([])
export const columns: BasicColumn[] = [
@ -104,12 +109,32 @@ export const columns: BasicColumn[] = [
dataIndex: 'polCode',
sorter: true,
width: 200,
customRender: ({ record }) => {
let name = ''
PortList.value.some((item: any) => {
if (record.polCode == item.ediCode) {
name = `${item.cnName}/${item.portName}`
return true
}
})
return name
},
},
{
title: '卸货港',
dataIndex: 'podCode',
sorter: true,
width: 200,
customRender: ({ record }) => {
let name = ''
PortList.value.some((item: any) => {
if (record.podCode == item.ediCode) {
name = `${item.cnName}/${item.portName}`
return true
}
})
return name
},
},
{
title: '航线',
@ -163,12 +188,12 @@ export const columns: BasicColumn[] = [
dataIndex: 'forwarderId',
title: '订舱口',
sorter: true,
width: 200,
width: 280,
customRender: ({ record }) => {
let name = ''
forwarderIdList.value.some((item: any) => {
if (record.forwarderId == item.id) {
name = item.shortName
name = item.pinYinCode
return true
}
})
@ -307,12 +332,32 @@ export const viewColumns: BasicColumn[] = [
dataIndex: 'polCode',
sorter: true,
width: 200,
customRender: ({ record }) => {
let name = ''
PortList.value.some((item: any) => {
if (record.polCode == item.ediCode) {
name = `${item.cnName}/${item.portName}`
return true
}
})
return name
},
},
{
title: '卸货港',
dataIndex: 'podCode',
sorter: true,
width: 200,
customRender: ({ record }) => {
let name = ''
PortList.value.some((item: any) => {
if (record.podCode == item.ediCode) {
name = `${item.cnName}/${item.portName}`
return true
}
})
return name
},
},
{
dataIndex: 'laneName',
@ -578,16 +623,19 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
label: '订舱口',
field: 'forwarderId',
label: '订舱口',
component: 'ApiSelect',
required: false,
// labelSlot: 'yardId',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: GetAgentCnClientList,
labelField: 'shortName',
api: GetSupplierListByCode,
params: { code: 'Booking' },
labelField: 'pinYinCode',
showName: 'description',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
@ -847,16 +895,19 @@ export const viewSearchFormSchema: FormSchema[] = [
},
},
{
label: '订舱口',
field: 'forwarderId',
label: '订舱口',
component: 'ApiSelect',
required: false,
// labelSlot: 'yardId',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: GetAgentCnClientList,
labelField: 'shortName',
api: GetSupplierListByCode,
params: { code: 'Booking' },
labelField: 'pinYinCode',
showName: 'description',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
@ -1168,9 +1219,11 @@ export const formSchema: FormSchema[] = [
if (FnsourceDetailId.succeeded) {
sourceDetailId.value.splice(0)
FnsourceDetailId.data.forEach((e) => {
sourceDetailId.value.push({ label: e.detailName, value: e.id })
sourceDetailId.value.push({ label: e.detailName, value: e.id, ...e })
})
}
console.log(sourceDetailId.value)
if (formActionType) {
formModel.sourceDetailId = ''
}
@ -1233,16 +1286,19 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '订舱口',
field: 'forwarderId',
label: '订舱口',
component: 'ApiSelect',
required: false,
// labelSlot: 'yardId',
dynamicDisabled: false,
colProps: { span: 6 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: GetAgentCnClientList,
labelField: 'shortName',
api: GetSupplierListByCode,
params: { code: 'Booking' },
labelField: 'pinYinCode',
showName: 'description',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {

@ -11,10 +11,14 @@
<span class="iconfont icon-new_document"></span>
添加
</a-button>
<a-button type="link" @click="BulkEdit">
<a-button type="link" @click="copyRow">
<span class="iconfont icon-fuzhi"></span>
复制
</a-button>
<!-- <a-button type="link" @click="BulkEdit">
<span class="iconfont icon-dengjizongshu"></span>
批量编辑
</a-button>
</a-button> -->
<a-popconfirm
title="确定删除当前选中数据?"
ok-text="是"
@ -242,6 +246,7 @@
})
}
const loading = ref(false)
//
const addRow = () => {
list.value.push({
@ -405,6 +410,7 @@
data: 'unitPrice',
type: 'numeric',
format: '0.00',
readOnly: true,
},
{
title: '汇率',
@ -484,7 +490,7 @@
afterChange(changes, source) {
//
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict = {}
let dict: any = {}
changes.forEach((res) => {
//
if (changes[0][1] === 'customerName') {
@ -534,6 +540,9 @@
return changes[0][3].includes(item.name)
})
if (item) dict = item[0]
if (!/^[\u3400-\u9FBF]+$/.test(dict.label)) {
list.value[changes[0][0]]['isCtn'] = true
}
list.value[changes[0][0]]['unit'] = dict?.value
list.value[changes[0][0]]['unitText'] = dict?.label
}
@ -625,6 +634,13 @@
deep: true,
},
)
const copyRow = () => {
list.value.forEach((item: any) => {
if (item.selected) {
list.value.push({ ...item, id: '' })
}
})
}
//
const deleteRow = async () => {
// list.value.forEach((item: any, index) => {

@ -3,7 +3,7 @@
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="handleAudit">
<template #tableTitle>
<div class="ShowView">
<a-switch @change="ChangeView" v-model:checked="ShowView" />
<a-switch @change="ChangeView" v-model:checked="ShowView" :loading="ShowViewLoading" />
<span class="ShowViewText">按费用显示</span>
</div>
<a-button type="link" @click="handleCreate">
@ -71,6 +71,7 @@
})
const [registerModal, { openModal }] = useModal()
const ShowView = ref(false)
const ShowViewLoading = ref(false)
const [registerTable, { reload, getSelectRows, setProps, getForm, getPaginationRef }] = useTable({
title: '',
api: async (p) => {
@ -81,6 +82,7 @@
res = await ApiList(p)
}
return new Promise((resolve) => {
ShowViewLoading.value = false
resolve({ data: [...res.data], total: res.count })
})
},
@ -115,6 +117,7 @@
},
})
async function ChangeView(e) {
ShowViewLoading.value = true
if (e) {
setProps({
columns: viewColumns,
@ -161,14 +164,13 @@
}
function handleAudit(record: Recordable) {
openModal(true, {
record,
// record: { clientId: props.clientId, ...record },
record: { ...record, id: ShowView.value ? record.templateId : record.id },
isUpdate: true,
})
}
function copyBooking(record) {
openModal(true, {
record,
record: { ...record, id: ShowView.value ? record.templateId : record.id },
isUpdate: false,
isCopy: true,
})
@ -184,10 +186,9 @@
return false
} else {
ApiData.ids = select.map((item) => {
return item.id
return ShowView.value ? item.templateId : item.id
})
}
ApiDel(ApiData).then((res) => {
notification.success({ message: res.message, duration: 3 })
reload()

@ -148,4 +148,12 @@ export function PaymentFreeSettlementGetExchangesAsync(parameter) {
method: 'post',
data: parameter,
})
}
export function GetOrgBankList(parameter) {
return request({
url: '/mainApi/ClientCommon/GetOrgBankList',
method: 'get',
data: parameter,
})
}

@ -7,7 +7,7 @@ const feeDict = ref([])
import {
GetVesselSelectList,
} from '/@/views/operation/seaexport/api/BookingLedger'
import { GetOrgList, ClientCommonGetStlMode, GetClientBankList } from './api'
import { GetOrgList, ClientCommonGetStlMode, GetClientBankList,GetOrgBankList } from './api'
let businessType: any = [
{ value: 1, label: '海运出口' },
]
@ -430,29 +430,14 @@ export const detailForm: FormSchema[] = [
},
{
field: 'orgBankName',
label: '银行账号',
label: '收款账号',
colProps: { span: 4 },
component: 'ApiSelect',
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
const queryStr = [
{
FieldName: 'ClientId',
FieldValue: formModel.customerId,
ConditionalType: '0',
},
]
const data = {
pageCondition: {
pageIndex: 1,
pageSize: 20,
sortConditions: [],
},
queryCondition: JSON.stringify(queryStr),
}
GetClientBankList(data).then((res) => {
GetOrgBankList().then((res) => {
res.data.forEach(item=>{
item.showName = item.bankName + ' ' + item.bankAccountNo
})

@ -156,7 +156,6 @@ const [registerTable, { getForm, getSelectRows, setSelectedRowKeys }] = useTable
res.data.forEach((item, index) => {
item.freeIndex = String(index)
})
console.log(res.data)
}
if (route.query.type == 'invoice') {
res = await InvoiceSettlementGetInvoiceList(p)
@ -254,7 +253,7 @@ function getColumsDetail() {
function getSearch() {
if (route.query.type == 'invoice') {
return invoiceTableDetailColums
return invoiceSearchFormSchema
}
if (route.query.type == 'free') {
return freeSearchFormSchema

@ -191,7 +191,7 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'shipCertCheckOutDate',
field: 'checkOutDate',
label: '签出日期',
component: 'RangePicker',
colProps: { span: 4 },

@ -486,8 +486,11 @@ export const detailSearchFormSchema: FormSchema[] = [
return {
api: GetFeeCodeSelectList,
labelField: 'name',
valueField: 'code',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
}
},
},

@ -3,10 +3,11 @@
<a-modal width="1600px" @cancel="open = false" :visible="open" title="添加发票申请明细" :footer="null">
<div style="padding-bottom:5px ;">
<div>
<BasicTable class="ds-table" :rowClassName="rowClassName" @row-click="handleClick" @register="registerTable" @row-dbClick="(e) => {
GoDetailed(true, e)
}
">
<BasicTable class="ds-table" :row-selection="{ onChange: onSelectChange }"
:rowClassName="rowClassName" @row-click="handleClick" @register="registerTable" @row-dbClick="(e) => {
GoDetailed(true, e)
}
">
<template #right>
<div style="width: 40%;margin-left: 10px;margin-top:51px;">
<div>
@ -40,6 +41,13 @@
<div>
<div class="bold">申请开票明细</div>
<div style="display: flex;">
<div class="apply" :class="{ active: form.isRMB }">
<a-checkbox @change="handleChangeApply1"
:disabled="route.query.id ? true : false"
v-model:checked="form.isRMB">折算人民币申请</a-checkbox>
<span class="rmb" v-if="totalRmb != 0">{{ totalRmb }} RMB</span>
<span></span>
</div>
<div class="apply" :class="{ active: form.isYB }">
<a-checkbox :disabled="route.query.id ? true : false"
v-model:checked="form.isYB" @change="handleChangeApply">
@ -50,13 +58,6 @@
item.currency }}</span>
</a-checkbox>
</div>
<div class="apply" :class="{ active: form.isRMB }">
<a-checkbox @change="handleChangeApply1"
:disabled="route.query.id ? true : false"
v-model:checked="form.isRMB">折算人民币申请</a-checkbox>
<span class="rmb" v-if="totalRmb != 0">{{ totalRmb }} RMB</span>
<span></span>
</div>
</div>
<div>
<span class="bold">发票申请明细</span>
@ -74,24 +75,25 @@
<span v-if="record.businessType == 1"></span>
</template>
</template>
<template #footer>
<div class="main-statistic">
<span>选中合计</span>
<span class="box">
<span class="title">RMB未开:</span>
<span class="count">{{ rmbTotal }}</span>
</span>
<span class="box">
<span class="title">USD未开:</span>
<span class="count">{{ usdTotal }}</span>
</span>
<span class="box">
<span class="title">其他未开:</span>
<span class="count">{{ otherTotal }}</span>
</span>
</div>
</template>
</BasicTable>
<div class="total">
<span style="margin-right: 10px;">合计:</span>
<span class="total-item">
<span class="text">RMB未开:</span>
<span class="number">{{ rmbTotal }}</span>
</span>
<span class="total-item">
<span class="text">USD未开:</span>
<span class="number">{{ usdTotal }}</span>
</span>
<span class="total-item">
<span class="text">其他未开:</span>
<span class="number">{{ otherTotal }}</span>
</span>
</div>
</div>
</div>
</a-modal>
<a-modal width="400px" @cancel="exchangeFlag = false" @ok="handleSureExhange" :visible="exchangeFlag"
@ -188,6 +190,7 @@ const columns = [
]
const queryData = ref({}) as any
const dataSource = ref([]) as any
const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource, setLoading }] = useTable({
api: async (p) => {
const res: API.DataResult = await GetBizList(p)
@ -201,7 +204,7 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
beforeFetch: (p) => {
const data = formatParams(p)
data.otherQueryCondition = getForm().getFieldsValue().FeeRange
queryData.value = JSON.parse(JSON.stringify(p))
queryData.value = JSON.parse(JSON.stringify(formatParams(p)))
return data
},
columns: detailColumns,
@ -211,9 +214,9 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
},
useSearchForm: true,
showIndexColumn: false,
maxHeight: '600',
rowKey:'cindex',
id:'11',
maxHeight: 450,
rowKey: 'cindex',
id: '11',
pagination: true,
striped: true,
showTableSetting: true,
@ -228,7 +231,7 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
columns: columns,
useSearchForm: false,
showIndexColumn: false,
maxHeight: '600',
maxHeight: 450,
pagination: false,
dataSource: dataSource.value,
striped: true,
@ -238,16 +241,15 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
indexColumnProps: {
width: 60,
},
id:'22',
id: '22',
canResize: true,
immediate: false,
})
const exchangeFlag = ref(false)
const loading = ref(false)
const form = ref({
isYB: true,
isRMB: false
isYB: false,
isRMB: true
}) as any
function handleChangeApply(e) {
form.value.isRMB = !e.target.checked
@ -368,16 +370,38 @@ function handleSureExhange() {
}
}
const activeRow = ref(null)
//
function handleClick(record, index) {
setSelectedRowKeys([index])
activeRow.value = index
const queryDataStr = JSON.parse(queryData.value.queryCondition)
const arr = [] as any
queryDataStr.forEach(item => {
if (item.FieldName == 'feeType') {
arr.push(item)
}
if (item.FieldName == 'currency') {
arr.push(item)
}
if (item.FieldName == 'feeName') {
arr.push(item)
}
if (item.FieldName == 'FeeRange') {
arr.push(item)
}
})
const data = {
id: record.id,
businessType: record.businessType,
customerId: record.customerId
items: [
{
id: record.id,
businessType: record.businessType,
customerId: record.customerId
}
],
queryCondition: JSON.stringify(arr)
}
loading.value = true
InvoiceApplicationGetFees([data]).then(res => {
InvoiceApplicationGetFees(data).then(res => {
if (res.succeeded) {
dataSource.value = res.data.items
dataSource.value.forEach(item => {
@ -389,19 +413,15 @@ function handleClick(record, index) {
loading.value = false
})
}
function rowClassName(record, index){
if(index==activeRow.value){
function rowClassName(record, index) {
if (index == activeRow.value) {
return 'active-row'
}
}
function init(data) {
open.value = true
setTimeout(() => {
setProps({
rowSelection: {
onChange: onSelectChange
},
})
setPropsFee({
rowSelection: {
onChange: onSelectAmount
@ -420,6 +440,14 @@ function init(data) {
form.value.isYB = true
form.value.isRMB = false
}
watch(
() => getSelectRows(),
(data) => {
console.log(data)
onSelectChange(data)
},
{ immediate: false, deep: true }
)
}, 500)
}
const rmbTotal = ref(0)
@ -432,7 +460,7 @@ function onSelectChange(selectedRowKeys) {
otherTotal.value = 0
list.forEach(item => {
selectedRowKeys.forEach(ite => {
if (item.id == ite) {
if (item.id == ite.id) {
rmbTotal.value += Number(item.unBilledRMB)
usdTotal.value += Number(item.unBilledUSD)
otherTotal.value += Number(item.unBilledOther)
@ -537,14 +565,34 @@ function addDetailed() {
}
setLoading(true)
if (arrRight.length > 0 && form.value.isRMB) {
const data = [] as any
const items = [] as any
arrRight.forEach(item => {
data.push({
items.push({
id: item.id,
businessType: item.businessType,
customerId: item.customerId
})
})
const queryDataStr = JSON.parse(queryData.value.queryCondition)
const arr = [] as any
queryDataStr.forEach(item => {
if (item.FieldName == 'feeType') {
arr.push(item)
}
if (item.FieldName == 'currency') {
arr.push(item)
}
if (item.FieldName == 'feeName') {
arr.push(item)
}
if (item.FieldName == 'FeeRange') {
arr.push(item)
}
})
const data = {
items: items,
queryCondition: JSON.stringify(arr)
}
GetCurrencies(data).then(res => {
const cuArr = [] as any
currenciesData.value = res.data
@ -683,12 +731,49 @@ defineExpose({ init, changeCustIn })
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-disabled+span {
color: #257afa;
}
:deep(.active-row){
.ant-table-cell{
:deep(.active-row) {
.ant-table-cell {
background: #dfe8f6;
}
}
:deep(.flex){
:deep(.flex) {
align-items: flex-end !important;
}
:deep(.ant-table-footer) {
padding: 0px !important;
background: white;
}
:deep(.ant-table-container) {
padding: 0px;
}
.main-statistic {
background: #ffffff;
font-size: 12px;
height: 34px;
display: flex;
align-items: center;
.title {
font-size: 14px;
font-weight: 600;
}
.count {
font-size: 14px;
font-weight: 600;
color: #257AFA;
}
.box {
background: #F5F9FC;
margin-left: 10px;
padding: 0 5px;
}
}
</style>

@ -139,6 +139,7 @@ const [registerTable, { setTableData, setProps, getSelectRows, setLoading }] = u
indexColumnProps: {
width: 60,
},
id:'33',
canResize: true,
immediate: false,
})

@ -154,6 +154,7 @@ const [registerTable, { reload, getPaginationRef, getSelectRows, getRawDataSourc
indexColumnProps: {
width: 60,
},
id:'44',
canResize: true,
immediate: true,
actionColumn: {

@ -554,31 +554,41 @@ export const applySearch: FormSchema[] = [
colProps: { span: 4 },
},
{
field: 'customerName',
label: '开票单位',
field: 'customerId',
required: false,
component: 'ApiSelect',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
GetControllerClientList().then((res) => {
resolve(res)
})
})
},
immediate: true,
labelField: 'shortName',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
componentProps: ({ formModel }) => {
return {
allowClear: true,
showSearch: true,
api: GetClientListByCode,
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'shortName',
resultField: 'data',
immediate: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (e && obj) {
formModel.customerId = obj.id
}
if (!obj && !e) {
formModel.customerId = ''
}
},
}
},
},
{
field: 'customerId',
label: '',
component: 'Input',
show: false
},
{
field: 'createTime',
label: '申请日期',
@ -893,7 +903,7 @@ export const freeSearch: FormSchema[] = [
{
field: 'customerName',
label: '费用对象',
required: true,
required: false,
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: ({ formModel }) => {
@ -903,16 +913,15 @@ export const freeSearch: FormSchema[] = [
api: GetClientListByCode,
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'id',
valueField: 'shortName',
resultField: 'data',
immediate: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
console.log(e, obj)
if (e && obj) {
formModel.customerId = obj.label
formModel.customerId = obj.id
}
if (!obj && !e) {
formModel.customerId = ''
@ -995,7 +1004,7 @@ export const freeSearch: FormSchema[] = [
return {
api: GetFeeCodeSelectList,
labelField: 'name',
valueField: 'code',
valueField: 'id',
resultField: 'data',
}
},

@ -3,9 +3,10 @@
<a-modal width="1600px" @cancel="open = false" :visible="open" title="添加发票申请明细" :footer="null">
<div style="padding-bottom:5px ;">
<div>
<BasicTable class="ds-table" @row-click="handleClick" @register="registerTable">
<BasicTable :rowClassName="rowClassName" class="ds-table" @row-click="handleClick"
@register="registerTable">
<template #right>
<div style="width: 40%;margin-left: 10px;margin-top:10px;">
<div style="width: 40%;margin-left: 10px;">
<div>
<BasicTable class="ds-table" @register="registerTable1">
<template #tableTitle>
@ -74,7 +75,8 @@
<a-modal width="1600px" @cancel="freeFlag = false" :visible="freeFlag" title="添加发票申请明细" :footer="null">
<div style="padding-bottom:5px ;">
<div>
<BasicTable class="ds-table" @row-click="handleClickFree" @register="registerTableFree">
<BasicTable :rowClassName="rowClassName" class="ds-table" @row-click="handleClickFree"
@register="registerTableFree">
<template #right>
<div style="width: 40%;margin-left: 10px;">
<div>
@ -120,22 +122,24 @@
<span v-if="record.businessType == 1"></span>
</template>
</template>
<template #footer>
<div class="main-statistic">
<span>选中合计</span>
<span class="box">
<span class="title">RMB未开:</span>
<span class="count">{{ rmbTotal }}</span>
</span>
<span class="box">
<span class="title">USD未开:</span>
<span class="count">{{ usdTotal }}</span>
</span>
<span class="box">
<span class="title">其他未开:</span>
<span class="count">{{ otherTotal }}</span>
</span>
</div>
</template>
</BasicTable>
<div class="total">
<span style="margin-right: 10px;">合计:</span>
<span class="total-item">
<span class="text">RMB未开:</span>
<span class="number">{{ rmbTotal }}</span>
</span>
<span class="total-item">
<span class="text">USD未开:</span>
<span class="number">{{ usdTotal }}</span>
</span>
<span class="total-item">
<span class="text">其他未开:</span>
<span class="number">{{ otherTotal }}</span>
</span>
</div>
</div>
</div>
</a-modal>
@ -213,16 +217,17 @@ const columnsFreeDetail = [
]
const queryDataFree = ref({})
const queryDataFree = ref({}) as any
const dataSource = ref([]) as any
const freeDetailList = ref([]) as any
const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource, setLoading }] = useTable({
api: async (p) => {
const res: API.DataResult = await GetApplicationList(p)
res.data.forEach(item => {
res.data.forEach((item, index) => {
item.amountUSDTotal = item.amountUSD
item.amountOtherTotal = item.amountOther
item.amountRMBTotal = item.amountRMB
item.cindex = index
})
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
@ -240,6 +245,9 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
showIndexColumn: false,
maxHeight: '600',
pagination: true,
rowKey: 'cindex',
id: '11',
showTableSetting: true,
rowSelection: {},
striped: true,
bordered: true,
@ -258,6 +266,8 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
dataSource: dataSource.value,
striped: true,
rowKey: 'recordId',
id: '22',
showTableSetting: true,
bordered: true,
indexColumnProps: {
width: 60,
@ -269,13 +279,16 @@ const [registerTableFree, { getForm: getFormFree, setSelectedRowKeys: setSelecte
api: async (p) => {
const res: API.DataResult = await FreeInvoiceGetBizList(p)
return new Promise((resolve) => {
res.data.forEach((item, index) => {
item.cindex = index
})
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: (p) => {
const data = formatParams(p)
data.otherQueryCondition = getFormFree().getFieldsValue().FeeRange
queryDataFree.value = JSON.parse(JSON.stringify(p))
queryDataFree.value = formatParams(p)
return data
},
columns: freeColums,
@ -289,6 +302,9 @@ const [registerTableFree, { getForm: getFormFree, setSelectedRowKeys: setSelecte
useSearchForm: true,
showIndexColumn: false,
maxHeight: '600',
rowKey: 'cindex',
id: '33',
showTableSetting: true,
pagination: true,
striped: true,
bordered: true,
@ -310,10 +326,9 @@ const [registerTableFreeDetail, { getSelectRows: getSelectRowsFeeDetail, setProp
dataSource: freeDetailList.value,
striped: true,
rowKey: 'recordId',
rowSelection: {
// onChange: onSelectAmount
},
bordered: true,
id: '44',
showTableSetting: true,
indexColumnProps: {
width: 60,
},
@ -324,12 +339,10 @@ const rmbTotal = ref(0)
const usdTotal = ref(0)
const otherTotal = ref(0)
function onSelectChange(selectedRowKeys) {
const list = getSelectRowsFree()
console.log(list, selectedRowKeys)
rmbTotal.value = 0
usdTotal.value = 0
otherTotal.value = 0
list.forEach(item => {
selectedRowKeys.forEach(item => {
rmbTotal.value += Number(item.unBilledRMB)
usdTotal.value += Number(item.unBilledUSD)
otherTotal.value += Number(item.unBilledOther)
@ -344,6 +357,12 @@ function handleAddDetial() {
}
changeApply()
}
function rowClassName(record, index) {
console
if (index == activeRow.value) {
return 'active-row'
}
}
function changeApply() {
const arr = getSelectRowsFeeDetail()
const exchangeArr = [] as any
@ -398,9 +417,29 @@ function addDetailFree() {
customerId: item.customerId
})
})
const queryDataStr = JSON.parse(queryDataFree.value.queryCondition)
const arrQuery = [] as any
queryDataStr.forEach(item => {
if (item.FieldName == 'feeType') {
arr.push(item)
}
if (item.FieldName == 'currency') {
arr.push(item)
}
if (item.FieldName == 'feeName') {
arr.push(item)
}
if (item.FieldName == 'FeeRange') {
arr.push(item)
}
})
const data = {
items: freeList,
queryCondition: JSON.stringify(arrQuery)
}
currenciesData.value = []
exchangarr.value = []
GetCurrencies(freeList).then(res => {
GetCurrencies(data).then(res => {
const cuArr = [] as any
currenciesData.value = res.data
res.data.forEach(item => {
@ -522,8 +561,10 @@ function handleSureExhange() {
}
}
}
const activeRow = ref(null)
function handleClick(record, index) {
setSelectedRowKeys([record.id])
setSelectedRowKeys([index])
activeRow.value = index
const data = {
ids: [record.id],
businessType: record.businessType,
@ -542,14 +583,34 @@ function handleClick(record, index) {
})
}
function handleClickFree(record, index) {
setSelectedRowKeysFree([record.id])
setSelectedRowKeysFree([index])
const queryDataStr = JSON.parse(queryDataFree.value.queryCondition)
const arr = [] as any
queryDataStr.forEach(item => {
if (item.FieldName == 'feeType') {
arr.push(item)
}
if (item.FieldName == 'currency') {
arr.push(item)
}
if (item.FieldName == 'feeName') {
arr.push(item)
}
if (item.FieldName == 'FeeRange') {
arr.push(item)
}
})
const data = {
id: record.id,
businessType: record.businessType,
customerId: record.customerId
items: [{
id: record.id,
businessType: record.businessType,
customerId: record.customerId
}],
queryCondition: JSON.stringify(arr)
}
activeRow.value = index
loading.value = true
FreeInvoiceGetFees([data]).then(res => {
FreeInvoiceGetFees(data).then(res => {
if (res.succeeded) {
freeDetailList.value = res.data.items
freeDetailList.value.forEach(item => {
@ -568,7 +629,6 @@ function init(data) {
if (route.query.type == 'free') {
freeFlag.value = true
}
console.log(customerIdP.value)
setTimeout(() => {
if (customerIdP.value) {
if (route.query.type == 'free') {
@ -581,6 +641,13 @@ function init(data) {
})
}
}
watch(
() => getSelectRowsFree(),
(data) => {
onSelectChange(data)
},
{ immediate: false, deep: true }
)
}, 200)
}
@ -781,4 +848,45 @@ defineExpose({ init, customerIdP })
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-disabled+span {
color: #257afa;
}
:deep(.active-row) {
.ant-table-cell {
background: #dfe8f6;
}
}
:deep(.ant-table-footer) {
padding: 0px !important;
background: white;
}
:deep(.ant-table-container) {
padding: 0px;
}
.main-statistic {
background: #ffffff;
font-size: 12px;
height: 34px;
display: flex;
align-items: center;
.title {
font-size: 14px;
font-weight: 600;
}
.count {
font-size: 14px;
font-weight: 600;
color: #257AFA;
}
.box {
background: #F5F9FC;
margin-left: 10px;
padding: 0 5px;
}
}
</style>

@ -72,12 +72,15 @@
<a-button v-repeat type="link" v-if="route.query.id">
<span class="iconfont icon-ic_search24px"></span>查看发票
</a-button>
<a-button @click="openHand" v-repeat type="link" v-if="route.query.id">
<span class="iconfont icon-ic_search24px"></span>手动登记
</a-button>
</div>
</div>
<div class="content">
<div class="left">
<div class="left-top">
<div class="left-top-item" style="padding-right: 60px">
<div class="left-top-item">
<editCompent :showEdit="false" ref="editCompentRef" label="发票币别:">
<template #text>
<span> {{ form.currency }}</span>
@ -104,7 +107,7 @@
</template>
</editCompent>
</div>
<div class="left-top-item middle" style="padding-left: 9%;">
<div class="left-top-item middle" >
<a-dropdown>
<a style="color: rgba(158, 83, 9, 1);">
{{ getCategory() }}
@ -122,7 +125,7 @@
</template>
</a-dropdown>
</div>
<div class="left-top-item" style="padding-left: 120px">
<div class="left-top-item" >
<editCompent :showEdit="false" ref="editCompentRef" label="发票号:">
<template #text>
<span>{{ form.invoiceNO }}</span>
@ -366,8 +369,18 @@
</template>
</BasicTable>
</a-modal>
<a-modal width="600px" @cancel="handFlag = false" @ok="handFlag = false" :visible="handFlag" title="手工登记">
<a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
<a-form-item label="发票号">
<a-input v-model:value="form.invoiceNO" />
</a-form-item>
<a-form-item label="开票日期">
<a-date-picker size="small" style="width: 100%" valueFormat="YYYY-MM-DD"
v-model:value="form.invoiceDate" />
</a-form-item>
</a-form>
</a-modal>
<invoiceFile ref="invoiceFileRef"></invoiceFile>
</div>
</template>
<script lang="ts" setup>
@ -734,7 +747,6 @@ function handleSave() {
loading.value = false
})
}
}
function getDetail() {
loading.value = true
@ -772,6 +784,10 @@ function getDetail() {
loading.value = false
})
}
const handFlag = ref(false)
function openHand() {
handFlag.value = true
}
const invoiceFileRef = ref('')
function openFile() {
invoiceFileRef.value.init()
@ -1378,7 +1394,7 @@ watchEffect(() => {
margin-right: 5px;
font-weight: 400;
color: rgba(158, 83, 9, 1);
flex-shrink: 1;
flex-shrink: 0;
display: inline-block;
font-size: 12px;
min-width: 27px;

@ -709,7 +709,6 @@
if (val.cargoId) cargoId.value = val.cargoId
}
defineExpose({
// RefcargoFrom,
getFieldsValue,
updateSchema,
preOrderInit,

@ -337,10 +337,8 @@ export const mailingSchema: FormSchema[] = [
},
onChange: (e, obj) => {
if (e && obj) {
console.log(obj)
formModel.shipperId = obj.id
formModel.shipperContent = obj.content
formModel.shipperAddress = obj.address
formModel.shipperName = obj.name
formModel.shipperCountry = obj.country

File diff suppressed because it is too large Load Diff

@ -440,6 +440,22 @@ export const formSchema: FormSchema[] = [
span: 6,
},
},
{
field: 'IsSettlementOrg',
component: 'Switch',
label: '是否结算机构',
required: false,
componentProps: {
options: [
{ label: '是', value: 0 },
{ label: '否', value: 1 },
],
},
defaultValue: true,
colProps: {
span: 6,
},
},
{
field: 'files',
slot: 'files',

Loading…
Cancel
Save