采购结算
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user