diff --git a/src/design/index.less b/src/design/index.less index c33cf60..0f6007a 100644 --- a/src/design/index.less +++ b/src/design/index.less @@ -56,7 +56,7 @@ span { opacity: 0; } } - input.ant-input-disabled:placeholder-shown{ + input.ant-input-disabled:placeholder-shown, .ant-input-disabled:placeholder-shown{ opacity: 0 !important; } .ant-picker-input > input[disabled], .ant-radio-disabled + span { diff --git a/src/hooks/web/useCommon.ts b/src/hooks/web/useCommon.ts new file mode 100644 index 0000000..b34e48a --- /dev/null +++ b/src/hooks/web/useCommon.ts @@ -0,0 +1,10 @@ + + +export function numToThousands(number) { + if (number === null || number === undefined || number === '') return '' + let arr = number.toString().split('.') + let num = arr[0] + let float = arr[1] + let str = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + return float ? (str + '.'+ float) : str; +} diff --git a/src/views/dayPlan/Demand/components/basicForm.vue b/src/views/dayPlan/Demand/components/basicForm.vue index a17065e..3387099 100644 --- a/src/views/dayPlan/Demand/components/basicForm.vue +++ b/src/views/dayPlan/Demand/components/basicForm.vue @@ -25,7 +25,7 @@ {{ formState.qtyContractGj }} - {{ formState.qtyContractM3 }} + {{ formState.qtyContractM3 }} {{ formState.rateK }} @@ -34,7 +34,7 @@ {{ formState.qtyPlanGj }} - {{ formState.qtyPlanM3 }} + {{ formState.qtyPlanM3 }} {{ formState.rateMp }} @@ -43,7 +43,7 @@ {{ formState.qtyDemandGj }} - {{ formState.qtyDemandM3 }} + {{ formState.qtyDemandM3 }} {{ formState.rateS }} @@ -52,7 +52,7 @@ {{ formState.qtySalesGj }} - {{ formState.qtySalesM3 }} + {{ formState.qtySalesM3 }} {{ formState.rateM3Gj }} @@ -170,9 +170,9 @@ { title: t('供应商'), dataIndex: 'suName', width: 300}, { title: t('上载点'), dataIndex: 'pointUpName', width:300}, { title: t('指定量(吉焦)'), dataIndex: 'qtyDemandGj', width: 200}, - { title: t('指定量(方)'), dataIndex: 'qtyDemandM3', width: 200}, + { title: t('指定量(万方)'), dataIndex: 'qtyDemandM3', width: 200}, { title: t('批复量(吉焦)'), dataIndex: 'qtySalesGj', width: 200}, - { title: t('批复量(方)'), dataIndex: 'qtySalesM3', width: 200}, + { title: t('批复量(万方)'), dataIndex: 'qtySalesM3', width: 200}, { title: t('备注'), dataIndex: 'note', width: 200}, ]); const formState = ref({}) diff --git a/src/views/dayPlan/PngAppro/components/basicForm.vue b/src/views/dayPlan/PngAppro/components/basicForm.vue index 720939b..275f530 100644 --- a/src/views/dayPlan/PngAppro/components/basicForm.vue +++ b/src/views/dayPlan/PngAppro/components/basicForm.vue @@ -13,7 +13,7 @@ {{ formState.qtyContractGj }} - {{ formState.qtyContractM3 }} + {{ formState.qtyContractM3 }} {{ formState.rateK }} @@ -22,7 +22,7 @@ {{ formState.qtyPlanGj }} - {{ formState.qtyPlanM3 }} + {{ formState.qtyPlanM3 }} {{ formState.rateMp }} @@ -31,7 +31,7 @@ {{ formState.qtyDemandGj }} - {{ formState.qtyDemandM3 }} + {{ formState.qtyDemandM3 }} {{ formState.rateS }} @@ -40,7 +40,7 @@ {{ formState.qtySalesGj }} - {{ formState.qtySalesM3 }} + {{ formState.qtySalesM3 }} {{ formState.rateM3Gj }} @@ -126,9 +126,9 @@ { title: t('供应商'), dataIndex: 'suName', width: 400}, { title: t('采购合同'), dataIndex: 'kpName', width: 400}, { title: t('指定量(吉焦)'), dataIndex: 'qtyDemandGj', width: 300}, - { title: t('指定量(方)'), dataIndex: 'qtyDemandM3', width: 200}, + { title: t('指定量(万方)'), dataIndex: 'qtyDemandM3', width: 200}, { title: t('批复量(吉焦)'), dataIndex: 'qtySalesGj', width: 200}, - { title: t('批复量(方)'), dataIndex: 'qtySalesM3', width: 200}, + { title: t('批复量(万方)'), dataIndex: 'qtySalesM3', width: 200}, { title: t('备注'), dataIndex: 'note', width: 300}, ]); const formState = ref() diff --git a/src/views/dayPlan/PngAppro/components/config.ts b/src/views/dayPlan/PngAppro/components/config.ts index d7e1d7d..4622b68 100644 --- a/src/views/dayPlan/PngAppro/components/config.ts +++ b/src/views/dayPlan/PngAppro/components/config.ts @@ -234,7 +234,7 @@ export const columns: BasicColumn[] = [ { dataIndex: 'qtyDemandM3', - title: '指定量(方)', + title: '指定量(万方)', componentType: 'input', align: 'left', @@ -252,7 +252,7 @@ export const columns: BasicColumn[] = [ { dataIndex: 'qtySalesM3', - title: '批复量(方)', + title: '批复量(万方)', componentType: 'input', align: 'left', diff --git a/src/views/dayPlan/PngMeasureSalesPur/components/config.ts b/src/views/dayPlan/PngMeasureSalesPur/components/config.ts index 6f257a7..41bd0da 100644 --- a/src/views/dayPlan/PngMeasureSalesPur/components/config.ts +++ b/src/views/dayPlan/PngMeasureSalesPur/components/config.ts @@ -101,7 +101,7 @@ export const columns: BasicColumn[] = [ { dataIndex: 'qtySalesM3', - title: '批复量(方)', + title: '批复量(万方)', componentType: 'input', align: 'left', width: 120, @@ -119,7 +119,7 @@ export const columns: BasicColumn[] = [ { dataIndex: 'qtyMeaM3', - title: '完成量(方)', + title: '完成量(万方)', componentType: 'input', align: 'left', width: 120, diff --git a/src/views/dayPlan/PngMeasureSalesPur/components/createForm.vue b/src/views/dayPlan/PngMeasureSalesPur/components/createForm.vue index 1649e0c..54629d0 100644 --- a/src/views/dayPlan/PngMeasureSalesPur/components/createForm.vue +++ b/src/views/dayPlan/PngMeasureSalesPur/components/createForm.vue @@ -10,7 +10,16 @@ - + + + @@ -31,6 +40,7 @@ import { getLngPngMeasureSalesPurPageAdd, addLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur'; import {formConfig, searchFormSchema, columns } from './config'; import searchForm from './searchForm.vue'; + import NP from 'number-precision'; const userStore = useUserStore(); diff --git a/src/views/dayPlan/PngMeasureSalesPur/index.vue b/src/views/dayPlan/PngMeasureSalesPur/index.vue index 9a39807..fda5f3e 100644 --- a/src/views/dayPlan/PngMeasureSalesPur/index.vue +++ b/src/views/dayPlan/PngMeasureSalesPur/index.vue @@ -83,7 +83,7 @@ import { downloadByUrl } from '/@/utils/file/download'; import { DeleteOutlined } from '@ant-design/icons-vue'; import searchForm from './components/searchForm.vue' - + import NP from 'number-precision'; const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); @@ -168,6 +168,10 @@ ...formState.value, }); tableData.value = res.list || []; + tableData.value.forEach(v=> { + v.qtySalesM3 = NP.divide(Number(v.qtySalesM3), 10000) + v.qtyMeaM3 = NP.divide(Number(v.qtyMeaM3), 10000) + }) total.value = res.total || res.length || 0; } catch (error) { console.error('获取列表失败:', error); @@ -260,6 +264,10 @@ }); return; } + selectedRowsData.value.forEach(v => { + v.qtyMeaM3 = NP.times(Number(v.qtyMeaM3), 10000) + v.qtySalesM3 = NP.times(Number(v.qtySalesM3), 10000) + }) await updateLngPngMeasureSalesPur(selectedRowsData.value) handleSuccess(); notification.success({ @@ -275,6 +283,10 @@ }); return; } + selectedRowsData.value.forEach(v => { + v.qtyMeaM3 = NP.times(Number(v.qtyMeaM3), 10000) + v.qtySalesM3 = NP.times(Number(v.qtySalesM3), 10000) + }) await addLngPngMeasureSalesPur(selectedRowsData.value) handleSuccess(); notification.success({