采购计量客户
This commit is contained in:
@ -142,7 +142,7 @@
|
|||||||
gutter: 16,
|
gutter: 16,
|
||||||
},
|
},
|
||||||
schemas: customSearchFormSchema,
|
schemas: customSearchFormSchema,
|
||||||
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true]],
|
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||||
showResetButton: true,
|
showResetButton: true,
|
||||||
submitButtonOptions: {
|
submitButtonOptions: {
|
||||||
text: '搜索',
|
text: '搜索',
|
||||||
|
|||||||
@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
const tableButtonConfig = computed(() => {
|
const tableButtonConfig = computed(() => {
|
||||||
// return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
// return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||||
return [{"isUse":true,"name":"审批通过","code":"approveGD","icon":"ant-design:check-outlined","isDefault":true}]
|
return [{"isUse":true,"name":"审批通过","code":"approveGD","icon":"ant-design:check-outlined","isDefault":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true}]
|
||||||
});
|
});
|
||||||
|
|
||||||
const actionButtonConfig = computed(() => {
|
const actionButtonConfig = computed(() => {
|
||||||
@ -245,9 +245,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buttonClick(code) {
|
function buttonClick(code) {
|
||||||
// btnEvent[code]();
|
if (code== 'refresh') {
|
||||||
|
btnEvent[code]();
|
||||||
|
} else {
|
||||||
handleBatchApprove()
|
handleBatchApprove()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function handleDatalog (record: Recordable) {
|
function handleDatalog (record: Recordable) {
|
||||||
modalVisible.value = true
|
modalVisible.value = true
|
||||||
logId.value = record.id
|
logId.value = record.id
|
||||||
|
|||||||
@ -86,7 +86,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const tableButtonConfig = computed(() => {
|
const tableButtonConfig = computed(() => {
|
||||||
return [{"isUse":true,"name":"审批通过","code":"approveGD","icon":"ant-design:check-outlined","isDefault":true}]
|
return [{"isUse":true,"name":"审批通过","code":"approveGD","icon":"ant-design:check-outlined","isDefault":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true}]
|
||||||
// return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
// return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -259,8 +259,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buttonClick(code) {
|
function buttonClick(code) {
|
||||||
|
if (code== 'refresh') {
|
||||||
|
btnEvent[code]();
|
||||||
|
} else {
|
||||||
handleBatchApprove()
|
handleBatchApprove()
|
||||||
// btnEvent[code]();
|
}
|
||||||
}
|
}
|
||||||
function handleDatalog (record: Recordable) {
|
function handleDatalog (record: Recordable) {
|
||||||
modalVisible.value = true
|
modalVisible.value = true
|
||||||
|
|||||||
@ -7,8 +7,8 @@ export const formConfig = {
|
|||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
{
|
{
|
||||||
field: 'datePlan',
|
field: 'dateMea',
|
||||||
label: '计划日期',
|
label: '计量日期',
|
||||||
component: 'RangePicker',
|
component: 'RangePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY-MM-DD',
|
format: 'YYYY-MM-DD',
|
||||||
@ -22,13 +22,13 @@ export const searchFormSchema: FormSchema[] = [
|
|||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'pointUpName',
|
field: 'pointDelyName',
|
||||||
label: '上载点',
|
label: '下载点',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'pointUpName',
|
field: 'pointDelyName',
|
||||||
label: '上载点',
|
label: '下载点',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -52,15 +52,15 @@ export const columns: BasicColumn[] = [
|
|||||||
width: 120,
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
dataIndex: 'cuSname',
|
// dataIndex: 'cuSname',
|
||||||
title: '客户',
|
// title: '客户',
|
||||||
componentType: 'input',
|
// componentType: 'input',
|
||||||
align: 'left',
|
// align: 'left',
|
||||||
ellipsis: true,
|
// ellipsis: true,
|
||||||
width: 200,
|
// width: 200,
|
||||||
sorter: true,
|
// sorter: true,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
dataIndex: 'pointDelyName',
|
dataIndex: 'pointDelyName',
|
||||||
title: '下载点',
|
title: '下载点',
|
||||||
@ -101,7 +101,7 @@ export const columns: BasicColumn[] = [
|
|||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'qtySalesM3',
|
dataIndex: 'qtySalesM3',
|
||||||
title: '批复量(万方)',
|
title: '批复量(方)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 120,
|
||||||
@ -110,7 +110,7 @@ export const columns: BasicColumn[] = [
|
|||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'qtyMeaGj',
|
dataIndex: 'qtyMeaGj',
|
||||||
title: '完成量(吉焦)',
|
title: '提气量(吉焦)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 120,
|
||||||
@ -119,13 +119,20 @@ export const columns: BasicColumn[] = [
|
|||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'qtyMeaM3',
|
dataIndex: 'qtyMeaM3',
|
||||||
title: '完成量(万方)',
|
title: '提气量(方)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'lngFileUploadList',
|
||||||
|
title: '附件',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 200,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'rateM3Gj',
|
dataIndex: 'rateM3Gj',
|
||||||
title: '比值(方/吉焦)',
|
title: '比值(方/吉焦)',
|
||||||
@ -137,7 +144,7 @@ export const columns: BasicColumn[] = [
|
|||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'cfmCuUserName',
|
dataIndex: 'cfmCuUserName',
|
||||||
title: '客户确认人',
|
title: '确认人',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 110,
|
width: 110,
|
||||||
@ -146,7 +153,7 @@ export const columns: BasicColumn[] = [
|
|||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'cfmCuUserTime',
|
dataIndex: 'cfmCuUserTime',
|
||||||
title: '客户确认时间',
|
title: '确认时间',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 180,
|
width: 180,
|
||||||
@ -155,7 +162,7 @@ export const columns: BasicColumn[] = [
|
|||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'cfmEmpName',
|
dataIndex: 'cfmEmpName',
|
||||||
title: '内部确认人',
|
title: '业务确认人',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 110,
|
width: 110,
|
||||||
@ -164,7 +171,7 @@ export const columns: BasicColumn[] = [
|
|||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'cfmEmpTime',
|
dataIndex: 'cfmEmpTime',
|
||||||
title: '内部确认时间',
|
title: '业务确认时间',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 150,
|
width: 150,
|
||||||
@ -172,32 +179,13 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'ksName',
|
dataIndex: 'ksName',
|
||||||
title: '销售合同',
|
title: '合同',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
width: 200,
|
width: 200,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
dataIndex: 'kpName',
|
|
||||||
title: '采购合同',
|
|
||||||
componentType: 'input',
|
|
||||||
align: 'left',
|
|
||||||
ellipsis: true,
|
|
||||||
width: 200,
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
dataIndex: 'lngFileUploadList',
|
|
||||||
title: '附件',
|
|
||||||
componentType: 'input',
|
|
||||||
align: 'left',
|
|
||||||
width: 200,
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'statusName',
|
dataIndex: 'statusName',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
@ -208,8 +196,8 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'note',
|
dataIndex: 'rejNote',
|
||||||
title: '备注',
|
title: '驳回意见',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" width="85%" :title="getTitle" @ok="handleSubmit" @visible-change="handleVisibleChange">
|
<BasicModal v-bind="$attrs" @register="registerModal" width="85%" :title="getTitle" @ok="handleSubmit" @visible-change="handleVisibleChange">
|
||||||
<a-spin :spinning="spinning" tip="加载中...">
|
<a-spin :spinning="spinning" tip="加载中...">
|
||||||
<searchForm @search="onSearch" @reset="onReset" ></searchForm>
|
|
||||||
<BasicTable @register="registerTable" v-if="showTable">
|
<BasicTable @register="registerTable" v-if="showTable">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'qtySalesGj'">
|
<template v-if="column.dataIndex === 'qtySalesGj'">
|
||||||
@ -14,7 +14,7 @@
|
|||||||
{{ Number.format(Number.parse(NP.divide(Number(record.qtySalesM3), 10000)),numFormat) }}
|
{{ Number.format(Number.parse(NP.divide(Number(record.qtySalesM3), 10000)),numFormat) }}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'qtyMeaM3'">
|
<template v-if="column.dataIndex === 'qtyMeaM3'">
|
||||||
{{ Number.format(Number.parse(NP.divide(Number(record.qtyMeaM3), 10000)),numFormat) }}
|
{{record.qtyMeaM3 ? Number.format(Number.parse(NP.divide(Number(record.qtyMeaM3 || 0), 10000)),numFormat) : null }}
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
@ -38,8 +38,6 @@
|
|||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||||
import { getLngPngMeasureSalesPurPageAdd, addLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur';
|
import { getLngPngMeasureSalesPurPageAdd, addLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||||
import {formConfig, searchFormSchema, columns } from './config';
|
|
||||||
import searchForm from './searchForm.vue';
|
|
||||||
import NP from 'number-precision';
|
import NP from 'number-precision';
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
@ -50,7 +48,189 @@
|
|||||||
const { currentRoute } = router;
|
const { currentRoute } = router;
|
||||||
|
|
||||||
const tabStore = useMultipleTabStore();
|
const tabStore = useMultipleTabStore();
|
||||||
|
const codeFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
field: 'datePlan',
|
||||||
|
label: '计划日期',
|
||||||
|
component: 'RangePicker',
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
style: { width: '100%' },
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'suCode',
|
||||||
|
label: '供应商名称/简称/编码',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'pointUpName',
|
||||||
|
label: '上载点',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'pointDelyName',
|
||||||
|
label: '下载点',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
dataIndex: 'datePlan',
|
||||||
|
title: '计划日期',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'dateMea',
|
||||||
|
title: '计量日期',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'pointDelyName',
|
||||||
|
title: '下载点',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'suSname',
|
||||||
|
title: '供应商',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 150,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'pointUpName',
|
||||||
|
title: '上载点',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'qtySalesGj',
|
||||||
|
title: '批复量(吉焦)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'qtySalesM3',
|
||||||
|
title: '批复量(万方)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'qtyMeaGj',
|
||||||
|
title: '完成量(吉焦)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'qtyMeaM3',
|
||||||
|
title: '完成量(万方)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'rateM3Gj',
|
||||||
|
title: '比值(方/吉焦)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'cfmCuUserName',
|
||||||
|
title: '确认人',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 110,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'cfmCuUserTime',
|
||||||
|
title: '确认时间',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 180,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'cfmEmpName',
|
||||||
|
title: '业务确认人',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 110,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'cfmEmpTime',
|
||||||
|
title: '业务确认时间',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 150,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'ksName',
|
||||||
|
title: '销售合同',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 150,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'kpName',
|
||||||
|
title: '采购合同',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 150,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'comName',
|
||||||
|
title: '交易主体',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
const spinning = ref(false);
|
const spinning = ref(false);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const formState = ref({});
|
const formState = ref({});
|
||||||
@ -75,9 +255,9 @@
|
|||||||
canResize: false,
|
canResize: false,
|
||||||
formConfig: {
|
formConfig: {
|
||||||
labelCol:{span: 9},
|
labelCol:{span: 9},
|
||||||
schemas: [],
|
schemas: codeFormSchema,
|
||||||
showResetButton: false,
|
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||||
showSubmitButton: false
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
immediate: false,
|
immediate: false,
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
@ -96,7 +276,6 @@
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
await nextTick();
|
await nextTick();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
|
||||||
reload({searchInfo:{'limit':1,'size':10,'page':1}});
|
reload({searchInfo:{'limit':1,'size':10,'page':1}});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -105,14 +284,6 @@
|
|||||||
selectedKeys.value = rowKeys;
|
selectedKeys.value = rowKeys;
|
||||||
selectedValues.value = e
|
selectedValues.value = e
|
||||||
}
|
}
|
||||||
const onSearch = (val) => {
|
|
||||||
formState.value = val
|
|
||||||
reload()
|
|
||||||
}
|
|
||||||
const onReset = () => {
|
|
||||||
formState.value ={ page: 1,size: 10}
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
tabStore.closeTab(currentRoute.value, router);
|
tabStore.closeTab(currentRoute.value, router);
|
||||||
}
|
}
|
||||||
@ -127,7 +298,7 @@
|
|||||||
await addLngPngMeasureSalesPur(selectedValues.value);
|
await addLngPngMeasureSalesPur(selectedValues.value);
|
||||||
spinning.value = false;
|
spinning.value = false;
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: '保存成功'
|
description: '保存成功'
|
||||||
});
|
});
|
||||||
closeModal();
|
closeModal();
|
||||||
@ -140,8 +311,33 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
:deep(.ant-table-title) {
|
:deep( .ant-col-8:nth-child(1)) {
|
||||||
display: none !important;
|
width: 360px !important;
|
||||||
|
max-width: 360px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
:deep( .ant-col-8:nth-child(4)) {
|
||||||
|
width: 360px !important;
|
||||||
|
max-width: 360px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(4) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
:deep( .ant-col-8:nth-child(2)) {
|
||||||
|
width: 360px !important;
|
||||||
|
max-width: 360px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
|
||||||
|
width: 150px !important;
|
||||||
|
max-width: 150px !important;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(2) .ant-form-item-label label) {
|
||||||
|
width: 150px !important;
|
||||||
|
max-width: 150px !important;
|
||||||
|
}
|
||||||
|
:deep( .ant-col-9) {
|
||||||
|
flex:auto !important
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,41 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="pd">
|
|
||||||
<div>
|
|
||||||
<template v-for="button in tableButtonConfig" :key="button.code" >
|
|
||||||
<a-button class="pr" v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
|
||||||
<template #icon><Icon :icon="button.icon" /></template>
|
|
||||||
{{ button.name }}
|
|
||||||
</a-button>
|
|
||||||
<a-button class="pr" v-else :type="button.type">
|
|
||||||
<template #icon><Icon :icon="button.icon" /></template>
|
|
||||||
{{ button.name }}
|
|
||||||
</a-button>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<div :class="isExpend ? 'formStyle' : ''">
|
|
||||||
<searchForm @toggle="toggle" @search="onSearch" @reset="onReset"></searchForm>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="PngMeasureSalesPurStyle">
|
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="PngMeasureSalesPurStyle">
|
||||||
<BasicTable :loading="loading" :columns="columns" :data-source="tableData" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
|
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
|
||||||
rowKey="id" :pagination="pagination" @row-dbClick="dbClickRow" :scroll="{x: 2000}">
|
|
||||||
|
|
||||||
|
<template #toolbar>
|
||||||
|
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||||
|
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||||
|
<template #icon><Icon :icon="button.icon" /></template>
|
||||||
|
{{ button.name }}
|
||||||
|
</a-button>
|
||||||
|
<a-button v-else :type="button.type">
|
||||||
|
<template #icon><Icon :icon="button.icon" /></template>
|
||||||
|
{{ button.name }}
|
||||||
|
</a-button>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.dataIndex === 'qtySalesGj'">
|
|
||||||
{{ Number.format(Number.parse(record.qtySalesGj),numFormat) }}
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'qtySalesM3'">
|
|
||||||
{{ Number.format(Number.parse(record.qtySalesM3),numFormat) }}
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'qtyMeaGj'">
|
<template v-if="column.dataIndex === 'qtyMeaGj'">
|
||||||
<input-number v-model:value="record.qtyMeaGj" :digits="3"
|
<input-number v-model:value="record.qtyMeaGj" :disabled="!(record.statusCode==='JLZ'&&!record.cfmCuUserId&&!recorddataSource)"
|
||||||
v-if="record.statusCode==='N'|| record.statusCode==='JLZ'" @change="numChange(record, index)" :min="0" style="width: 100%" />
|
@change="numChange(record)" :min="0" :digits="3" style="width: 100%" />
|
||||||
<div v-else>{{ Number.format(Number.parse(record.qtyMeaGj),numFormat) }}</div>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'qtyMeaM3'">
|
<template v-if="column.dataIndex === 'qtyMeaM3'">
|
||||||
<input-number v-model:value="record.qtyMeaM3" :digits="3"
|
<input-number v-model:value="record.qtyMeaM3" :disabled="!(record.statusCode==='JLZ'&&!record.cfmCuUserId&&!recorddataSource)"
|
||||||
v-if="record.statusCode==='N'|| record.statusCode==='JLZ'" @change="numChange(record, index)" :min="0" style="width: 100%" />
|
@change="numChange(record)" :min="0" :digits="3" style="width: 100%" />
|
||||||
<div v-else>{{ Number.format(Number.parse(record.qtyMeaM3),numFormat) }}</div>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'lngFileUploadList'">
|
<template v-if="column.dataIndex === 'lngFileUploadList'">
|
||||||
<div>
|
<div>
|
||||||
@ -43,7 +29,7 @@
|
|||||||
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
|
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
|
||||||
<div v-for="(item, idx) in record.lngFileUploadList">
|
<div v-for="(item, idx) in record.lngFileUploadList">
|
||||||
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
|
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
|
||||||
<span @click="deleteFile(record, idx, index)" class="delIcon"><DeleteOutlined /></span>
|
<span @click="deleteFile(record, idx)" class="delIcon"><DeleteOutlined /></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -54,10 +40,10 @@
|
|||||||
</BasicTable>
|
</BasicTable>
|
||||||
|
|
||||||
<PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" />
|
<PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" />
|
||||||
<createFormModal @register="registerModalForm" @success="handleSuccessForm"/>
|
|
||||||
<ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/import" @success="handleImportSuccess"/>
|
<ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/import" @success="handleImportSuccess"/>
|
||||||
|
|
||||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
|
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
|
||||||
|
<createFormModal @register="registerModalForm" @success="handleSuccessForm"/>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@ -65,7 +51,7 @@
|
|||||||
const logId = ref('')
|
const logId = ref('')
|
||||||
const logPath = ref('/dayPlan/pngMeasureSalesPur/datalog');
|
const logPath = ref('/dayPlan/pngMeasureSalesPur/datalog');
|
||||||
import { DataLog } from '/@/components/pcitc';
|
import { DataLog } from '/@/components/pcitc';
|
||||||
import { ref, computed, onMounted, onUnmounted, createVNode, } from 'vue';
|
import { ref, computed, onMounted, onUnmounted, createVNode,watch } from 'vue';
|
||||||
|
|
||||||
import { Modal } from 'ant-design-vue';
|
import { Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
@ -92,12 +78,11 @@
|
|||||||
import { parseDownloadUrl} from '/@/api/system/file';
|
import { parseDownloadUrl} from '/@/api/system/file';
|
||||||
import { downloadByUrl } from '/@/utils/file/download';
|
import { downloadByUrl } from '/@/utils/file/download';
|
||||||
import { DeleteOutlined } from '@ant-design/icons-vue';
|
import { DeleteOutlined } from '@ant-design/icons-vue';
|
||||||
import searchForm from './components/searchForm.vue'
|
|
||||||
import NP from 'number-precision';
|
|
||||||
import createFormModal from './components/createForm.vue'
|
import createFormModal from './components/createForm.vue'
|
||||||
|
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||||
|
|
||||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
const numFormat = "###,###,###,###,###,###.000"
|
|
||||||
const { notification } = useMessage();
|
const { notification } = useMessage();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
defineEmits(['register']);
|
defineEmits(['register']);
|
||||||
@ -109,48 +94,39 @@
|
|||||||
const customSearchFormSchema =ref(searchFormSchema);
|
const customSearchFormSchema =ref(searchFormSchema);
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const tableData = ref([])
|
|
||||||
const total = ref(0);
|
|
||||||
const currentPage = ref(1);
|
|
||||||
const pageSize = ref(10);
|
|
||||||
const loading = ref(false)
|
|
||||||
// 分页配置
|
|
||||||
const pagination = computed(() => ({
|
|
||||||
total: total.value,
|
|
||||||
current: currentPage.value,
|
|
||||||
pageSize: pageSize.value,
|
|
||||||
showQuickJumper: true,
|
|
||||||
showSizeChanger: true,
|
|
||||||
showTotal: (total: number) => `共 ${total}条数据`,
|
|
||||||
pageSizeOptions: ["10", "20", "50", "80", "100"],
|
|
||||||
onShowSizeChange: (current, pageSize) => {
|
|
||||||
pageSize.value = pageSize;
|
|
||||||
loadData()
|
|
||||||
},
|
|
||||||
onChange: (current, size) => {
|
|
||||||
pageSize.value = size;
|
|
||||||
loadData()
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":true},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},{"isUse":true,"name":"驳回","code":"reject","icon":"ant-design:stop-outlined","isDefault":true},{"isUse":true,"name":"导出","code":"export","icon":"ant-design:export-outlined","isDefault":true},{"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"batchdelete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
|
const buttons = ref([,
|
||||||
|
{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":true},
|
||||||
|
{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":true},
|
||||||
|
{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},
|
||||||
|
{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},
|
||||||
|
{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','save','submit','cancel',]);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
return filterButtonAuth(buttons.value);
|
return filterButtonAuth(buttons.value);
|
||||||
})
|
})
|
||||||
|
|
||||||
const tableButtonConfig = computed(() => {
|
const tableButtonConfig = computed(() => {
|
||||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
let arr =[
|
||||||
|
{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},
|
||||||
|
{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":true},
|
||||||
|
{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":true},
|
||||||
|
{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},
|
||||||
|
{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},
|
||||||
|
{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]
|
||||||
|
return arr
|
||||||
|
// return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||||
});
|
});
|
||||||
|
|
||||||
const actionButtonConfig = computed(() => {
|
const actionButtonConfig = computed(() => {
|
||||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||||
});
|
});
|
||||||
|
|
||||||
const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,
|
const btnEvent = {add : handleAdd, refresh : handleRefresh,delete : handleDelete,import : handleImport,export : handleExport,
|
||||||
save: handleSave, submit: handleSubmit, cancel: handleCancel, reject: handleReject}
|
save: handleSave, submit: handleSubmit, cancel: handleCancel, reject: handleReject,datalog : handleDatalog}
|
||||||
|
|
||||||
|
const tableData = ref([])
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const formIdComputedRef = ref();
|
const formIdComputedRef = ref();
|
||||||
@ -162,84 +138,102 @@
|
|||||||
const curIdx = ref()
|
const curIdx = ref()
|
||||||
|
|
||||||
const [registerModal, { openModal }] = useModal();
|
const [registerModal, { openModal }] = useModal();
|
||||||
const [registerModalForm, { openModal: openModalForm }] = useModal();
|
|
||||||
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||||
|
const [registerModalForm, { openModal: openModalForm }] = useModal();
|
||||||
const tableId = '';
|
const tableId = '';
|
||||||
const tableName = 'PngMeasureSalesPur';
|
const tableName = 'PngMeasureSalesPur';
|
||||||
const columnName = 'PngMeasureSalesPur';
|
const columnName = 'PngMeasureSalesPur';
|
||||||
|
|
||||||
// const formName='管道气采购计量';
|
|
||||||
const formName=currentRoute.value.meta?.title;
|
const formName=currentRoute.value.meta?.title;
|
||||||
|
const [registerTable, { reload, clearSelectedRowKeys, getDataSource, updateTableDataRecord,setTableData }] = useTable({
|
||||||
|
title: '' || (formName + '列表'),
|
||||||
|
api: getLngPngMeasureSalesPurPage,
|
||||||
|
rowKey: 'id',
|
||||||
|
columns: customConfigColums,
|
||||||
|
formConfig: {
|
||||||
|
rowProps: {
|
||||||
|
gutter: 16,
|
||||||
|
},
|
||||||
|
schemas: customSearchFormSchema,
|
||||||
|
fieldMapToTime: [['dateMea', ['dateMeaStart', 'dateMeaEnd'], 'YYYY-MM-DD']],
|
||||||
|
showResetButton: true,
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit};
|
||||||
|
},
|
||||||
|
afterFetch: (res) => {
|
||||||
|
tableData.value = res || []
|
||||||
|
tableRef.value.setToolBarWidth();
|
||||||
|
|
||||||
const loadData = async () => {
|
},
|
||||||
loading.value = true;
|
useSearchForm: true,
|
||||||
try {
|
showTableSetting: true,
|
||||||
const res = await getLngPngMeasureSalesPurPage({
|
|
||||||
limit: currentPage.value,
|
striped: false,
|
||||||
size: pageSize.value,
|
actionColumn: {
|
||||||
page: currentPage.value,
|
width: 160,
|
||||||
...formState.value,
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
slots: { customRender: 'action' },
|
||||||
|
},
|
||||||
|
rowSelection: {
|
||||||
|
type: 'checkbox',
|
||||||
|
onChange: onSelectChange
|
||||||
|
},
|
||||||
|
tableSetting: {
|
||||||
|
size: false,
|
||||||
|
setting: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
tableData.value = res.list || [];
|
watch(
|
||||||
tableData.value.forEach(v=> {
|
() => tableData.value,
|
||||||
v.qtySalesM3 = NP.divide(Number(v.qtySalesM3), 10000)
|
(val) => {
|
||||||
v.qtyMeaM3 = NP.divide(Number(v.qtyMeaM3), 10000)
|
if (val) {
|
||||||
})
|
let arr = DataFormat.format(val, [
|
||||||
total.value = res.total || res.length || 0;
|
FormatOption.createQty('qtySalesGj'),
|
||||||
} catch (error) {
|
FormatOption.createQty('qtySalesM3'),
|
||||||
console.error('获取列表失败:', error);
|
FormatOption.createQty('qtyMeaGj'),
|
||||||
} finally {
|
FormatOption.createQty('qtyMeaM3'),
|
||||||
loading.value = false;
|
FormatOption.createQty('rateM3Gj', 6),
|
||||||
|
]);
|
||||||
|
if (arr.length) {
|
||||||
|
setTableData(arr)
|
||||||
}
|
}
|
||||||
};
|
|
||||||
const isExpend = ref(false)
|
|
||||||
const formState = ref({})
|
|
||||||
const toggle = (val)=> {
|
|
||||||
isExpend.value = val
|
|
||||||
}
|
}
|
||||||
const onSearch = (val)=> {
|
},
|
||||||
formState.value = val
|
{
|
||||||
handleSuccess()
|
immediate: true,
|
||||||
}
|
deep: true,
|
||||||
const onReset = (val)=> {
|
|
||||||
formState.value ={ page: 1,size: 10}
|
|
||||||
handleSuccess()
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
const onUpload = (index) => {
|
const onUpload = (index) => {
|
||||||
curIdx.value = index
|
curIdx.value = index
|
||||||
}
|
}
|
||||||
const uploadChange = (val) => {
|
const uploadChange = (val) => {
|
||||||
tableData.value[curIdx.value].lngFileUploadList = val
|
let data = getDataSource()
|
||||||
|
let record = data[curIdx.value]
|
||||||
|
record.lngFileUploadList = val
|
||||||
|
updateTableDataRecord(record.id, record)
|
||||||
}
|
}
|
||||||
const deleteFile = (record, idx, index) => {
|
const deleteFile = (record, idx) => {
|
||||||
record.lngFileUploadList.splice(idx, 1)
|
record.lngFileUploadList.splice(idx, 1)
|
||||||
tableData.value[index] = record
|
updateTableDataRecord(record.id, record)
|
||||||
}
|
}
|
||||||
const handleDownload = (info) => {
|
const handleDownload = (info) => {
|
||||||
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
|
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
|
||||||
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
|
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
|
||||||
downloadByUrl({ url, fileName: fileName});
|
downloadByUrl({ url, fileName: fileName});
|
||||||
};
|
};
|
||||||
const numChange = (record, index) => {
|
const numChange = (record) => {
|
||||||
record.rateM3Gj = Number(record.qtyMeaGj) ? (Number(record.qtyMeaM3) || 0 ) / Number(record.qtyMeaGj) : 0
|
record.rateM3Gj = Number(record.qtyMeaGj) ? (Number(record.qtyMeaM3) || 0 ) / Number(record.qtyMeaGj) : '0'
|
||||||
record.rateM3Gj = record.rateM3Gj ? Number(record.rateM3Gj).toFixed(6) : 0
|
record.rateM3Gj = record.rateM3Gj ? Number(record.rateM3Gj).toFixed(6) : 0
|
||||||
tableData.value[index] = record
|
updateTableDataRecord(record.id, record)
|
||||||
}
|
}
|
||||||
const handleSuccessForm = (val) => {
|
const handleSuccessForm = (val) => {
|
||||||
handleSuccess()
|
handleSuccess()
|
||||||
}
|
}
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
openModalForm(true,{isUpdate: false});
|
openModalForm(true,{isUpdate: false});
|
||||||
// router.push({
|
|
||||||
// path: '/dayPlan/PngMeasureSalesPur/createForm',
|
|
||||||
// query: {
|
|
||||||
// formPath: 'dayPlan/PngMeasureSalesPur',
|
|
||||||
// formName: "新建"+formName,
|
|
||||||
// formId:currentRoute.value.meta.formId,
|
|
||||||
// type:'add'
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
}
|
}
|
||||||
async function handleReject() {
|
async function handleReject() {
|
||||||
if (!selectedRowsData.value.length) {
|
if (!selectedRowsData.value.length) {
|
||||||
@ -255,9 +249,11 @@
|
|||||||
message: '提示',
|
message: '提示',
|
||||||
description: t('已驳回!'),
|
description: t('已驳回!'),
|
||||||
});
|
});
|
||||||
|
clearSelectedRowKeys()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleCancel() {
|
async function handleCancel(val) {
|
||||||
|
if (val=='batch') {
|
||||||
if (!selectedRowsData.value.length) {
|
if (!selectedRowsData.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
@ -265,14 +261,19 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
selectedRowsData.value= [{...val}]
|
||||||
|
}
|
||||||
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
|
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
description: t('取消成功!'),
|
description: t('取消成功!'),
|
||||||
});
|
});
|
||||||
|
clearSelectedRowKeys()
|
||||||
}
|
}
|
||||||
async function handleSubmit() {
|
async function handleSubmit(val) {
|
||||||
|
if (val=='batch') {
|
||||||
if (!selectedRowsData.value.length) {
|
if (!selectedRowsData.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
@ -280,18 +281,20 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
selectedRowsData.value.forEach(v => {
|
} else {
|
||||||
v.qtyMeaM3 = NP.times(Number(v.qtyMeaM3), 10000)
|
selectedRowsData.value= [{...val}]
|
||||||
v.qtySalesM3 = NP.times(Number(v.qtySalesM3), 10000)
|
}
|
||||||
})
|
|
||||||
await updateLngPngMeasureSalesPur(selectedRowsData.value)
|
await updateLngPngMeasureSalesPur(selectedRowsData.value)
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
description: t('确认成功!'),
|
description: t('确认成功!'),
|
||||||
});
|
});
|
||||||
|
clearSelectedRowKeys()
|
||||||
}
|
}
|
||||||
async function handleSave() {
|
async function handleSave(val) {
|
||||||
|
if (val=='batch') {
|
||||||
if (!selectedRowsData.value.length) {
|
if (!selectedRowsData.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
@ -299,16 +302,16 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
selectedRowsData.value.forEach(v => {
|
} else {
|
||||||
v.qtyMeaM3 = NP.times(Number(v.qtyMeaM3), 10000)
|
selectedRowsData.value= [{...val}]
|
||||||
v.qtySalesM3 = NP.times(Number(v.qtySalesM3), 10000)
|
}
|
||||||
})
|
|
||||||
await addLngPngMeasureSalesPur(selectedRowsData.value)
|
await addLngPngMeasureSalesPur(selectedRowsData.value)
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
description: t('保存成功!'),
|
description: t('保存成功!'),
|
||||||
});
|
});
|
||||||
|
clearSelectedRowKeys()
|
||||||
|
|
||||||
}
|
}
|
||||||
function dbClickRow(record) {
|
function dbClickRow(record) {
|
||||||
@ -348,13 +351,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buttonClick(code) {
|
function buttonClick(code) {
|
||||||
btnEvent[code]();
|
btnEvent[code]('batch');
|
||||||
}
|
}
|
||||||
function handleDatalog (record: Recordable) {
|
function handleDatalog (record: Recordable) {
|
||||||
modalVisible.value = true
|
modalVisible.value = true
|
||||||
logId.value = record.id
|
logId.value = record.id
|
||||||
}
|
}
|
||||||
function handleBatchdelete() {
|
function handleDelete(val) {
|
||||||
|
if (val=='batch') {
|
||||||
if (!selectedKeys.value.length) {
|
if (!selectedKeys.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
@ -362,6 +366,10 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
selectedKeys.value= [val?.id]
|
||||||
|
}
|
||||||
|
|
||||||
//与工作流相关的数据不能进行批量删除
|
//与工作流相关的数据不能进行批量删除
|
||||||
const cantDelete = selectedRowsData.value.filter((x) => {
|
const cantDelete = selectedRowsData.value.filter((x) => {
|
||||||
return (
|
return (
|
||||||
@ -401,14 +409,14 @@
|
|||||||
selectedKeys.value = selectedRowKeys;
|
selectedKeys.value = selectedRowKeys;
|
||||||
selectedRowsData.value = selectedRows;
|
selectedRowsData.value = selectedRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleRefresh() {
|
function handleRefresh() {
|
||||||
loadData();
|
reload();
|
||||||
}
|
}
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
|
|
||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
selectedRowsData.value = [];
|
selectedRowsData.value = [];
|
||||||
loadData();
|
reload();
|
||||||
}
|
}
|
||||||
async function handleExport() {
|
async function handleExport() {
|
||||||
const res = await exportLngPngMeasureSalesPur({ isTemplate: false });
|
const res = await exportLngPngMeasureSalesPur({ isTemplate: false });
|
||||||
@ -426,7 +434,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function handleImportSuccess(){
|
function handleImportSuccess(){
|
||||||
loadData()
|
reload()
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
@ -436,8 +444,9 @@
|
|||||||
} else {
|
} else {
|
||||||
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||||
}
|
}
|
||||||
loadData()
|
|
||||||
|
|
||||||
|
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
|
||||||
|
mergeCustomListRenderConfig();
|
||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
if (schemaIdComputedRef.value) {
|
if (schemaIdComputedRef.value) {
|
||||||
@ -448,31 +457,79 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
function getActions(record: Recordable):ActionItem[] {
|
function getActions(record: Recordable):ActionItem[] {
|
||||||
|
let saveBtn: ActionItem[] = [];
|
||||||
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
|
let submitBtn: ActionItem[] = [];
|
||||||
if (!record.workflowData?.processId) {
|
let cancelBtn: ActionItem[] = [];
|
||||||
return {
|
let deleteBtn: ActionItem[] = [];
|
||||||
|
let datalogBtn: ActionItem[] = [];
|
||||||
|
let actionsList: ActionItem[] = [];
|
||||||
|
actionButtonConfig.value?.map((button) => {
|
||||||
|
if (['save'].includes(button.code)) {
|
||||||
|
saveBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (['submit'].includes(button.code)) {
|
||||||
|
submitBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (['cancel'].includes(button.code)) {
|
||||||
|
cancelBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (['delete'].includes(button.code)) {
|
||||||
|
deleteBtn.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
color: button.code === 'delete' ? 'error' : undefined,
|
color: button.code === 'delete' ? 'error' : undefined,
|
||||||
onClick: btnEvent[button.code].bind(null, record),
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
};
|
});
|
||||||
} else {
|
}
|
||||||
if (button.code === 'view') {
|
if (['datalog'].includes(button.code)) {
|
||||||
return {
|
datalogBtn.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
onClick: btnEvent[button.code].bind(null, record),
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
};
|
});
|
||||||
} else {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (record.statusCode=='JLZ'&&!record.cfmCuUserId&&!record.dataSource) {
|
||||||
|
actionsList = actionsList.concat(saveBtn);
|
||||||
|
}
|
||||||
|
if (record.statusCode=='JLZ'&&!record.cfmCuUserId) {
|
||||||
|
actionsList = actionsList.concat(submitBtn);
|
||||||
|
}
|
||||||
|
if (record.statusCode=='JLZ'&&record.cfmCuUserId) {
|
||||||
|
actionsList = actionsList.concat(cancelBtn);
|
||||||
|
}
|
||||||
|
if (record.statusCode=='JLZ'&&!record.dataSource) {
|
||||||
|
actionsList = actionsList.concat(deleteBtn);
|
||||||
|
}
|
||||||
|
actionsList = actionsList.concat(datalogBtn);
|
||||||
return actionsList;
|
return actionsList;
|
||||||
}
|
}
|
||||||
|
async function mergeCustomListRenderConfig(){
|
||||||
|
if (formConfig.useCustomConfig) {
|
||||||
|
let formId=currentRoute.value.meta.formId;
|
||||||
|
//1.合并展示字段配置
|
||||||
|
let cols= await mergeColumns(customConfigColums.value,formId);
|
||||||
|
customConfigColums.value=cols;
|
||||||
|
//2.合并搜索字段配置
|
||||||
|
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId);
|
||||||
|
customSearchFormSchema.value=sFormSchema;
|
||||||
|
//3.合并按钮配置
|
||||||
|
let btns= await mergeButtons(buttons.value,formId);
|
||||||
|
buttons.value=btns;
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.PngMeasureSalesPurStyle .cusSearchForm .advanceRow> div:nth-of-type(3){
|
.PngMeasureSalesPurStyle .cusSearchForm .advanceRow> div:nth-of-type(3){
|
||||||
@ -500,33 +557,23 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
.pd {
|
:deep( .ant-col-8:nth-child(1)) {
|
||||||
padding: 6px 4px 0px 8px;
|
width: 320px !important;
|
||||||
position: relative;
|
max-width: 320px !important;
|
||||||
}
|
}
|
||||||
.pr {
|
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||||
margin-right: 4px;
|
width: 80px !important;
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
}
|
||||||
.pr:nth-child(1) {
|
:deep( .ant-col-8:nth-child(2)) {
|
||||||
margin-left: 4px;
|
width: 330px !important;
|
||||||
|
max-width: 330px !important;
|
||||||
}
|
}
|
||||||
.formStyle {
|
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
|
||||||
position: absolute;
|
width: 150px !important;
|
||||||
max-height: 400px;
|
max-width: 150px !important;
|
||||||
z-index: 6;
|
|
||||||
background: #fff;
|
|
||||||
border: 1px solid rgba(204, 204, 204, 0.47);
|
|
||||||
box-shadow: 1px 2px 10px #ccc;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
padding: 12px 0 8px 15px;
|
|
||||||
align-items: self-start !important;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 2px 4px 12px 8px;
|
|
||||||
}
|
}
|
||||||
:deep(.ant-table-title) {
|
:deep(.ant-col-8:nth-child(2) .ant-form-item-label label) {
|
||||||
display: none !important;
|
width: 150px !important;
|
||||||
|
max-width: 150px !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -17,27 +17,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="PngMeasureSalesPurStyle">
|
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="PngMeasureSalesPurStyle">
|
||||||
<BasicTable @register="registerTable" ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }" @row-dbClick="dbClickRow">
|
<BasicTable :loading="loading" :columns="columns" :data-source="tableData" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
|
||||||
|
rowKey="id" :pagination="pagination" @row-dbClick="dbClickRow" :scroll="{x: 2000}">
|
||||||
|
|
||||||
<!-- <template #toolbar>
|
|
||||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
|
||||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
|
||||||
<template #icon><Icon :icon="button.icon" /></template>
|
|
||||||
{{ button.name }}
|
|
||||||
</a-button>
|
|
||||||
<a-button v-else :type="button.type">
|
|
||||||
<template #icon><Icon :icon="button.icon" /></template>
|
|
||||||
{{ button.name }}
|
|
||||||
</a-button>
|
|
||||||
</template>
|
|
||||||
</template> -->
|
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
|
<template v-if="column.dataIndex === 'qtySalesGj'">
|
||||||
|
{{ Number.format(Number.parse(record.qtySalesGj),numFormat) }}
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'qtySalesM3'">
|
||||||
|
{{ Number.format(Number.parse(record.qtySalesM3),numFormat) }}
|
||||||
|
</template>
|
||||||
<template v-if="column.dataIndex === 'qtyMeaGj'">
|
<template v-if="column.dataIndex === 'qtyMeaGj'">
|
||||||
<input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
|
<input-number v-model:value="record.qtyMeaGj" :digits="3"
|
||||||
<div v-else>{{ record.qtyMeaGj }}</div>
|
v-if="record.statusCode==='N'|| record.statusCode==='JLZ'" @change="numChange(record, index)" :min="0" style="width: 100%" />
|
||||||
|
<div v-else>{{ Number.format(Number.parse(record.qtyMeaGj),numFormat) }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'qtyMeaM3'">
|
<template v-if="column.dataIndex === 'qtyMeaM3'">
|
||||||
<input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
|
<input-number v-model:value="record.qtyMeaM3" :digits="3"
|
||||||
|
v-if="record.statusCode==='N'|| record.statusCode==='JLZ'" @change="numChange(record, index)" :min="0" style="width: 100%" />
|
||||||
|
<div v-else>{{ Number.format(Number.parse(record.qtyMeaM3),numFormat) }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'lngFileUploadList'">
|
<template v-if="column.dataIndex === 'lngFileUploadList'">
|
||||||
<div>
|
<div>
|
||||||
@ -45,7 +43,7 @@
|
|||||||
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
|
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
|
||||||
<div v-for="(item, idx) in record.lngFileUploadList">
|
<div v-for="(item, idx) in record.lngFileUploadList">
|
||||||
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
|
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
|
||||||
<span @click="deleteFile(record, idx)" class="delIcon"><DeleteOutlined /></span>
|
<span @click="deleteFile(record, idx, index)" class="delIcon"><DeleteOutlined /></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -56,6 +54,7 @@
|
|||||||
</BasicTable>
|
</BasicTable>
|
||||||
|
|
||||||
<PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" />
|
<PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" />
|
||||||
|
<createFormModal @register="registerModalForm" @success="handleSuccessForm"/>
|
||||||
<ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/import" @success="handleImportSuccess"/>
|
<ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/import" @success="handleImportSuccess"/>
|
||||||
|
|
||||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
|
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
|
||||||
@ -94,9 +93,11 @@
|
|||||||
import { downloadByUrl } from '/@/utils/file/download';
|
import { downloadByUrl } from '/@/utils/file/download';
|
||||||
import { DeleteOutlined } from '@ant-design/icons-vue';
|
import { DeleteOutlined } from '@ant-design/icons-vue';
|
||||||
import searchForm from './components/searchForm.vue'
|
import searchForm from './components/searchForm.vue'
|
||||||
|
import NP from 'number-precision';
|
||||||
|
import createFormModal from './components/createForm.vue'
|
||||||
|
|
||||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
|
const numFormat = "###,###,###,###,###,###.000"
|
||||||
const { notification } = useMessage();
|
const { notification } = useMessage();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
defineEmits(['register']);
|
defineEmits(['register']);
|
||||||
@ -108,6 +109,29 @@
|
|||||||
const customSearchFormSchema =ref(searchFormSchema);
|
const customSearchFormSchema =ref(searchFormSchema);
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
const tableData = ref([])
|
||||||
|
const total = ref(0);
|
||||||
|
const currentPage = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const loading = ref(false)
|
||||||
|
// 分页配置
|
||||||
|
const pagination = computed(() => ({
|
||||||
|
total: total.value,
|
||||||
|
current: currentPage.value,
|
||||||
|
pageSize: pageSize.value,
|
||||||
|
showQuickJumper: true,
|
||||||
|
showSizeChanger: true,
|
||||||
|
showTotal: (total: number) => `共 ${total}条数据`,
|
||||||
|
pageSizeOptions: ["10", "20", "50", "80", "100"],
|
||||||
|
onShowSizeChange: (current, pageSize) => {
|
||||||
|
pageSize.value = pageSize;
|
||||||
|
loadData()
|
||||||
|
},
|
||||||
|
onChange: (current, size) => {
|
||||||
|
pageSize.value = size;
|
||||||
|
loadData()
|
||||||
|
},
|
||||||
|
}));
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":true},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},{"isUse":true,"name":"驳回","code":"reject","icon":"ant-design:stop-outlined","isDefault":true},{"isUse":true,"name":"导出","code":"export","icon":"ant-design:export-outlined","isDefault":true},{"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"batchdelete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
|
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":true},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},{"isUse":true,"name":"驳回","code":"reject","icon":"ant-design:stop-outlined","isDefault":true},{"isUse":true,"name":"导出","code":"export","icon":"ant-design:export-outlined","isDefault":true},{"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"batchdelete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
@ -138,44 +162,36 @@
|
|||||||
const curIdx = ref()
|
const curIdx = ref()
|
||||||
|
|
||||||
const [registerModal, { openModal }] = useModal();
|
const [registerModal, { openModal }] = useModal();
|
||||||
|
const [registerModalForm, { openModal: openModalForm }] = useModal();
|
||||||
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||||
const tableId = '';
|
const tableId = '';
|
||||||
const tableName = 'PngMeasureSalesPur';
|
const tableName = 'PngMeasureSalesPur';
|
||||||
const columnName = 'PngMeasureSalesPur';
|
const columnName = 'PngMeasureSalesPur';
|
||||||
|
|
||||||
const formName='管道气采购计量';
|
// const formName='管道气采购计量';
|
||||||
const [registerTable, { reload, clearSelectedRowKeys, getDataSource, updateTableDataRecord }] = useTable({
|
const formName=currentRoute.value.meta?.title;
|
||||||
title: '' || (formName + '列表'),
|
|
||||||
api: getLngPngMeasureSalesPurPage,
|
|
||||||
rowKey: 'id',
|
|
||||||
immediate: false,
|
|
||||||
columns: customConfigColums,
|
|
||||||
formConfig: {
|
|
||||||
schemas: [],
|
|
||||||
showResetButton: false,
|
|
||||||
showSubmitButton: false
|
|
||||||
},
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit, ...formState.value};
|
|
||||||
},
|
|
||||||
afterFetch: (res) => {
|
|
||||||
tableRef.value.setToolBarWidth();
|
|
||||||
|
|
||||||
},
|
const loadData = async () => {
|
||||||
useSearchForm: true,
|
loading.value = true;
|
||||||
showTableSetting: true,
|
try {
|
||||||
|
const res = await getLngPngMeasureSalesPurPage({
|
||||||
striped: false,
|
limit: currentPage.value,
|
||||||
rowSelection: {
|
size: pageSize.value,
|
||||||
type: 'checkbox',
|
page: currentPage.value,
|
||||||
onChange: onSelectChange
|
...formState.value,
|
||||||
},
|
|
||||||
tableSetting: {
|
|
||||||
size: false,
|
|
||||||
setting: false,
|
|
||||||
},
|
|
||||||
customRow,
|
|
||||||
});
|
});
|
||||||
|
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);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
const isExpend = ref(false)
|
const isExpend = ref(false)
|
||||||
const formState = ref({})
|
const formState = ref({})
|
||||||
const toggle = (val)=> {
|
const toggle = (val)=> {
|
||||||
@ -183,52 +199,52 @@
|
|||||||
}
|
}
|
||||||
const onSearch = (val)=> {
|
const onSearch = (val)=> {
|
||||||
formState.value = val
|
formState.value = val
|
||||||
reload()
|
handleSuccess()
|
||||||
}
|
}
|
||||||
const onReset = (val)=> {
|
const onReset = (val)=> {
|
||||||
formState.value ={ page: 1,size: 10}
|
formState.value ={ page: 1,size: 10}
|
||||||
reload()
|
handleSuccess()
|
||||||
}
|
}
|
||||||
const onUpload = (index) => {
|
const onUpload = (index) => {
|
||||||
curIdx.value = index
|
curIdx.value = index
|
||||||
}
|
}
|
||||||
const uploadChange = (val) => {
|
const uploadChange = (val) => {
|
||||||
let data = getDataSource()
|
tableData.value[curIdx.value].lngFileUploadList = val
|
||||||
let record = data[curIdx.value]
|
|
||||||
record.lngFileUploadList = val
|
|
||||||
updateTableDataRecord(record.id, record)
|
|
||||||
}
|
}
|
||||||
const deleteFile = (record, idx) => {
|
const deleteFile = (record, idx, index) => {
|
||||||
record.lngFileUploadList.splice(idx, 1)
|
record.lngFileUploadList.splice(idx, 1)
|
||||||
updateTableDataRecord(record.id, record)
|
tableData.value[index] = record
|
||||||
}
|
}
|
||||||
const handleDownload = (info) => {
|
const handleDownload = (info) => {
|
||||||
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
|
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
|
||||||
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
|
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
|
||||||
downloadByUrl({ url, fileName: fileName});
|
downloadByUrl({ url, fileName: fileName});
|
||||||
};
|
};
|
||||||
const numChange = (record) => {
|
const numChange = (record, index) => {
|
||||||
record.rateM3Gj = Number(record.qtyMeaGj) ? (Number(record.qtyMeaM3) || 0 ) / Number(record.qtyMeaGj) : '0'
|
record.rateM3Gj = Number(record.qtyMeaGj) ? (Number(record.qtyMeaM3) || 0 ) / Number(record.qtyMeaGj) : 0
|
||||||
record.rateM3Gj = record.rateM3Gj.toFixed(6)
|
record.rateM3Gj = record.rateM3Gj ? Number(record.rateM3Gj).toFixed(6) : 0
|
||||||
updateTableDataRecord(record.id, record)
|
tableData.value[index] = record
|
||||||
|
}
|
||||||
|
const handleSuccessForm = (val) => {
|
||||||
|
handleSuccess()
|
||||||
}
|
}
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
|
openModalForm(true,{isUpdate: false});
|
||||||
router.push({
|
// router.push({
|
||||||
path: '/dayPlan/PngMeasureSalesPur/createForm',
|
// path: '/dayPlan/PngMeasureSalesPur/createForm',
|
||||||
query: {
|
// query: {
|
||||||
formPath: 'dayPlan/PngMeasureSalesPur',
|
// formPath: 'dayPlan/PngMeasureSalesPur',
|
||||||
formName: formName,
|
// formName: "新建"+formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
// formId:currentRoute.value.meta.formId,
|
||||||
type:'add'
|
// type:'add'
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
}
|
}
|
||||||
async function handleReject() {
|
async function handleReject() {
|
||||||
if (!selectedRowsData.value.length) {
|
if (!selectedRowsData.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('请选择需要驳回的数据'),
|
description: t('请选择需要驳回的数据'),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -236,16 +252,15 @@
|
|||||||
await rejectLngPngMeasureSalesPur(selectedRowsData.value)
|
await rejectLngPngMeasureSalesPur(selectedRowsData.value)
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('已驳回!'),
|
description: t('已驳回!'),
|
||||||
});
|
});
|
||||||
clearSelectedRowKeys()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleCancel() {
|
async function handleCancel() {
|
||||||
if (!selectedRowsData.value.length) {
|
if (!selectedRowsData.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('请选择需要取消的数据'),
|
description: t('请选择需要取消的数据'),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -253,42 +268,47 @@
|
|||||||
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
|
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('取消成功!'),
|
description: t('取消成功!'),
|
||||||
});
|
});
|
||||||
clearSelectedRowKeys()
|
|
||||||
}
|
}
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
if (!selectedRowsData.value.length) {
|
if (!selectedRowsData.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('请选择需要确认的数据'),
|
description: t('请选择需要确认的数据'),
|
||||||
});
|
});
|
||||||
return;
|
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)
|
await updateLngPngMeasureSalesPur(selectedRowsData.value)
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('确认成功!'),
|
description: t('确认成功!'),
|
||||||
});
|
});
|
||||||
clearSelectedRowKeys()
|
|
||||||
}
|
}
|
||||||
async function handleSave() {
|
async function handleSave() {
|
||||||
if (!selectedRowsData.value.length) {
|
if (!selectedRowsData.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('请选择需要保存的数据'),
|
description: t('请选择需要保存的数据'),
|
||||||
});
|
});
|
||||||
return;
|
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)
|
await addLngPngMeasureSalesPur(selectedRowsData.value)
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('保存成功!'),
|
description: t('保存成功!'),
|
||||||
});
|
});
|
||||||
clearSelectedRowKeys()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
function dbClickRow(record) {
|
function dbClickRow(record) {
|
||||||
@ -337,7 +357,7 @@
|
|||||||
function handleBatchdelete() {
|
function handleBatchdelete() {
|
||||||
if (!selectedKeys.value.length) {
|
if (!selectedKeys.value.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('请选择需要删除的数据'),
|
description: t('请选择需要删除的数据'),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -351,7 +371,7 @@
|
|||||||
});
|
});
|
||||||
if (cantDelete.length) {
|
if (cantDelete.length) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('含有不能删除的数据'),
|
description: t('含有不能删除的数据'),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -369,7 +389,7 @@
|
|||||||
deleteLngPngMeasureSalesPur(ids).then((_) => {
|
deleteLngPngMeasureSalesPur(ids).then((_) => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('删除成功!'),
|
description: t('删除成功!'),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -382,28 +402,13 @@
|
|||||||
selectedRowsData.value = selectedRows;
|
selectedRowsData.value = selectedRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
function customRow(record: Recordable) {
|
|
||||||
return {
|
|
||||||
onClick: () => {
|
|
||||||
let selectedRowKeys = [...selectedKeys.value];
|
|
||||||
if (selectedRowKeys.indexOf(record.id) >= 0) {
|
|
||||||
let index = selectedRowKeys.indexOf(record.id);
|
|
||||||
selectedRowKeys.splice(index, 1);
|
|
||||||
} else {
|
|
||||||
selectedRowKeys.push(record.id);
|
|
||||||
}
|
|
||||||
selectedKeys.value = selectedRowKeys;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
function handleRefresh() {
|
function handleRefresh() {
|
||||||
reload();
|
loadData();
|
||||||
}
|
}
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
|
|
||||||
selectedKeys.value = [];
|
selectedKeys.value = [];
|
||||||
selectedRowsData.value = [];
|
selectedRowsData.value = [];
|
||||||
reload();
|
loadData();
|
||||||
}
|
}
|
||||||
async function handleExport() {
|
async function handleExport() {
|
||||||
const res = await exportLngPngMeasureSalesPur({ isTemplate: false });
|
const res = await exportLngPngMeasureSalesPur({ isTemplate: false });
|
||||||
@ -421,7 +426,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function handleImportSuccess(){
|
function handleImportSuccess(){
|
||||||
reload()
|
loadData()
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
@ -431,9 +436,8 @@
|
|||||||
} else {
|
} else {
|
||||||
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||||
}
|
}
|
||||||
|
loadData()
|
||||||
|
|
||||||
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
|
|
||||||
mergeCustomListRenderConfig();
|
|
||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
if (schemaIdComputedRef.value) {
|
if (schemaIdComputedRef.value) {
|
||||||
@ -467,20 +471,8 @@
|
|||||||
});
|
});
|
||||||
return actionsList;
|
return actionsList;
|
||||||
}
|
}
|
||||||
async function mergeCustomListRenderConfig(){
|
|
||||||
if (formConfig.useCustomConfig) {
|
|
||||||
let formId=currentRoute.value.meta.formId;
|
|
||||||
//1.合并展示字段配置
|
|
||||||
let cols= await mergeColumns(customConfigColums.value,formId);
|
|
||||||
customConfigColums.value=cols;
|
|
||||||
//2.合并搜索字段配置
|
|
||||||
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId);
|
|
||||||
customSearchFormSchema.value=sFormSchema;
|
|
||||||
//3.合并按钮配置
|
|
||||||
let btns= await mergeButtons(buttons.value,formId);
|
|
||||||
buttons.value=btns;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.PngMeasureSalesPurStyle .cusSearchForm .advanceRow> div:nth-of-type(3){
|
.PngMeasureSalesPurStyle .cusSearchForm .advanceRow> div:nth-of-type(3){
|
||||||
|
|||||||
Reference in New Issue
Block a user