|
|
|
@ -209,6 +209,10 @@
|
|
|
|
|
// 添加行
|
|
|
|
|
const addRow = () => {
|
|
|
|
|
list.value.push({})
|
|
|
|
|
const hot = hotTb.value.hotInstance
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
hot.selectCell(list.value.length - 1, 1)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 定义表格所有列
|
|
|
|
@ -265,49 +269,41 @@
|
|
|
|
|
data: 'unit',
|
|
|
|
|
type: 'dropdown',
|
|
|
|
|
source: async (query, process) => {
|
|
|
|
|
// if (unitDict.value && unitDict.value.length) {
|
|
|
|
|
// const dict = unitDict.value.map((item) => {
|
|
|
|
|
// return item.value + '-' + item.name
|
|
|
|
|
// })
|
|
|
|
|
// 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
|
|
|
|
|
if (unitDict.value && unitDict.value.length) {
|
|
|
|
|
const dict = unitDict.value.map((item) => {
|
|
|
|
|
return item.name
|
|
|
|
|
})
|
|
|
|
|
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
|
|
|
|
|
const results = await feeUnitDict()
|
|
|
|
|
unitDict.value = results
|
|
|
|
|
const dict = results.map((item) => {
|
|
|
|
|
return item.name
|
|
|
|
|
})
|
|
|
|
|
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: '是否箱型',
|
|
|
|
|
width: 100,
|
|
|
|
@ -574,19 +570,19 @@
|
|
|
|
|
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
|
|
|
|
|
let dict = {}
|
|
|
|
|
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] === '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) => {
|
|
|
|
|