|
|
|
@ -61,6 +61,8 @@
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
// 引入字典接口
|
|
|
|
|
import { getDictOption } from '/@/utils/dictUtil'
|
|
|
|
|
// 汇率列表接口
|
|
|
|
|
import { GetFeeCurrencyExchangeList } from '/@/views/fee/exchangeRate/api'
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
defineComponent({
|
|
|
|
|
HotTable,
|
|
|
|
@ -131,6 +133,7 @@
|
|
|
|
|
feeEnName: '',
|
|
|
|
|
quantity: 1,
|
|
|
|
|
exchangeRate: 1,
|
|
|
|
|
taxRate: 0,
|
|
|
|
|
feeType: props.tbType == 'receive' ? 1 : 2,
|
|
|
|
|
}
|
|
|
|
|
// 表格绑定数据
|
|
|
|
@ -483,14 +486,32 @@
|
|
|
|
|
list.value[changes[0][0]]['feeId'] = dict['id']
|
|
|
|
|
list.value[changes[0][0]]['feeEnName'] = dict['enName']
|
|
|
|
|
list.value[changes[0][0]]['currency'] = dict['defaultCurrency']
|
|
|
|
|
list.value[changes[0][0]]['customerTypeText'] = dict['defaultDebitName']
|
|
|
|
|
list.value[changes[0][0]]['customerType'] = dict['defaultDebit']
|
|
|
|
|
list.value[changes[0][0]]['isOpen'] = dict['isOpen']
|
|
|
|
|
list.value[changes[0][0]]['isAdvancedPay'] = dict['isAdvancedPay']
|
|
|
|
|
list.value[changes[0][0]]['isInvoice'] = dict['isInvoice']
|
|
|
|
|
list.value[changes[0][0]]['feeFrt'] = dict['feeFrt']
|
|
|
|
|
list.value[changes[0][0]]['feeCode'] = dict['code']
|
|
|
|
|
list.value[changes[0][0]]['taxRate'] = dict['taxRate']
|
|
|
|
|
// 根据币别带出汇率
|
|
|
|
|
if (dict['defaultCurrency']) {
|
|
|
|
|
exchangeRateList.forEach(res => {
|
|
|
|
|
if (res.currencyCode == dict['defaultCurrency']) {
|
|
|
|
|
if (props.tbType == 'receive') {
|
|
|
|
|
list.value[changes[0][0]].exchangeRate = res.drValue
|
|
|
|
|
} else {
|
|
|
|
|
list.value[changes[0][0]].exchangeRate = res.crValue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 应收应付带出不同的默认设置客户类型和结算单位
|
|
|
|
|
if (props.tbType == 'receive') {
|
|
|
|
|
list.value[changes[0][0]]['customerTypeText'] = dict['defaultDebitName']
|
|
|
|
|
list.value[changes[0][0]]['customerType'] = dict['defaultDebit']
|
|
|
|
|
} else {
|
|
|
|
|
list.value[changes[0][0]]['customerTypeText'] = dict['defaultCreditName']
|
|
|
|
|
list.value[changes[0][0]]['customerType'] = dict['defaultCredit']
|
|
|
|
|
}
|
|
|
|
|
// 费用代码维护的单位标准是箱型,默认带出集装箱表格第一条数据,否则带出默认标准
|
|
|
|
|
if (dict.defaultUnit == 'XX') {
|
|
|
|
|
if (props?.details?.ctnInfo && props?.details?.ctnInfo?.length) {
|
|
|
|
@ -589,12 +610,17 @@
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 修改币别
|
|
|
|
|
if (changes[0][1] === 'currencyName') {
|
|
|
|
|
const item = currencyDict.value.filter((item) => {
|
|
|
|
|
return item.name === changes[0][3]
|
|
|
|
|
if (changes[0][1] === 'currency') {
|
|
|
|
|
// 根据币别带出汇率
|
|
|
|
|
exchangeRateList.forEach(res => {
|
|
|
|
|
if (res.currencyCode == changes[0][3]) {
|
|
|
|
|
if (props.tbType == 'receive') {
|
|
|
|
|
list.value[changes[0][0]].exchangeRate = res.drValue
|
|
|
|
|
} else {
|
|
|
|
|
list.value[changes[0][0]].exchangeRate = res.crValue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (item) dict = item[0]
|
|
|
|
|
list.value[changes[0][0]]['currency'] = dict?.codeName
|
|
|
|
|
}
|
|
|
|
|
// 当前操作的行
|
|
|
|
|
const index = changes[0][0]
|
|
|
|
@ -659,9 +685,10 @@
|
|
|
|
|
const postData = {
|
|
|
|
|
BusinessId: props.id,
|
|
|
|
|
items: list.value.filter((res) => {
|
|
|
|
|
if (!res.taxRate) res.taxRate = 0
|
|
|
|
|
return res.feeStatus == 1 || res.feeStatus == 6
|
|
|
|
|
}),
|
|
|
|
|
businessType: 1,
|
|
|
|
|
businessType: 1
|
|
|
|
|
}
|
|
|
|
|
// 如果不存在可保存数据限制保存按钮(后台会报错,这块后台也存在问题,现在前端限制)
|
|
|
|
|
if (postData.items.length == 0) return createMessage.warning('暂无可保存的数据!')
|
|
|
|
@ -772,9 +799,8 @@
|
|
|
|
|
if (data.customerTypeText == item[0].defaultCreditName) {
|
|
|
|
|
data.customerTypeText = item[0].defaultDebitName
|
|
|
|
|
data.customerType = item[0].defaultDebit
|
|
|
|
|
}
|
|
|
|
|
// 如果当前所选的这一行数据是应付,则把客户类型和客户换成默认应收的数据
|
|
|
|
|
if (data.customerTypeText == item[0].defaultDebitName) {
|
|
|
|
|
} else if (data.customerTypeText == item[0].defaultDebitName) {
|
|
|
|
|
// 如果当前所选的这一行数据是应付,则把客户类型和客户换成默认应收的数据
|
|
|
|
|
data.customerTypeText = item[0].defaultCreditName
|
|
|
|
|
data.customerType = item[0].defaultCredit
|
|
|
|
|
}
|
|
|
|
@ -790,7 +816,9 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
emits('broInsert', res)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
emits('broInsert', res)
|
|
|
|
|
}, 200)
|
|
|
|
|
} else {
|
|
|
|
|
// 全部插入
|
|
|
|
|
selectData.forEach((item) => {
|
|
|
|
@ -825,6 +853,8 @@
|
|
|
|
|
list.value = res
|
|
|
|
|
hotTb.value.hotInstance.loadData(res)
|
|
|
|
|
}
|
|
|
|
|
// 存储币别汇率列表数据
|
|
|
|
|
let exchangeRateList = []
|
|
|
|
|
// 页面初始化
|
|
|
|
|
const init = () => {
|
|
|
|
|
loading.value = true
|
|
|
|
@ -894,6 +924,17 @@
|
|
|
|
|
.catch(() => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
// 获取汇率列表数据
|
|
|
|
|
GetFeeCurrencyExchangeList({
|
|
|
|
|
"queryCondition": "[]",
|
|
|
|
|
"pageCondition": {
|
|
|
|
|
"pageIndex": 1,
|
|
|
|
|
"pageSize": 100,
|
|
|
|
|
"sortConditions": []
|
|
|
|
|
}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
exchangeRateList = res.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 增加行
|
|
|
|
|
const add = () => {
|
|
|
|
@ -939,6 +980,7 @@
|
|
|
|
|
(row) => {
|
|
|
|
|
row.forEach((item) => {
|
|
|
|
|
list.value.push(item)
|
|
|
|
|
hotTb.value.hotInstance.loadData(list.value)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|