销售结算
This commit is contained in:
@ -3,6 +3,9 @@
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit">
|
||||
<a-table :columns="columns" :data-source="tableData" :scroll="{x: 300}" :pagination="false">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'priceDesc'">
|
||||
{{ record.uomName + (record.uomCode == 'M3' ? record.rateQtyM3 : record.rateQtyGj) + record.priceName }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'qtySettleGj'">
|
||||
<a-input-number v-model:value="record.qtySettleGj" :min="0" :precision="3" @change="numChange('qtySettleGj', record, index)" style="width: 100%" />
|
||||
</template>
|
||||
@ -28,12 +31,10 @@
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { getLngPngSettleHdrDtlList} from '/@/api/dayPlan/PngSettleHdr';
|
||||
|
||||
const { t } = useI18n();
|
||||
const tableData = ref([
|
||||
{priceDesc: '基础量300000方'},
|
||||
{priceDesc: '增量'}
|
||||
])
|
||||
const tableData = ref([])
|
||||
const curRecord = ref({})
|
||||
const columns= [
|
||||
{ title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||
@ -54,25 +55,35 @@
|
||||
setModalProps({ confirmLoading: false });
|
||||
curRecord.value = data.record || {}
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
if (!(curRecord.value.lngPngSettleSalesDtlList || []).length) {
|
||||
getList()
|
||||
} else {
|
||||
tableData.value = curRecord.value.lngPngSettleSalesDtlList || []
|
||||
}
|
||||
});
|
||||
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? t('价格组成') : t('')));
|
||||
const numChange = (k, record, idx) => {
|
||||
if (curRecord.value.uomCode == 'M3') {
|
||||
if (record.uomCode == 'M3') {
|
||||
if (k=='amount') {
|
||||
return
|
||||
}
|
||||
record.amount = ((Number(record.qtySettleM3) || 0) * (Number(record.priceM3) || 0)).toFixed(2)
|
||||
}
|
||||
if (curRecord.value.uomCode == 'GJ') {
|
||||
if (record.uomCode == 'GJ') {
|
||||
if (k=='amount') {
|
||||
return
|
||||
}
|
||||
record.amount = ((Number(record.qtySettleGj) || 0) * (Number(record.priceGj) || 0)).toFixed(2)
|
||||
}
|
||||
// if (curRecord.value.uomCode == 'TON') {
|
||||
|
||||
// }
|
||||
}
|
||||
const getList = async () => {
|
||||
let res = await getLngPngSettleHdrDtlList({})
|
||||
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