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