计量接口

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',
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分页列表

View File

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

View File

@ -8,12 +8,12 @@
</a-col>
<a-col :span="7">
<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-col>
<a-col :span="7">
<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-col>
<a-col :span="4">
@ -61,6 +61,7 @@
import downloadPointModal from '/@/components/common/downloadPointModal.vue';
import { Button as AButton, ButtonProps } from '/@/components/Button';
import { BasicArrow } from '/@/components/Basic';
import { dE } from '@fullcalendar/core/internal-common';
const userStore = useUserStore();
@ -85,9 +86,10 @@
});
const emit = defineEmits(['search', 'reset']);
const emit = defineEmits(['search', 'reset', 'toggle']);
function toggleAdvanced() {
isAdvanced.value = !isAdvanced.value
emit('toggle', isAdvanced.value)
}
const onSearchDownLoad = (val)=> {
openModal(true,{isUpdate: false, type: val})
@ -102,7 +104,18 @@
}
}
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 = () => {
formState.value ={ page: 1,size: 10}
@ -117,4 +130,21 @@
display: flex;
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>

View File

@ -1,8 +1,25 @@
<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">
<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">
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
<template #icon><Icon :icon="button.icon" /></template>
@ -13,7 +30,7 @@
{{ button.name }}
</a-button>
</template>
</template>
</template> -->
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'qtyMeaGj'">
<a-input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
@ -54,7 +71,9 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
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 { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
@ -74,6 +93,7 @@
import { parseDownloadUrl} from '/@/api/system/file';
import { downloadByUrl } from '/@/utils/file/download';
import { DeleteOutlined } from '@ant-design/icons-vue';
import searchForm from './components/searchForm.vue'
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
@ -104,7 +124,8 @@
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 router = useRouter();
@ -129,27 +150,12 @@
rowKey: 'id',
columns: customConfigColums,
formConfig: {
rowProps: {
gutter: 16,
},
schemas: customSearchFormSchema,
submitButtonOptions: {
text: '搜索',
onClick: () => {
clearSelectedRowKeys()
},
},
resetButtonOptions: {
text: '重置',
onClick: () => {
clearSelectedRowKeys()
},
},
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true]],
showResetButton: true,
schemas: [],
showResetButton: false,
showSubmitButton: false
},
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) => {
tableRef.value.setToolBarWidth();
@ -159,12 +165,6 @@
showTableSetting: true,
striped: false,
// actionColumn: {
// width: 160,
// title: '操作',
// dataIndex: 'action',
// slots: { customRender: 'action' },
// },
rowSelection: {
type: 'checkbox',
onChange: onSelectChange
@ -175,6 +175,19 @@
},
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) => {
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() {
if (!selectedRowsData.value.length) {
@ -281,7 +327,6 @@
}
function buttonClick(code) {
btnEvent[code]();
}
function handleDatalog (record: Recordable) {
@ -451,24 +496,6 @@
:deep(.ant-table-selection-col) {
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{
display: flex;
}
@ -480,4 +507,33 @@
cursor: pointer;
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>