diff --git a/src/api/common/index.ts b/src/api/common/index.ts
index 7d042e64..1c3c18fa 100644
--- a/src/api/common/index.ts
+++ b/src/api/common/index.ts
@@ -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({
diff --git a/src/views/baseinfo/infoclient/ClientAccountDateModal.vue b/src/views/baseinfo/infoclient/ClientAccountDateModal.vue
index 945df593..b2010f54 100644
--- a/src/views/baseinfo/infoclient/ClientAccountDateModal.vue
+++ b/src/views/baseinfo/infoclient/ClientAccountDateModal.vue
@@ -8,42 +8,6 @@
@ok="handleSave"
>
-
-
-
-
- 新增
-
-
-
-
- 删除
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/baseinfo/infoclient/EditColumns.tsx b/src/views/baseinfo/infoclient/EditColumns.tsx
index cc9ab315..25d9c732 100644
--- a/src/views/baseinfo/infoclient/EditColumns.tsx
+++ b/src/views/baseinfo/infoclient/EditColumns.tsx
@@ -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[] = [
diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/TenantAuditStepModal.vue b/src/views/baseinfo/infoclient/FeeCustTemplate/TenantAuditStepModal.vue
index eaa08723..f0cea9a9 100644
--- a/src/views/baseinfo/infoclient/FeeCustTemplate/TenantAuditStepModal.vue
+++ b/src/views/baseinfo/infoclient/FeeCustTemplate/TenantAuditStepModal.vue
@@ -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([])
+ const BulkInfoArr = ref([])
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 })
diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx b/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx
index b8684c21..452b84eb 100644
--- a/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx
+++ b/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx
@@ -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([])
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) => {
diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue b/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue
index 2fea6708..85bf45c1 100644
--- a/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue
+++ b/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue
@@ -11,10 +11,14 @@
添加
-
+
+
+ 复制
+
+
([])
// 费用名称字典
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) => {
diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/index.vue b/src/views/baseinfo/infoclient/FeeCustTemplate/index.vue
index 8b01bfc3..b0b7dd85 100644
--- a/src/views/baseinfo/infoclient/FeeCustTemplate/index.vue
+++ b/src/views/baseinfo/infoclient/FeeCustTemplate/index.vue
@@ -4,7 +4,7 @@
@@ -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
})
}
diff --git a/src/views/baseinfo/infoclient/columns.tsx b/src/views/baseinfo/infoclient/columns.tsx
index 1c5ed863..952265a6 100644
--- a/src/views/baseinfo/infoclient/columns.tsx
+++ b/src/views/baseinfo/infoclient/columns.tsx
@@ -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 启用
+ } else {
+ return 禁用
+ }
+ },
},
{
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,
+ },
},
]
diff --git a/src/views/fee/FeeCustTemplate/TenantAuditStepModal.vue b/src/views/fee/FeeCustTemplate/TenantAuditStepModal.vue
index 6323a252..58abf45a 100644
--- a/src/views/fee/FeeCustTemplate/TenantAuditStepModal.vue
+++ b/src/views/fee/FeeCustTemplate/TenantAuditStepModal.vue
@@ -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([])
+ const BulkInfoArr = ref([])
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 })
diff --git a/src/views/fee/FeeCustTemplate/columns.tsx b/src/views/fee/FeeCustTemplate/columns.tsx
index 4490383f..312c07f4 100644
--- a/src/views/fee/FeeCustTemplate/columns.tsx
+++ b/src/views/fee/FeeCustTemplate/columns.tsx
@@ -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([])
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) => {
@@ -1233,16 +1284,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) => {
diff --git a/src/views/fee/FeeCustTemplate/feeField.vue b/src/views/fee/FeeCustTemplate/feeField.vue
index fd5989d4..234b40cc 100644
--- a/src/views/fee/FeeCustTemplate/feeField.vue
+++ b/src/views/fee/FeeCustTemplate/feeField.vue
@@ -11,10 +11,14 @@
添加
-
+
+
+ 复制
+
+
{
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) => {
diff --git a/src/views/fee/FeeCustTemplate/index.vue b/src/views/fee/FeeCustTemplate/index.vue
index 3d946afe..2f68648e 100644
--- a/src/views/fee/FeeCustTemplate/index.vue
+++ b/src/views/fee/FeeCustTemplate/index.vue
@@ -3,7 +3,7 @@
@@ -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()