Merge branch 'zth' into dev

feature-JimuReport-1106-yjl
张同海 2 months ago
commit 05196afdd0

@ -148,12 +148,20 @@
const feeList = feeField.value.validate() const feeList = feeField.value.validate()
values['details'] = feeList values['details'] = feeList
values['condition'] = feeField.value.condition values['condition'] = feeField.value.condition
values['customerName'] = props.customerName
values['customerName'] = props.customerName
values['customerId'] = props.customerId
loading.value = true loading.value = true
setModalProps({ confirmLoading: true, loading: true }) setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await ApiEdit(values) const res: API.DataResult = await ApiEdit(values)
loading.value = false loading.value = false
if (res.succeeded) { if (res.succeeded) {
createMessage.success(res.message) createMessage.success(res.message)
isUpdate.value = true
setFieldsValue({
id: res.data,
})
emit('success') emit('success')
} else { } else {
createMessage.error(res.message) createMessage.error(res.message)

@ -199,9 +199,31 @@
const validate = () => { const validate = () => {
return list.value return list.value
} }
const SetData = (data) => { const SetData = async (data) => {
list.value.splice(0) list.value.splice(0)
const customerTypeList: any = await getDictOption('djy_cust_prop')
const unitList: any = await feeUnitDict()
const unitList2: any = await getDictOption('fee_unit')
console.log(unitList, unitList2)
data.forEach((item) => { data.forEach((item) => {
customerTypeList.forEach((e) => {
if (e.value == item.customerType) {
item.customerTypeText = e.name
}
})
unitList.forEach((e) => {
console.log(e, 1111111111)
if (e.name == item.unit) {
item.unitText = e.name
}
})
unitList2.forEach((e) => {
console.log(e, 1111111111)
if (e.value == item.unit) {
item.unitText = e.name
}
})
list.value.push(item) list.value.push(item)
}) })
} }

@ -167,8 +167,18 @@
const feeField = ref() const feeField = ref()
async function handleSave(exit) { async function handleSave(exit) {
try { try {
const values = await validate()
const feeList = feeField.value.validate() const feeList = feeField.value.validate()
let type = true
feeList.forEach((item) => {
if (!item.taxUnitPrice) {
type = false
}
})
if (!type) {
createMessage.warning('费用明细列表含税单价为必填项!')
throw new Error('费用明细列表含税单价为必填项!')
}
const values = await validate()
values['details'] = feeList values['details'] = feeList
values['condition'] = feeField.value.condition values['condition'] = feeField.value.condition
values['isShared'] = true values['isShared'] = true
@ -178,6 +188,11 @@
loading.value = false loading.value = false
if (res.succeeded) { if (res.succeeded) {
createMessage.success(res.message) createMessage.success(res.message)
isUpdate.value = true
rowId.value = res.data
setFieldsValue({
id: res.data,
})
emit('success') emit('success')
} else { } else {
createMessage.error(res.message) createMessage.error(res.message)

@ -199,9 +199,31 @@
const validate = () => { const validate = () => {
return list.value return list.value
} }
const SetData = (data) => { const SetData = async (data) => {
list.value.splice(0) list.value.splice(0)
const customerTypeList: any = await getDictOption('djy_cust_prop')
const unitList: any = await feeUnitDict()
const unitList2: any = await getDictOption('fee_unit')
console.log(unitList, unitList2)
data.forEach((item) => { data.forEach((item) => {
customerTypeList.forEach((e) => {
if (e.value == item.customerType) {
item.customerTypeText = e.name
}
})
unitList.forEach((e) => {
console.log(e, 1111111111)
if (e.name == item.unit) {
item.unitText = e.name
}
})
unitList2.forEach((e) => {
console.log(e, 1111111111)
if (e.value == item.unit) {
item.unitText = e.name
}
})
list.value.push(item) list.value.push(item)
}) })
} }
@ -225,29 +247,6 @@
className: 'htCenter', className: 'htCenter',
readOnly: false, readOnly: false,
}, },
// {
// title: '',
// width: 130,
// data: 'customerName',
// type: 'dropdown',
// source: async (query, process) => {
// //
// 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)
// })
// },
// },
{ {
title: '费用名称', title: '费用名称',
width: 130, width: 130,
@ -270,7 +269,6 @@
type: 'dropdown', type: 'dropdown',
source: async (query, process) => { source: async (query, process) => {
const results = await getDictOption('djy_cust_prop') const results = await getDictOption('djy_cust_prop')
console.log(results)
const dict = results.map((item) => { const dict = results.map((item) => {
return item.value + '-' + item.name return item.value + '-' + item.name
}) })
@ -285,7 +283,6 @@
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) => {
console.log(item, 11111111111111)
return item.name return item.name
}) })
process(dict) process(dict)
@ -293,7 +290,6 @@
const results = await feeUnitDict() const results = await feeUnitDict()
unitDict.value = results unitDict.value = results
const dict = results.map((item) => { const dict = results.map((item) => {
console.log(item, 11111111111111)
return item.name return item.name
}) })
process(dict) process(dict)
@ -393,161 +389,6 @@
data: 'isAdvancedPay', data: 'isAdvancedPay',
type: 'checkbox', type: 'checkbox',
}, },
// {
// title: '',
// width: 130,
// data: 'feeEnName',
// type: 'dropdown',
// source: async (query, process) => {
// const res = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
// if (!feeDict.value.length) feeDict.value = res
// const dict = res.map((res) => {
// return res.enName
// })
// process(dict)
// },
// },
// {
// 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.value + '-' + item.name
// })
// process(dict)
// },
// },
// {
// title: '',
// width: 120,
// data: 'quantity',
// type: 'numeric',
// format: '0',
// },
// {
// title: '',
// width: 120,
// data: 'noTaxPrice',
// type: 'numeric',
// readOnly: true,
// },
// {
// title: '',
// width: 120,
// data: 'noTaxAmount',
// type: 'numeric',
// format: '0.00',
// readOnly: true,
// },
// {
// title: '',
// width: 120,
// data: 'amount',
// type: 'numeric',
// },
// {
// title: '',
// width: 120,
// data: 'note',
// },
// {
// title: '',
// width: 100,
// data: 'accTaxAmount',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'accAmount',
// readOnly: true,
// },
// {
// title: '',
// width: 100,
// data: 'isOpen',
// type: 'checkbox',
// },
// {
// title: 'FRT',
// width: 120,
// data: 'feeFrt',
// 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 = { const settings = {
@ -586,19 +427,6 @@
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') {
// 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') { if (changes[0][1] === 'customerName') {
const item = companyDict.value.filter((item) => { const item = companyDict.value.filter((item) => {
@ -624,13 +452,6 @@
list.value[res[0]]['taxRate'] = dict['taxRate'] list.value[res[0]]['taxRate'] = dict['taxRate']
list.value[res[0]]['isInvoice'] = dict['isInvoice'] list.value[res[0]]['isInvoice'] = dict['isInvoice']
list.value[res[0]]['isAdvancedPay'] = dict['isAdvancedPay'] list.value[res[0]]['isAdvancedPay'] = dict['isAdvancedPay']
// list.value[res[0]]['feeEnName'] = dict['enName']
// list.value[res[0]]['unitText'] = dict['defaultUnitName']
// list.value[res[0]]['customerTypeText'] = dict['defaultDebitName']
// list.value[res[0]]['customerType'] = dict['defaultDebit']
// list.value[res[0]]['isOpen'] = dict['isOpen']
// list.value[res[0]]['feeFrt'] = dict['feeFrt']
} }
}) })
// //
@ -641,37 +462,7 @@
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'] = dict?.label list.value[changes[0][0]]['unitText'] = dict?.label
// 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') {
// const item = currencyDict.value.filter((item) => {
// return item.name === changes[0][3]
// })
// if (item) dict = item[0]
// list.value[changes[0][0]]['currency'] = dict?.codeName
// }
// ============================
// //
// if (changes[0][1] === 'feeEnName') {
// }
// //
if (changes[0][1] === 'customerTypeText') { if (changes[0][1] === 'customerTypeText') {
@ -684,61 +475,6 @@
list.value[changes[0][0]]['customerTypeText'] = changes[0][3].split('-')[1] list.value[changes[0][0]]['customerTypeText'] = changes[0][3].split('-')[1]
}) })
} }
// //
// const index = changes[0][0]
// //
// if (changes[0][1] === 'noTaxPrice') {
// //
// list.value[index].unitPrice = Number(
// (changes[0][3] || 0) * ((list.value[index].taxRate || 0) / 100 + 1),
// ).toFixed(6)
// //
// list.value[index].amount = Number(
// (list.value[index].unitPrice || 0) * (list.value[index].quantity || 0),
// ).toFixed(6)
// //
// 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 = Number(
// (changes[0][3] || 0) / ((list.value[index].taxRate || 0) / 100 + 1),
// ).toFixed(6)
// //
// list.value[index].amount = Number(
// (changes[0][3] || 0) * (list.value[index].quantity || 0),
// ).toFixed(6)
// //
// 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 = Number(
// (changes[0][3] || 0) * (list.value[index].unitPrice || 0),
// ).toFixed(6)
// //
// 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 = Number(
// (list.value[index].unitPrice || 0) / ((changes[0][3] || 0) / 100 + 1),
// ).toFixed(6)
// //
// list.value[index].noTaxAmount = Number(
// (list.value[index].noTaxPrice || 0) * (list.value[index].quantity || 0),
// ).toFixed(6)
// }
} }
}, },
} }

Loading…
Cancel
Save