|
|
|
@ -8,14 +8,20 @@
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<h2>费用字段</h2>
|
|
|
|
|
<div>
|
|
|
|
|
<a-button type="primary" size="small" @click="addRow">添加</a-button>
|
|
|
|
|
<a-button type="link" @click="addRow">
|
|
|
|
|
<span class="iconfont icon-new_document"></span>
|
|
|
|
|
添加
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
title="确定删除当前选中的费用字段?"
|
|
|
|
|
title="确定删除当前选中数据?"
|
|
|
|
|
ok-text="是"
|
|
|
|
|
cancel-text="否"
|
|
|
|
|
@confirm="deleteRow"
|
|
|
|
|
>
|
|
|
|
|
<a-button class="ml10" size="small" type="error">删除</a-button>
|
|
|
|
|
<a-button type="link">
|
|
|
|
|
<span class="iconfont icon-shanchu21"></span>
|
|
|
|
|
删除
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -23,12 +29,7 @@
|
|
|
|
|
<div style="position: relative">
|
|
|
|
|
<input class="ds-tb-check" type="checkbox" v-model="allCheck" :indeterminate="someCheck" />
|
|
|
|
|
<hot-table ref="hotTb" :data="list" :settings="settings">
|
|
|
|
|
<img
|
|
|
|
|
v-show="!list.length"
|
|
|
|
|
class="hot-tb-no-data"
|
|
|
|
|
src="../../../../assets/images/nodata.png"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
<img v-show="!list.length" src="../../../../assets/images/nodata.png" alt="">
|
|
|
|
|
</hot-table>
|
|
|
|
|
</div>
|
|
|
|
|
</a-spin>
|
|
|
|
@ -51,6 +52,8 @@
|
|
|
|
|
GetFeeCodeSelectList,
|
|
|
|
|
GetClientListByCode,
|
|
|
|
|
GetFeeCurrencySelectList,
|
|
|
|
|
GetClientSelectInfoByCode,
|
|
|
|
|
GetUnitSelectInfo
|
|
|
|
|
} from '/@/api/common'
|
|
|
|
|
import { GetFeeTemplateDetailList, BatchDelFeeTemplateDetail } from '../api'
|
|
|
|
|
// 引入计费标准字典
|
|
|
|
@ -120,11 +123,6 @@
|
|
|
|
|
className: 'htCenter',
|
|
|
|
|
readOnly: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
width: 130,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '费用名称',
|
|
|
|
|
width: 130,
|
|
|
|
@ -134,8 +132,9 @@
|
|
|
|
|
source: async (query, process) => {
|
|
|
|
|
const res = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
|
|
|
|
|
if (!feeDict.value.length) feeDict.value = res
|
|
|
|
|
console.log(res)
|
|
|
|
|
const dict = res.map((res) => {
|
|
|
|
|
return res.name
|
|
|
|
|
return res.code + '-' + res.name
|
|
|
|
|
})
|
|
|
|
|
process(dict)
|
|
|
|
|
},
|
|
|
|
@ -155,43 +154,40 @@
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '结算对象',
|
|
|
|
|
title: '客户类别',
|
|
|
|
|
width: 130,
|
|
|
|
|
data: 'customerName',
|
|
|
|
|
data: 'customerTypeText',
|
|
|
|
|
type: 'dropdown',
|
|
|
|
|
source: async (query, process) => {
|
|
|
|
|
// 获取当前选中行
|
|
|
|
|
const rowIndex = hotTb.value.hotInstance.countRows()
|
|
|
|
|
const code = list.value[rowIndex - 1].customerType
|
|
|
|
|
if (code) {
|
|
|
|
|
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.shortName
|
|
|
|
|
})
|
|
|
|
|
process(dict)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
process([])
|
|
|
|
|
}
|
|
|
|
|
const results = await getDictOption('djy_cust_prop')
|
|
|
|
|
console.log(results)
|
|
|
|
|
const dict = results.map((item) => {
|
|
|
|
|
return item.value + '-' + item.name
|
|
|
|
|
})
|
|
|
|
|
process(dict)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '客户类别',
|
|
|
|
|
title: '结算对象',
|
|
|
|
|
width: 130,
|
|
|
|
|
data: 'customerTypeText',
|
|
|
|
|
data: 'customerName',
|
|
|
|
|
type: 'dropdown',
|
|
|
|
|
source: async (query, process) => {
|
|
|
|
|
const results = await getDictOption('djy_cust_prop')
|
|
|
|
|
const dict = results.map((item) => {
|
|
|
|
|
return item.name
|
|
|
|
|
// 获取当前选中行
|
|
|
|
|
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)
|
|
|
|
|
})
|
|
|
|
|
process(dict)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -202,23 +198,23 @@
|
|
|
|
|
source: async (query, process) => {
|
|
|
|
|
if (unitDict.value && unitDict.value.length) {
|
|
|
|
|
const dict = unitDict.value.map((item) => {
|
|
|
|
|
return item.name
|
|
|
|
|
return item.value + '-' + item.name
|
|
|
|
|
})
|
|
|
|
|
process(dict)
|
|
|
|
|
} else {
|
|
|
|
|
const results = await feeUnitDict()
|
|
|
|
|
unitDict.value = results
|
|
|
|
|
const dict = results.map((item) => {
|
|
|
|
|
return item.name
|
|
|
|
|
return item.value + '-' + item.name
|
|
|
|
|
})
|
|
|
|
|
process(dict)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '不含税单价',
|
|
|
|
|
title: '税率',
|
|
|
|
|
width: 120,
|
|
|
|
|
data: 'noTaxPrice',
|
|
|
|
|
data: 'taxRate',
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -236,10 +232,11 @@
|
|
|
|
|
format: '0',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '金额',
|
|
|
|
|
title: '不含税单价',
|
|
|
|
|
width: 120,
|
|
|
|
|
data: 'amount',
|
|
|
|
|
data: 'noTaxPrice',
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '不含税金额',
|
|
|
|
@ -247,24 +244,14 @@
|
|
|
|
|
data: 'noTaxAmount',
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
format: '0.00',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '税率',
|
|
|
|
|
width: 120,
|
|
|
|
|
data: 'taxRate',
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '汇率',
|
|
|
|
|
title: '金额',
|
|
|
|
|
width: 120,
|
|
|
|
|
data: 'exchangeRate',
|
|
|
|
|
data: 'amount',
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '备注',
|
|
|
|
|
width: 120,
|
|
|
|
|
data: 'note',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '币别',
|
|
|
|
|
width: 80,
|
|
|
|
@ -283,12 +270,35 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '汇率',
|
|
|
|
|
width: 120,
|
|
|
|
|
data: 'exchangeRate',
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '备注',
|
|
|
|
|
width: 120,
|
|
|
|
|
data: 'note',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '销项税率',
|
|
|
|
|
width: 100,
|
|
|
|
|
data: 'accTaxRate',
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '销项税额',
|
|
|
|
|
width: 100,
|
|
|
|
|
data: 'accTaxAmount',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '销项金额',
|
|
|
|
|
width: 100,
|
|
|
|
|
data: 'accAmount',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '是否机密',
|
|
|
|
|
width: 100,
|
|
|
|
@ -314,21 +324,84 @@
|
|
|
|
|
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 = {
|
|
|
|
|
height: '400',
|
|
|
|
|
height: 300,
|
|
|
|
|
width: '100%',
|
|
|
|
|
autoWrapRow: true,
|
|
|
|
|
autoWrapCol: true,
|
|
|
|
|
// 每行的高度
|
|
|
|
|
rowHeights: 32,
|
|
|
|
|
fixedColumnsLeft: 1,
|
|
|
|
|
// 需要隐藏的列
|
|
|
|
|
hiddenColumns: {
|
|
|
|
|
columns: [1],
|
|
|
|
|
indicators: true,
|
|
|
|
|
},
|
|
|
|
|
// 控制回车移动
|
|
|
|
|
enterMoves: 'row',
|
|
|
|
|
columnSorting: true,
|
|
|
|
|
// 设置排序的列和方向
|
|
|
|
|
// columnSorting: {
|
|
|
|
@ -339,12 +412,16 @@
|
|
|
|
|
afterValidate: function (isValid, value, row, prop, source) {
|
|
|
|
|
if (!isValid) {
|
|
|
|
|
hotTb.value.hotInstance.setDataAtRowProp(row, prop, '')
|
|
|
|
|
// if (/^noTaxPrice|unitPrice|noTaxAmount|taxRate|exchangeRate$/.test(prop)) {
|
|
|
|
|
// if (!isNaN(value)) {
|
|
|
|
|
// hotTb.value.hotInstance.setDataAtRowProp(row, prop, value.toFixed(2))
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
columns: columns,
|
|
|
|
|
// 此行直接复制,必须(非商用)
|
|
|
|
|
licenseKey: 'non-commercial-and-evaluation',
|
|
|
|
|
enterMoves: 'row',
|
|
|
|
|
// 定义所有单元格发生变化的回调处理
|
|
|
|
|
afterChange(changes, source) {
|
|
|
|
|
// 这里定义了编辑,自动填充和拷贝数据的处理逻辑
|
|
|
|
@ -355,9 +432,10 @@
|
|
|
|
|
if (res[1] === 'feeName') {
|
|
|
|
|
// 获取当前选中的字典对象数据
|
|
|
|
|
const item = feeDict.value.filter((item) => {
|
|
|
|
|
return item.name === changes[0][3]
|
|
|
|
|
return changes[0][3].includes(item.name)
|
|
|
|
|
})
|
|
|
|
|
if (item) dict = item[0]
|
|
|
|
|
list.value[res[0]]['feeName'] = changes[0][3].split('-')[1]
|
|
|
|
|
list.value[res[0]]['feeEnName'] = dict['enName']
|
|
|
|
|
list.value[res[0]]['currency'] = dict['defaultCurrency']
|
|
|
|
|
list.value[res[0]]['unitText'] = dict['defaultUnitName']
|
|
|
|
@ -375,23 +453,53 @@
|
|
|
|
|
// 修改费用英文名称
|
|
|
|
|
if (changes[0][1] === 'feeEnName') {
|
|
|
|
|
}
|
|
|
|
|
// 修改费用对象
|
|
|
|
|
if (changes[0][1] === 'customerName') {
|
|
|
|
|
const item = companyDict.value.filter((item) => {
|
|
|
|
|
return changes[0][3].includes(item.name)
|
|
|
|
|
})
|
|
|
|
|
if (item) dict = item[0]
|
|
|
|
|
list.value[changes[0][0]]['customerCode'] = dict?.value
|
|
|
|
|
list.value[changes[0][0]]['customerName'] = changes[0][3].split('-')[1]
|
|
|
|
|
console.log(changes[0][3])
|
|
|
|
|
}
|
|
|
|
|
// 修改客户类别
|
|
|
|
|
if (changes[0][1] === 'customerTypeText') {
|
|
|
|
|
getDictOption('djy_cust_prop').then((res) => {
|
|
|
|
|
const item = res.filter((item) => {
|
|
|
|
|
return item.name === changes[0][3]
|
|
|
|
|
return changes[0][3].includes(item.name)
|
|
|
|
|
})
|
|
|
|
|
if (item) dict = item[0]
|
|
|
|
|
list.value[changes[0][0]]['customerType'] = dict?.value
|
|
|
|
|
list.value[changes[0][0]]['customerTypeText'] = changes[0][3].split('-')[1]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 修改单位
|
|
|
|
|
if (changes[0][1] === 'unitText') {
|
|
|
|
|
const item = unitDict.value.filter((item) => {
|
|
|
|
|
return item.name === changes[0][3]
|
|
|
|
|
return changes[0][3].includes(item.name)
|
|
|
|
|
})
|
|
|
|
|
if (item) dict = item[0]
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 修改币别
|
|
|
|
|
if (changes[0][1] === 'currencyName') {
|
|
|
|
@ -406,57 +514,78 @@
|
|
|
|
|
// 修改不含税单价计算
|
|
|
|
|
if (changes[0][1] === 'noTaxPrice') {
|
|
|
|
|
// 单价
|
|
|
|
|
list.value[index].unitPrice =
|
|
|
|
|
(changes[0][3] || 0) * ((list.value[index].taxRate || 0) / 100 + 1)
|
|
|
|
|
list.value[index].unitPrice = Number(
|
|
|
|
|
(changes[0][3] || 0) * ((list.value[index].taxRate || 0) / 100 + 1),
|
|
|
|
|
).toFixed(6)
|
|
|
|
|
// 金额
|
|
|
|
|
list.value[index].amount =
|
|
|
|
|
(list.value[index].unitPrice || 0) * (list.value[index].quantity || 0)
|
|
|
|
|
list.value[index].amount = Number(
|
|
|
|
|
(list.value[index].unitPrice || 0) * (list.value[index].quantity || 0),
|
|
|
|
|
).toFixed(6)
|
|
|
|
|
// 不含税金额
|
|
|
|
|
list.value[index].noTaxAmount = (changes[0][3] || 0) * (list.value[index].quantity || 0)
|
|
|
|
|
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 =
|
|
|
|
|
(changes[0][3] || 0) / ((list.value[index].taxRate || 0) / 100 + 1)
|
|
|
|
|
list.value[index].noTaxPrice = Number(
|
|
|
|
|
(changes[0][3] || 0) / ((list.value[index].taxRate || 0) / 100 + 1),
|
|
|
|
|
).toFixed(6)
|
|
|
|
|
// 金额
|
|
|
|
|
list.value[index].amount = (changes[0][3] || 0) * (list.value[index].quantity || 0)
|
|
|
|
|
list.value[index].amount = Number(
|
|
|
|
|
(changes[0][3] || 0) * (list.value[index].quantity || 0),
|
|
|
|
|
).toFixed(6)
|
|
|
|
|
// 不含税金额
|
|
|
|
|
list.value[index].noTaxAmount =
|
|
|
|
|
(list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0)
|
|
|
|
|
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 = (changes[0][3] || 0) * (list.value[index].unitPrice || 0)
|
|
|
|
|
list.value[index].amount = Number(
|
|
|
|
|
(changes[0][3] || 0) * (list.value[index].unitPrice || 0),
|
|
|
|
|
).toFixed(6)
|
|
|
|
|
// 不含税金额
|
|
|
|
|
list.value[index].noTaxAmount = (changes[0][3] || 0) * (list.value[index].noTaxPrice || 0)
|
|
|
|
|
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 =
|
|
|
|
|
(list.value[index].unitPrice || 0) / ((changes[0][3] || 0) / 100 + 1)
|
|
|
|
|
list.value[index].noTaxPrice = Number(
|
|
|
|
|
(list.value[index].unitPrice || 0) / ((changes[0][3] || 0) / 100 + 1),
|
|
|
|
|
).toFixed(6)
|
|
|
|
|
// 不含税金额
|
|
|
|
|
list.value[index].noTaxAmount =
|
|
|
|
|
(list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0)
|
|
|
|
|
list.value[index].noTaxAmount = Number(
|
|
|
|
|
(list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0),
|
|
|
|
|
).toFixed(6)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
const setTableData = () => {
|
|
|
|
|
const data = inject('temFieldData')
|
|
|
|
|
if (data) {
|
|
|
|
|
list.value = data.value
|
|
|
|
|
hotTb.value.hotInstance.loadData(data.value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
defineExpose({
|
|
|
|
|
validate,
|
|
|
|
|
})
|
|
|
|
|
// 需要定义新增的行数据(后台需要)
|
|
|
|
|
const row = {
|
|
|
|
|
selected: false,
|
|
|
|
|
feeStatus: '1',
|
|
|
|
|
feeStatusText: '录入状态',
|
|
|
|
|
id: '',
|
|
|
|
|
businessId: '',
|
|
|
|
|
feeCode: '',
|
|
|
|
|
feeName: '',
|
|
|
|
|
feeEnName: '',
|
|
|
|
|
quantity: 1,
|
|
|
|
|
exchangeRate: 1,
|
|
|
|
|
feeType: props.tbType == 'receive' ? 1 : 2,
|
|
|
|
|
}
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
setTableData()
|
|
|
|
|
const hot = hotTb.value.hotInstance
|
|
|
|
|
hot.addHook('afterOnCellMouseDown', function (event, coords, TD) {})
|
|
|
|
|
// 定义表格按键处理逻辑
|
|
|
|
|
hot.addHook('beforeKeyDown', function (event) {
|
|
|
|
|
// 检查按下的是否是特定的键(例如 'Enter')
|
|
|
|
@ -464,7 +593,7 @@
|
|
|
|
|
if (hot.getSelected()[0][0] == list.value.length - 1 && !hot.getActiveEditor()?._opened) {
|
|
|
|
|
list.value.push(JSON.parse(JSON.stringify(row)))
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
hot.selectCell(list.value.length - 1, 3)
|
|
|
|
|
hot.selectCell(list.value.length - 1, 4)
|
|
|
|
|
})
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
@ -531,9 +660,11 @@
|
|
|
|
|
{ FieldName: 'TemplateId', FieldValue: v, ConditionalType: 1 },
|
|
|
|
|
]),
|
|
|
|
|
}
|
|
|
|
|
const res = await GetFeeTemplateDetailList(postData)
|
|
|
|
|
list.value = res.data
|
|
|
|
|
hotTb.value.hotInstance.loadData(res.data)
|
|
|
|
|
if (v) {
|
|
|
|
|
const res = await GetFeeTemplateDetailList(postData)
|
|
|
|
|
list.value = res.data
|
|
|
|
|
hotTb.value.hotInstance.loadData(res.data)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
watchEffect(() => {
|
|
|
|
|