采购结算

This commit is contained in:
‘huanghaiixia’
2026-02-12 14:07:35 +08:00
parent c17af80e52
commit b036408017
11 changed files with 844 additions and 190 deletions

View File

@ -32,6 +32,7 @@
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { getLngPngSettleHdrDtlList} from '/@/api/dayPlan/PngSettleHdr';
import { getLngPngSettleHdrDtlListPur} from '/@/api/dayPlan/PngSettleHdrPur';
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
const { t } = useI18n();
@ -49,7 +50,10 @@
];
const emit = defineEmits(['success', 'register']);
const props = defineProps({
pageType: String
});
const { notification } = useMessage();
const isUpdate = ref(true);
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
@ -58,10 +62,14 @@
curRecord.value = data.record || {}
isUpdate.value = !!data?.isUpdate;
isDisable.value = data.isDisable
if (!(curRecord.value.lngPngSettleSalesDtlList || []).length) {
if (!(curRecord.value.lngPngSettleSalesDtlList || []).length || !(curRecord.value.lngPngSettlePurDtlList || []).length) {
getList()
} else {
tableData.value = curRecord.value.lngPngSettleSalesDtlList || []
} else {
if (props.pageType == 'supplier') {
tableData.value = curRecord.value.lngPngSettlePurDtlList || []
} else {
tableData.value = curRecord.value.lngPngSettleSalesDtlList || []
}
tableData.value = DataFormat.format(tableData.value, [
FormatOption.createQty('qtySettleGj'),
FormatOption.createQty('qtySettleM3'),
@ -88,12 +96,15 @@
}
}
const getList = async () => {
let res = await getLngPngSettleHdrDtlList({})
let request = props.pageType=='supplier'?getLngPngSettleHdrDtlListPur: getLngPngSettleHdrDtlList
let obj = {}
if (props.pageType=='supplier') {
obj.salesPurId = curRecord.value.salesPurId
} else {
obj.salesId = curRecord.value.salesId
}
let res = await request(obj)
tableData.value = res || []
// tableData.value.forEach(v => {
// v.priceDesc = v.uomName + (v.uomCode == 'M3' ? v.rateQtyM3 : v.rateQtyGj) + v.priceName
// })
}
async function handleSubmit() {
closeModal();