计量接口

This commit is contained in:
‘huanghaiixia’
2026-01-20 10:05:13 +08:00
parent 67100fe807
commit 8599ef3c9a
4 changed files with 209 additions and 94 deletions

View File

@ -11,8 +11,37 @@ enum Api {
PageAdd = '/magic-api/dayPlan/dayPlanSelectList', PageAdd = '/magic-api/dayPlan/dayPlanSelectList',
Export = '/dayPlan/pngMeasureSalesPur/export', Export = '/dayPlan/pngMeasureSalesPur/export',
Cancel = '/dayPlan/pngMeasureSalesPur/cancel',
Reject = '/dayPlan/pngMeasureSalesPur/reject'
}
/**
* @description: 驳回LngPngMeasureSalesPur
*/
export async function rejectLngPngMeasureSalesPur(lngPngMeasureSalesPur: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Reject,
params: lngPngMeasureSalesPur,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 取消LngPngMeasureSalesPur
*/
export async function cancelLngPngMeasureSalesPur(lngPngMeasureSalesPur: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Cancel,
params: lngPngMeasureSalesPur,
},
{
errorMessageMode: mode,
},
);
} }
/** /**
* @description: 查询LngPngMeasureSalesPur分页列表 * @description: 查询LngPngMeasureSalesPur分页列表

View File

@ -39,7 +39,7 @@ export const columns: BasicColumn[] = [
title: '计划日期', title: '计划日期',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 100,
sorter: true, sorter: true,
}, },
@ -48,7 +48,7 @@ export const columns: BasicColumn[] = [
title: '计量日期', title: '计量日期',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 100,
sorter: true, sorter: true,
}, },
{ {
@ -135,7 +135,7 @@ export const columns: BasicColumn[] = [
title: '客户确认人', title: '客户确认人',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 110,
sorter: true, sorter: true,
}, },
@ -144,7 +144,7 @@ export const columns: BasicColumn[] = [
title: '客户确认时间', title: '客户确认时间',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 150,
sorter: true, sorter: true,
}, },
@ -153,7 +153,7 @@ export const columns: BasicColumn[] = [
title: '内部确认人', title: '内部确认人',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 110,
sorter: true, sorter: true,
}, },
@ -162,7 +162,7 @@ export const columns: BasicColumn[] = [
title: '内部确认时间', title: '内部确认时间',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 150,
sorter: true, sorter: true,
}, },
{ {

View File

@ -8,12 +8,12 @@
</a-col> </a-col>
<a-col :span="7"> <a-col :span="7">
<a-form-item label="客户名称/简称/编码" name="cuSname"> <a-form-item label="客户名称/简称/编码" name="cuSname">
<a-input v-model:value="formState.cuSname" placeholder="请输入" /> <a-input v-model:value="formState.cuSname" placeholder="请输入客户名称/简称/编码" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="7"> <a-col :span="7">
<a-form-item label="供应商名称/简称/编码" name="suSname"> <a-form-item label="供应商名称/简称/编码" name="suSname">
<a-input v-model:value="formState.suSname" placeholder="请输入" /> <a-input v-model:value="formState.suSname" placeholder="请输入供应商名称/简称/编码" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="4"> <a-col :span="4">
@ -61,6 +61,7 @@
import downloadPointModal from '/@/components/common/downloadPointModal.vue'; import downloadPointModal from '/@/components/common/downloadPointModal.vue';
import { Button as AButton, ButtonProps } from '/@/components/Button'; import { Button as AButton, ButtonProps } from '/@/components/Button';
import { BasicArrow } from '/@/components/Basic'; import { BasicArrow } from '/@/components/Basic';
import { dE } from '@fullcalendar/core/internal-common';
const userStore = useUserStore(); const userStore = useUserStore();
@ -85,9 +86,10 @@
}); });
const emit = defineEmits(['search', 'reset']); const emit = defineEmits(['search', 'reset', 'toggle']);
function toggleAdvanced() { function toggleAdvanced() {
isAdvanced.value = !isAdvanced.value isAdvanced.value = !isAdvanced.value
emit('toggle', isAdvanced.value)
} }
const onSearchDownLoad = (val)=> { const onSearchDownLoad = (val)=> {
openModal(true,{isUpdate: false, type: val}) openModal(true,{isUpdate: false, type: val})
@ -102,7 +104,18 @@
} }
} }
const onSearch = () => { const onSearch = () => {
emit('search', formState.value) let obj = {
...formState.value,
startDate: formState.value.datePlan[0],
endDate: formState.value.datePlan[0],
dateMeaStart: formState.value.dateMea[0],
dateMeaEnd: formState.value.dateMea[1],
}
delete obj.datePlan
delete obj.dateMea
delete obj.pointUpName
delete obj.pointDelyName
emit('search', obj)
} }
const onReset = () => { const onReset = () => {
formState.value ={ page: 1,size: 10} formState.value ={ page: 1,size: 10}
@ -117,4 +130,21 @@
display: flex; display: flex;
align-items: center; align-items: center;
} }
.ant-form-item {
margin-bottom: 8px !important;
}
:deep( .ant-col-6) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-6 .ant-form-item-label) {
width: 70px !important;
max-width: 70px !important;
}
:deep(.ant-col-6 .ant-form-item-control) {
width: 240px !important;
max-width: 240px !important;
}
</style> </style>

View File

@ -1,42 +1,59 @@
<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 @register="registerTable" ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }" @row-dbClick="dbClickRow"> <BasicTable @register="registerTable" ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }" @row-dbClick="dbClickRow">
<template #toolbar> <!-- <template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code"> <template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)"> <a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
<template #icon><Icon :icon="button.icon" /></template> <template #icon><Icon :icon="button.icon" /></template>
{{ button.name }} {{ button.name }}
</a-button> </a-button>
<a-button v-else :type="button.type"> <a-button v-else :type="button.type">
<template #icon><Icon :icon="button.icon" /></template> <template #icon><Icon :icon="button.icon" /></template>
{{ button.name }} {{ button.name }}
</a-button> </a-button>
</template>
</template> </template>
<template #bodyCell="{ column, record, index }"> </template> -->
<template v-if="column.dataIndex === 'qtyMeaGj'"> <template #bodyCell="{ column, record, index }">
<a-input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" /> <template v-if="column.dataIndex === 'qtyMeaGj'">
<div v-else>{{ record.qtyMeaGj }}</div> <a-input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
</template> <div v-else>{{ record.qtyMeaGj }}</div>
<template v-if="column.dataIndex === 'qtyMeaM3'"> </template>
<a-input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" /> <template v-if="column.dataIndex === 'qtyMeaM3'">
</template> <a-input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
<template v-if="column.dataIndex === 'lngFileUploadList'"> </template>
<div> <template v-if="column.dataIndex === 'lngFileUploadList'">
<Upload :file-list="record.lngFileUploadList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName" <div>
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/> <Upload :file-list="record.lngFileUploadList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName"
<div v-for="(item, idx) in record.lngFileUploadList"> :multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
<a @click="handleDownload(item)">{{item.fileOrg}}</a> <div v-for="(item, idx) in record.lngFileUploadList">
<span @click="deleteFile(record, idx)" class="delIcon"><DeleteOutlined /></span> <a @click="handleDownload(item)">{{item.fileOrg}}</a>
</div> <span @click="deleteFile(record, idx)" class="delIcon"><DeleteOutlined /></span>
</div> </div>
</template> </div>
<template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" />
</template>
</template> </template>
</BasicTable> <template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" />
</template>
</template>
</BasicTable>
<PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" /> <PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" />
<ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/import" @success="handleImportSuccess"/> <ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/import" @success="handleImportSuccess"/>
@ -54,7 +71,9 @@
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';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur, addLngPngMeasureSalesPur, updateLngPngMeasureSalesPur} from '/@/api/dayPlan/PngMeasureSalesPur'; import { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur, addLngPngMeasureSalesPur, updateLngPngMeasureSalesPur,
cancelLngPngMeasureSalesPur, rejectLngPngMeasureSalesPur
} from '/@/api/dayPlan/PngMeasureSalesPur';
import { PageWrapper } from '/@/components/Page'; import { PageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
@ -74,6 +93,7 @@
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'
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
@ -104,7 +124,8 @@
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, save: handleSave, submit: handleSubmit} const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,
save: handleSave, submit: handleSubmit, cancel: handleCancel, reject: handleReject}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const router = useRouter(); const router = useRouter();
@ -129,27 +150,12 @@
rowKey: 'id', rowKey: 'id',
columns: customConfigColums, columns: customConfigColums,
formConfig: { formConfig: {
rowProps: { schemas: [],
gutter: 16, showResetButton: false,
}, showSubmitButton: false
schemas: customSearchFormSchema,
submitButtonOptions: {
text: '搜索',
onClick: () => {
clearSelectedRowKeys()
},
},
resetButtonOptions: {
text: '重置',
onClick: () => {
clearSelectedRowKeys()
},
},
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true]],
showResetButton: true,
}, },
beforeFetch: (params) => { beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit}; return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit, ...formState.value};
}, },
afterFetch: (res) => { afterFetch: (res) => {
tableRef.value.setToolBarWidth(); tableRef.value.setToolBarWidth();
@ -159,12 +165,6 @@
showTableSetting: true, showTableSetting: true,
striped: false, striped: false,
// actionColumn: {
// width: 160,
// title: '操作',
// dataIndex: 'action',
// slots: { customRender: 'action' },
// },
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
onChange: onSelectChange onChange: onSelectChange
@ -175,6 +175,19 @@
}, },
customRow, customRow,
}); });
const isExpend = ref(false)
const formState = ref({})
const toggle = (val)=> {
isExpend.value = val
}
const onSearch = (val)=> {
formState.value = val
reload()
}
const onReset = (val)=> {
formState.value ={ page: 1,size: 10}
reload()
}
const onUpload = (index) => { const onUpload = (index) => {
curIdx.value = index curIdx.value = index
} }
@ -210,6 +223,39 @@
} }
}); });
}
async function handleReject() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要驳回的数据'),
});
return;
}
await rejectLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('已驳回!'),
});
clearSelectedRowKeys()
}
async function handleCancel() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要取消的数据'),
});
return;
}
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('取消成功!'),
});
clearSelectedRowKeys()
} }
async function handleSubmit() { async function handleSubmit() {
if (!selectedRowsData.value.length) { if (!selectedRowsData.value.length) {
@ -281,7 +327,6 @@
} }
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
function handleDatalog (record: Recordable) { function handleDatalog (record: Recordable) {
@ -451,24 +496,6 @@
:deep(.ant-table-selection-col) { :deep(.ant-table-selection-col) {
width: 50px; width: 50px;
} }
:deep( .ant-col-8:nth-child(1)) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
width: 80px !important;
}
:deep( .ant-col-8:nth-child(2)) {
width: 360px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
width: 160px !important;
}
:deep(.ant-col-8:nth-child(2) .ant-form-item-label .ant-form-item-no-colon) {
width: 160px !important;
max-width: 160px !important;
}
.show{ .show{
display: flex; display: flex;
} }
@ -480,4 +507,33 @@
cursor: pointer; cursor: pointer;
margin-bottom: 5px; margin-bottom: 5px;
} }
.pd {
padding: 6px 4px 0px 8px;
position: relative;
}
.pr {
margin-right: 4px;
margin-bottom: 8px;
}
.pr:nth-child(1) {
margin-left: 4px;
}
.formStyle {
position: absolute;
max-height: 400px;
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) {
display: none !important;
}
</style> </style>