|
|
|
@ -354,6 +354,7 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
data: 'settlementAmount',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
visible: true,
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
numericFormat: {
|
|
|
|
|
pattern: '0,0.00'
|
|
|
|
|
}
|
|
|
|
@ -364,6 +365,7 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
data: 'invoiceAmount',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
visible: true,
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
numericFormat: {
|
|
|
|
|
pattern: '0,0.00'
|
|
|
|
|
}
|
|
|
|
@ -374,6 +376,7 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
data: 'orderInvoiceAmount',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
visible: true,
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
numericFormat: {
|
|
|
|
|
pattern: '0,0.00'
|
|
|
|
|
}
|
|
|
|
@ -384,6 +387,7 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
data: 'invoiceAmountRest',
|
|
|
|
|
readOnly: true,
|
|
|
|
|
visible: true,
|
|
|
|
|
type: 'numeric',
|
|
|
|
|
numericFormat: {
|
|
|
|
|
pattern: '0,0.00'
|
|
|
|
|
}
|
|
|
|
@ -921,69 +925,61 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
// 选择插入
|
|
|
|
|
const selectInsert = async (v) => {
|
|
|
|
|
const selectData = JSON.parse(JSON.stringify(list.value))
|
|
|
|
|
// 选择插入
|
|
|
|
|
if (v === 1) {
|
|
|
|
|
let flag = false
|
|
|
|
|
selectData.forEach((item) => {
|
|
|
|
|
item = clearCopyRow(item)
|
|
|
|
|
if (props.tbType == 'receive') {
|
|
|
|
|
item.feeType = 2
|
|
|
|
|
} else {
|
|
|
|
|
item.feeType = 1
|
|
|
|
|
}
|
|
|
|
|
if (item.selected) flag = true
|
|
|
|
|
})
|
|
|
|
|
if (!flag) return createMessage.warning('请勾选要复制的数据!')
|
|
|
|
|
const res = selectData.filter((item) => {
|
|
|
|
|
let flag = false
|
|
|
|
|
selectData.forEach((item) => {
|
|
|
|
|
item = clearCopyRow(item)
|
|
|
|
|
if (props.tbType == 'receive') {
|
|
|
|
|
item.feeType = 2
|
|
|
|
|
} else {
|
|
|
|
|
item.feeType = 1
|
|
|
|
|
}
|
|
|
|
|
if (item.selected) flag = true
|
|
|
|
|
})
|
|
|
|
|
if (!flag && v == 1) return createMessage.warning('请勾选要复制的数据!')
|
|
|
|
|
let res = []
|
|
|
|
|
if (v == 1) {
|
|
|
|
|
// 所选数据生成
|
|
|
|
|
res = selectData.filter((item) => {
|
|
|
|
|
return item.selected
|
|
|
|
|
})
|
|
|
|
|
// 费用代码
|
|
|
|
|
const feeList = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
|
|
|
|
|
res.forEach(data => {
|
|
|
|
|
const item = feeList.filter((item) => {
|
|
|
|
|
return item.name == data.feeName
|
|
|
|
|
})
|
|
|
|
|
// 自动更换客户类别客户类别
|
|
|
|
|
if (item && item.length) {
|
|
|
|
|
// 如果当前所选的这一行数据是应收,则把客户类型和客户换成默认应付的数据
|
|
|
|
|
if (data.customerTypeText == item[0].defaultCreditName) {
|
|
|
|
|
data.customerTypeText = item[0].defaultDebitName
|
|
|
|
|
data.customerType = item[0].defaultDebit
|
|
|
|
|
} else if (data.customerTypeText == item[0].defaultDebitName) {
|
|
|
|
|
// 如果当前所选的这一行数据是应付,则把客户类型和客户换成默认应收的数据
|
|
|
|
|
data.customerTypeText = item[0].defaultCreditName
|
|
|
|
|
data.customerType = item[0].defaultCredit
|
|
|
|
|
}
|
|
|
|
|
// 调用接口取费用对象
|
|
|
|
|
if (data && data.customerType) {
|
|
|
|
|
GetClientSelectInfoByCode({ code: data.customerType, businessId: props.id, businessType: props.type }).then(res => {
|
|
|
|
|
data.customerId = res.data.clientId
|
|
|
|
|
data.customerName = res.data.clientName
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
data.customerId = ''
|
|
|
|
|
data.customerName = ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
loading.value = true
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
emits('broInsert', res)
|
|
|
|
|
loading.value = false
|
|
|
|
|
}, 1200)
|
|
|
|
|
} else {
|
|
|
|
|
// 全部插入
|
|
|
|
|
selectData.forEach((item) => {
|
|
|
|
|
item = clearCopyRow(Item)
|
|
|
|
|
item.selected = false
|
|
|
|
|
if (props.tbType == 'receive') {
|
|
|
|
|
item.feeType = 2
|
|
|
|
|
// 所有数据生成
|
|
|
|
|
res = selectData
|
|
|
|
|
}
|
|
|
|
|
// 费用代码
|
|
|
|
|
const feeList = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
|
|
|
|
|
res.forEach(data => {
|
|
|
|
|
const item = feeList.filter((item) => {
|
|
|
|
|
return item.name == data.feeName
|
|
|
|
|
})
|
|
|
|
|
// 自动更换客户类别客户类别
|
|
|
|
|
if (item && item.length) {
|
|
|
|
|
// 如果当前所选的这一行数据是应收,则把客户类型和客户换成默认应付的数据
|
|
|
|
|
if (data.customerTypeText == item[0].defaultCreditName) {
|
|
|
|
|
data.customerTypeText = item[0].defaultDebitName
|
|
|
|
|
data.customerType = item[0].defaultDebit
|
|
|
|
|
} else if (data.customerTypeText == item[0].defaultDebitName) {
|
|
|
|
|
// 如果当前所选的这一行数据是应付,则把客户类型和客户换成默认应收的数据
|
|
|
|
|
data.customerTypeText = item[0].defaultCreditName
|
|
|
|
|
data.customerType = item[0].defaultCredit
|
|
|
|
|
}
|
|
|
|
|
// 调用接口取费用对象
|
|
|
|
|
if (data && data.customerType) {
|
|
|
|
|
GetClientSelectInfoByCode({ code: data.customerType, businessId: props.id, businessType: props.type }).then(res => {
|
|
|
|
|
data.customerId = res.data.clientId
|
|
|
|
|
data.customerName = res.data.clientName
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
item.feeType = 1
|
|
|
|
|
data.customerId = ''
|
|
|
|
|
data.customerName = ''
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
emits('broInsert', selectData)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
loading.value = true
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
emits('broInsert', res)
|
|
|
|
|
loading.value = false
|
|
|
|
|
}, 1200)
|
|
|
|
|
}
|
|
|
|
|
// 删除行
|
|
|
|
|
const deleteRow = async () => {
|
|
|
|
@ -1035,7 +1031,7 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
if (data.length != 0) {
|
|
|
|
|
hotTb.value.hotInstance.updateSettings({
|
|
|
|
|
cells: function (row, col) {
|
|
|
|
|
// 设置费用状态不是录入状态的行为只读
|
|
|
|
|
// 设置费用状态不是录入状态或驳回状态的行为只读
|
|
|
|
|
const props = { readOnly: true }
|
|
|
|
|
// 审核通过(STATUS=0)
|
|
|
|
|
// 录入状态(STATUS=1)
|
|
|
|
@ -1047,7 +1043,7 @@ import { Item } from 'ant-design-vue/lib/menu'
|
|
|
|
|
// 驳回申请(STATUS=7)
|
|
|
|
|
// 部分结算(STATUS=8)
|
|
|
|
|
// 结算完毕(STATUS=9)
|
|
|
|
|
if (data[row]?.feeStatus != 1 && col != 0) {
|
|
|
|
|
if (!(data[row]?.feeStatus == 6 || data[row]?.feeStatus == 1) && col != 0) {
|
|
|
|
|
// 配置不同状态的行颜色
|
|
|
|
|
if (data[row]?.feeStatus == 0 && col == 3) {
|
|
|
|
|
props['className'] = 'hot-green'
|
|
|
|
|