|
|
@ -209,6 +209,10 @@
|
|
|
|
// 添加行
|
|
|
|
// 添加行
|
|
|
|
const addRow = () => {
|
|
|
|
const addRow = () => {
|
|
|
|
list.value.push({})
|
|
|
|
list.value.push({})
|
|
|
|
|
|
|
|
const hot = hotTb.value.hotInstance
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
|
|
|
hot.selectCell(list.value.length - 1, 1)
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 定义表格所有列
|
|
|
|
// 定义表格所有列
|
|
|
@ -265,49 +269,41 @@
|
|
|
|
data: 'unit',
|
|
|
|
data: 'unit',
|
|
|
|
type: 'dropdown',
|
|
|
|
type: 'dropdown',
|
|
|
|
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.value + '-' + item.name
|
|
|
|
return item.name
|
|
|
|
// })
|
|
|
|
})
|
|
|
|
// process(dict)
|
|
|
|
process(dict)
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// const results = await feeUnitDict()
|
|
|
|
|
|
|
|
// unitDict.value = results
|
|
|
|
|
|
|
|
// const dict = results.map((item) => {
|
|
|
|
|
|
|
|
// return item.value + '-' + item.name
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// process(dict)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
const results = [
|
|
|
|
|
|
|
|
{ label: '20GP', name: '20GP', value: '22G0' },
|
|
|
|
|
|
|
|
{ label: '40GP', name: '40GP', value: '42G0' },
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
const dict = results.map((res) => {
|
|
|
|
|
|
|
|
return res.label
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
process(dict)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: '费用类型',
|
|
|
|
|
|
|
|
width: 80,
|
|
|
|
|
|
|
|
data: 'feeTypeName',
|
|
|
|
|
|
|
|
type: 'dropdown',
|
|
|
|
|
|
|
|
source: async (query, process) => {
|
|
|
|
|
|
|
|
if (currencyDict.value.length) {
|
|
|
|
|
|
|
|
process(currencyDict.value)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const results = [
|
|
|
|
const results = await feeUnitDict()
|
|
|
|
{ label: '应收', value: 1 },
|
|
|
|
unitDict.value = results
|
|
|
|
{ label: '应付', value: 2 },
|
|
|
|
const dict = results.map((item) => {
|
|
|
|
]
|
|
|
|
return item.name
|
|
|
|
const dict = results.map((res) => {
|
|
|
|
|
|
|
|
return res.label
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
process(dict)
|
|
|
|
process(dict)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// title: '费用类型',
|
|
|
|
|
|
|
|
// width: 80,
|
|
|
|
|
|
|
|
// data: 'feeTypeName',
|
|
|
|
|
|
|
|
// type: 'dropdown',
|
|
|
|
|
|
|
|
// source: async (query, process) => {
|
|
|
|
|
|
|
|
// if (currencyDict.value.length) {
|
|
|
|
|
|
|
|
// process(currencyDict.value)
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// const results = [
|
|
|
|
|
|
|
|
// { label: '应收', value: 1 },
|
|
|
|
|
|
|
|
// { label: '应付', value: 2 },
|
|
|
|
|
|
|
|
// ]
|
|
|
|
|
|
|
|
// const dict = results.map((res) => {
|
|
|
|
|
|
|
|
// return res.label
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// process(dict)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '是否箱型',
|
|
|
|
title: '是否箱型',
|
|
|
|
width: 100,
|
|
|
|
width: 100,
|
|
|
@ -574,19 +570,19 @@
|
|
|
|
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
|
|
|
|
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
|
|
|
|
let dict = {}
|
|
|
|
let dict = {}
|
|
|
|
changes.forEach((res) => {
|
|
|
|
changes.forEach((res) => {
|
|
|
|
// 费用类型
|
|
|
|
// // 费用类型
|
|
|
|
if (changes[0][1] === 'feeTypeName') {
|
|
|
|
// if (changes[0][1] === 'feeTypeName') {
|
|
|
|
const res = [
|
|
|
|
// const res = [
|
|
|
|
{ label: '应收', value: 1 },
|
|
|
|
// { label: '应收', value: 1 },
|
|
|
|
{ label: '应付', value: 2 },
|
|
|
|
// { label: '应付', value: 2 },
|
|
|
|
]
|
|
|
|
// ]
|
|
|
|
const item = res.filter((item) => {
|
|
|
|
// const item = res.filter((item) => {
|
|
|
|
return item.label === changes[0][3]
|
|
|
|
// return item.label === changes[0][3]
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
if (item) dict = item[0]
|
|
|
|
// if (item) dict = item[0]
|
|
|
|
list.value[changes[0][0]]['feeType'] = dict?.value
|
|
|
|
// list.value[changes[0][0]]['feeType'] = dict?.value
|
|
|
|
list.value[changes[0][0]]['feeTypeName'] = dict?.label
|
|
|
|
// list.value[changes[0][0]]['feeTypeName'] = dict?.label
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
// 修改费用对象
|
|
|
|
// 修改费用对象
|
|
|
|
if (changes[0][1] === 'customerName') {
|
|
|
|
if (changes[0][1] === 'customerName') {
|
|
|
|
const item = companyDict.value.filter((item) => {
|
|
|
|
const item = companyDict.value.filter((item) => {
|
|
|
|