新增密炼物料皮重策略功能,包括相关实体、控制器、服务及接口的实现,支持桌面端免密CRUD操作,优化了打印记录的字段填充逻辑,提升了用户体验。
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslMixerMaterialTareStrategy/list',
|
||||
save = '/xslmes/mesXslMixerMaterialTareStrategy/add',
|
||||
edit = '/xslmes/mesXslMixerMaterialTareStrategy/edit',
|
||||
deleteOne = '/xslmes/mesXslMixerMaterialTareStrategy/delete',
|
||||
deleteBatch = '/xslmes/mesXslMixerMaterialTareStrategy/deleteBatch',
|
||||
importExcel = '/xslmes/mesXslMixerMaterialTareStrategy/importExcel',
|
||||
exportXls = '/xslmes/mesXslMixerMaterialTareStrategy/exportXls',
|
||||
queryById = '/xslmes/mesXslMixerMaterialTareStrategy/queryById',
|
||||
}
|
||||
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
export const deleteOne = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const batchDelete = (params, handleSuccess) =>
|
||||
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url, params }, { successMessageMode: 'none' });
|
||||
};
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getImportUrl = Api.importExcel;
|
||||
@@ -0,0 +1,153 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '密炼物料名称', align: 'center', dataIndex: 'mixerMaterialName', width: 140 },
|
||||
{ title: '供应商名称', align: 'center', dataIndex: 'supplierName', width: 140 },
|
||||
{ title: '物料规格', align: 'center', dataIndex: 'materialSpec', width: 120 },
|
||||
{ title: '包装物重量', align: 'center', dataIndex: 'tareWeight', width: 110 },
|
||||
{ title: '托盘重量', align: 'center', dataIndex: 'palletWeight', width: 100 },
|
||||
{ title: '单位', align: 'center', dataIndex: 'unitName', width: 80 },
|
||||
{ title: '生效开始日期', align: 'center', dataIndex: 'effectiveStartDate', width: 120, customRender: ({ text }) => (text ? String(text).substring(0, 10) : '') },
|
||||
{ title: '生效截止日期', align: 'center', dataIndex: 'effectiveEndDate', width: 120, customRender: ({ text }) => (text ? String(text).substring(0, 10) : '') },
|
||||
{ title: '维护人', align: 'center', dataIndex: 'maintainBy_dictText', width: 100 },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165 },
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '密炼物料',
|
||||
field: 'mixerMaterialId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_mixer_material,material_name,id',
|
||||
placeholder: '请选择密炼物料',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '密炼物料名称', field: 'mixerMaterialName', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '供应商',
|
||||
field: 'supplierId',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'mes_xsl_supplier,supplier_name,id',
|
||||
placeholder: '请选择供应商',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '供应商名称', field: 'supplierName', component: 'JInput', colProps: { span: 6 } },
|
||||
{ label: '物料规格', field: 'materialSpec', component: 'JInput', colProps: { span: 6 } },
|
||||
{
|
||||
label: '生效日期',
|
||||
field: 'effectiveDateRange',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
placeholder: ['开始日期', '截止日期'],
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{
|
||||
label: '密炼物料',
|
||||
field: 'mixerMaterialName',
|
||||
component: 'Input',
|
||||
slot: 'mixerMaterialPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择密炼物料' }],
|
||||
},
|
||||
{ label: '', field: 'mixerMaterialId', component: 'Input', show: false },
|
||||
{
|
||||
label: '供应商',
|
||||
field: 'supplierName',
|
||||
component: 'Input',
|
||||
slot: 'supplierPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择供应商' }],
|
||||
},
|
||||
{ label: '', field: 'supplierId', component: 'Input', show: false },
|
||||
{
|
||||
label: '物料规格',
|
||||
field: 'materialSpec',
|
||||
component: 'Input',
|
||||
componentProps: { placeholder: '请输入物料规格', maxlength: 200 },
|
||||
helpMessage: '同一租户/供应商/密炼物料下,不同规格可分别维护;规格相同且生效日期重叠时不允许重复',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
{
|
||||
label: '包装物重量',
|
||||
field: 'tareWeight',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 3, style: { width: '100%' }, placeholder: '请输入包装物重量' },
|
||||
dynamicRules: () => [{ required: true, message: '请填写包装物重量' }],
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
label: '托盘重量',
|
||||
field: 'palletWeight',
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 3, style: { width: '100%' }, placeholder: '请输入托盘重量' },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
label: '单位',
|
||||
field: 'unitName',
|
||||
component: 'Input',
|
||||
slot: 'unitPicker',
|
||||
dynamicRules: () => [{ required: true, message: '请选择单位' }],
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{ label: '', field: 'unitId', component: 'Input', show: false },
|
||||
{
|
||||
label: '生效开始日期',
|
||||
field: 'effectiveStartDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: { valueFormat: 'YYYY-MM-DD', style: { width: '100%' }, placeholder: '请选择开始日期' },
|
||||
dynamicRules: () => [{ required: true, message: '请选择生效开始日期' }],
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
label: '生效截止日期',
|
||||
field: 'effectiveEndDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: { valueFormat: 'YYYY-MM-DD', style: { width: '100%' }, placeholder: '请选择截止日期' },
|
||||
dynamicRules: () => [{ required: true, message: '请选择生效截止日期' }],
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
label: '维护人',
|
||||
field: 'maintainBy',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '保存时自动带出当前登录用户' },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
];
|
||||
|
||||
export const superQuerySchema = {
|
||||
mixerMaterialId: {
|
||||
title: '密炼物料',
|
||||
order: 0,
|
||||
view: 'sel_search',
|
||||
dictTable: 'mes_mixer_material',
|
||||
dictCode: 'id',
|
||||
dictText: 'material_name',
|
||||
},
|
||||
mixerMaterialName: { title: '密炼物料名称', order: 1, view: 'text' },
|
||||
supplierId: {
|
||||
title: '供应商',
|
||||
order: 2,
|
||||
view: 'sel_search',
|
||||
dictTable: 'mes_xsl_supplier',
|
||||
dictCode: 'id',
|
||||
dictText: 'supplier_name',
|
||||
},
|
||||
supplierName: { title: '供应商名称', order: 3, view: 'text' },
|
||||
materialSpec: { title: '物料规格', order: 4, view: 'text' },
|
||||
tareWeight: { title: '包装物重量', order: 5, view: 'number' },
|
||||
palletWeight: { title: '托盘重量', order: 6, view: 'number' },
|
||||
unitName: { title: '单位', order: 7, view: 'text' },
|
||||
effectiveStartDate: { title: '生效开始日期', order: 8, view: 'date' },
|
||||
effectiveEndDate: { title: '生效截止日期', order: 9, view: 'date' },
|
||||
maintainBy: { title: '维护人', order: 10, view: 'text' },
|
||||
};
|
||||
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_tare_strategy:add'"
|
||||
@click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined"
|
||||
>
|
||||
新增
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_tare_strategy:exportXls'"
|
||||
preIcon="ant-design:export-outlined"
|
||||
@click="onExportXls"
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_mixer_material_tare_strategy:importExcel'"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>
|
||||
导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined" />
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'xslmes:mes_xsl_mixer_material_tare_strategy:deleteBatch'">
|
||||
批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'xslmes:mes_xsl_mixer_material_tare_strategy:edit',
|
||||
},
|
||||
]"
|
||||
:dropDownActions="getDropDownAction(record)"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<MesXslMixerMaterialTareStrategyModal @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="xslmes-mesXslMixerMaterialTareStrategy" setup>
|
||||
import { reactive } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import Icon from '/@/components/Icon';
|
||||
import MesXslMixerMaterialTareStrategyModal from './components/MesXslMixerMaterialTareStrategyModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerMaterialTareStrategy.data';
|
||||
import { list, deleteOne, batchDelete, getExportUrl, getImportUrl } from './MesXslMixerMaterialTareStrategy.api';
|
||||
|
||||
const queryParam = reactive<any>({});
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '密炼物料皮重策略',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
labelWidth: 110,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToTime: [['effectiveDateRange', ['effectiveEndDate_begin', 'effectiveStartDate_end'], 'YYYY-MM-DD']],
|
||||
},
|
||||
actionColumn: {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
beforeFetch: (params) => Object.assign(params, queryParam),
|
||||
},
|
||||
exportConfig: {
|
||||
name: '密炼物料皮重策略',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).forEach((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
openModal(true, { isUpdate: false, showFooter: true });
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: true });
|
||||
}
|
||||
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true, showFooter: false });
|
||||
}
|
||||
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
function batchHandleDelete() {
|
||||
batchDelete({ ids: selectedRowKeys.value.join(',') }, handleSuccess);
|
||||
}
|
||||
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
selectedRowKeys.value = [];
|
||||
}
|
||||
|
||||
function getDropDownAction(record: Recordable) {
|
||||
return [
|
||||
{ label: '详情', onClick: handleDetail.bind(null, record) },
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
|
||||
auth: 'xslmes:mes_xsl_mixer_material_tare_strategy:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="860" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #mixerMaterialPicker="{ model }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input
|
||||
v-model:value="model.mixerMaterialName"
|
||||
read-only
|
||||
placeholder="请点击选择密炼物料"
|
||||
style="flex: 1"
|
||||
:disabled="isDetail"
|
||||
/>
|
||||
<a-button type="primary" :disabled="isDetail" @click="openMixerSelect">选择</a-button>
|
||||
<a-button v-if="model.mixerMaterialId && !isDetail" @click="clearMixer(model)">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
<template #supplierPicker="{ model }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input
|
||||
v-model:value="model.supplierName"
|
||||
read-only
|
||||
placeholder="请点击选择供应商"
|
||||
style="flex: 1"
|
||||
:disabled="isDetail"
|
||||
/>
|
||||
<a-button type="primary" :disabled="isDetail" @click="openSupplierSelect">选择</a-button>
|
||||
<a-button v-if="model.supplierId && !isDetail" @click="clearSupplier(model)">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
<template #unitPicker="{ model }">
|
||||
<a-input-group compact style="display: flex; width: 100%">
|
||||
<a-input
|
||||
v-model:value="model.unitName"
|
||||
read-only
|
||||
placeholder="请点击选择单位"
|
||||
style="flex: 1"
|
||||
:disabled="isDetail"
|
||||
/>
|
||||
<a-button type="primary" :disabled="isDetail" @click="openUnitSelect">选择</a-button>
|
||||
<a-button v-if="model.unitId && !isDetail" @click="clearUnit(model)">清除</a-button>
|
||||
</a-input-group>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<MesMixerMaterialSelectModal @register="registerMixerModal" @select="onMixerSelect" />
|
||||
<MesXslSupplierSelectModal @register="registerSupplierModal" @select="onSupplierSelect" />
|
||||
<MesXslUnitSelectModal @register="registerUnitModal" @select="onUnitSelect" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import MesMixerMaterialSelectModal from '/@/views/mes/material/modules/MesMixerMaterialSelectModal.vue';
|
||||
import MesXslSupplierSelectModal from '/@/views/xslmes/mesXslVehicle/components/MesXslSupplierSelectModal.vue';
|
||||
import MesXslUnitSelectModal from '/@/views/xslmes/mesXslVehicle/components/MesXslUnitSelectModal.vue';
|
||||
import { formSchema } from '../MesXslMixerMaterialTareStrategy.data';
|
||||
import { saveOrUpdate } from '../MesXslMixerMaterialTareStrategy.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const userStore = useUserStore();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 130,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
const [registerMixerModal, { openModal: openMixerModal }] = useModal();
|
||||
const [registerSupplierModal, { openModal: openSupplierModal }] = useModal();
|
||||
const [registerUnitModal, { openModal: openUnitModal }] = useModal();
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
await setFieldsValue({ ...data.record });
|
||||
} else {
|
||||
await setFieldsValue({ maintainBy: userStore.getUserInfo?.username || '' });
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : unref(isDetail) ? '详情' : '编辑'));
|
||||
|
||||
function openMixerSelect() {
|
||||
openMixerModal(true, {});
|
||||
}
|
||||
|
||||
function onMixerSelect(payload: Recordable | null) {
|
||||
if (!payload) {
|
||||
return;
|
||||
}
|
||||
setFieldsValue({
|
||||
mixerMaterialId: payload.mixerMaterialId,
|
||||
mixerMaterialName: payload.materialName || '',
|
||||
});
|
||||
}
|
||||
|
||||
function clearMixer(model: Recordable) {
|
||||
model.mixerMaterialId = '';
|
||||
model.mixerMaterialName = '';
|
||||
}
|
||||
|
||||
function openSupplierSelect() {
|
||||
openSupplierModal(true, {});
|
||||
}
|
||||
|
||||
function onSupplierSelect(payload: Recordable | null) {
|
||||
if (!payload) {
|
||||
return;
|
||||
}
|
||||
setFieldsValue({
|
||||
supplierId: payload.supplierId || payload.id,
|
||||
supplierName: payload.supplierName || '',
|
||||
});
|
||||
}
|
||||
|
||||
function clearSupplier(model: Recordable) {
|
||||
model.supplierId = '';
|
||||
model.supplierName = '';
|
||||
}
|
||||
|
||||
function openUnitSelect() {
|
||||
openUnitModal(true, {});
|
||||
}
|
||||
|
||||
function onUnitSelect(payload: { unitId: string; unitName: string }) {
|
||||
setFieldsValue({
|
||||
unitId: payload.unitId || undefined,
|
||||
unitName: payload.unitName || '',
|
||||
});
|
||||
}
|
||||
|
||||
function clearUnit(model: Recordable) {
|
||||
model.unitId = '';
|
||||
model.unitName = '';
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
if (!values.mixerMaterialId) {
|
||||
createMessage.warning('请选择密炼物料');
|
||||
return;
|
||||
}
|
||||
if (!values.supplierId) {
|
||||
createMessage.warning('请选择供应商');
|
||||
return;
|
||||
}
|
||||
if (!values.unitId) {
|
||||
createMessage.warning('请选择单位');
|
||||
return;
|
||||
}
|
||||
if (values.effectiveStartDate && values.effectiveEndDate && values.effectiveStartDate > values.effectiveEndDate) {
|
||||
createMessage.warning('生效开始日期不能晚于截止日期');
|
||||
return;
|
||||
}
|
||||
if (values.palletWeight != null && values.palletWeight < 0) {
|
||||
createMessage.warning('托盘重量不能为负数');
|
||||
return;
|
||||
}
|
||||
if (values.materialSpec) {
|
||||
values.materialSpec = String(values.materialSpec).trim();
|
||||
} else {
|
||||
values.materialSpec = undefined;
|
||||
}
|
||||
setModalProps({ confirmLoading: true });
|
||||
await saveOrUpdate(values, unref(isUpdate));
|
||||
createMessage.success(unref(isUpdate) ? '编辑成功' : '新增成功');
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e: any) {
|
||||
if (e?.errorFields) {
|
||||
const firstField = e.errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(e);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -54,6 +54,18 @@ export const columns: BasicColumn[] = [
|
||||
dataIndex: 'totalWeight',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '包装物皮重',
|
||||
align: 'center',
|
||||
dataIndex: 'packagingTare',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '托盘重量',
|
||||
align: 'center',
|
||||
dataIndex: 'palletWeight',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '剩余重量',
|
||||
align: 'center',
|
||||
@@ -238,6 +250,20 @@ export const formSchemaAdd: FormSchema[] = [
|
||||
componentProps: { placeholder: '请输入总重', precision: 3 },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
label: '包装物皮重',
|
||||
field: 'packagingTare',
|
||||
component: 'InputNumber',
|
||||
componentProps: { disabled: true, precision: 3, style: { width: '100%' } },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
label: '托盘重量',
|
||||
field: 'palletWeight',
|
||||
component: 'InputNumber',
|
||||
componentProps: { disabled: true, precision: 3, style: { width: '100%' } },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
label: '剩余重量',
|
||||
field: 'remainingWeight',
|
||||
@@ -321,6 +347,20 @@ export const formSchemaEdit: FormSchema[] = [
|
||||
componentProps: { disabled: true },
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
{
|
||||
label: '包装物皮重',
|
||||
field: 'packagingTare',
|
||||
component: 'InputNumber',
|
||||
componentProps: { disabled: true, precision: 3, style: { width: '100%' } },
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
{
|
||||
label: '托盘重量',
|
||||
field: 'palletWeight',
|
||||
component: 'InputNumber',
|
||||
componentProps: { disabled: true, precision: 3, style: { width: '100%' } },
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
{
|
||||
label: '剩余数量',
|
||||
field: 'remainingQuantity',
|
||||
@@ -352,10 +392,12 @@ export const superQuerySchema = {
|
||||
materialName: { title: '物料名称', order: 3, view: 'text' },
|
||||
supplierName: { title: '供应商名称', order: 4, view: 'text' },
|
||||
totalWeight: { title: '总重', order: 5, view: 'number' },
|
||||
remainingWeight: { title: '剩余重量', order: 6, view: 'number' },
|
||||
remainingQuantity: { title: '剩余数量', order: 7, view: 'number' },
|
||||
status: { title: '状态', order: 8, view: 'list', dictCode: 'xslmes_card_status' },
|
||||
testResult: { title: '检测结果', order: 9, view: 'list', dictCode: 'xslmes_test_result' },
|
||||
warehouseArea: { title: '库区', order: 10, view: 'text' },
|
||||
createTime: { title: '创建时间', order: 11, view: 'datetime' },
|
||||
packagingTare: { title: '包装物皮重', order: 6, view: 'number' },
|
||||
palletWeight: { title: '托盘重量', order: 7, view: 'number' },
|
||||
remainingWeight: { title: '剩余重量', order: 8, view: 'number' },
|
||||
remainingQuantity: { title: '剩余数量', order: 9, view: 'number' },
|
||||
status: { title: '状态', order: 10, view: 'list', dictCode: 'xslmes_card_status' },
|
||||
testResult: { title: '检测结果', order: 11, view: 'list', dictCode: 'xslmes_test_result' },
|
||||
warehouseArea: { title: '库区', order: 12, view: 'text' },
|
||||
createTime: { title: '创建时间', order: 13, view: 'datetime' },
|
||||
};
|
||||
|
||||
@@ -17,8 +17,11 @@ export const columns: BasicColumn[] = [
|
||||
{ title: '厂家物料名称', align: 'center', dataIndex: 'manufacturerMaterialName', width: 140, ellipsis: true },
|
||||
{ title: '保质期', align: 'center', dataIndex: 'shelfLife', width: 100 },
|
||||
{ title: '总重(KG)', align: 'center', dataIndex: 'totalWeight', width: 100 },
|
||||
{ title: '托盘及皮重(合计)', align: 'center', dataIndex: 'palletTareTotal', width: 120 },
|
||||
{ title: '总份数', align: 'center', dataIndex: 'totalPortions', width: 80 },
|
||||
{ title: '每份总重(KG)', align: 'center', dataIndex: 'portionWeight', width: 110 },
|
||||
{ title: '包装物皮重', align: 'center', dataIndex: 'portionPackagingTare', width: 110, ellipsis: true },
|
||||
{ title: '托盘重量', align: 'center', dataIndex: 'portionPalletWeight', width: 100, ellipsis: true },
|
||||
{ title: '每份包数', align: 'center', dataIndex: 'portionPackages', width: 80 },
|
||||
{ title: '检测结果', align: 'center', dataIndex: 'testResult_dictText', width: 90 },
|
||||
{ title: '检测状态', align: 'center', dataIndex: 'testStatus_dictText', width: 90 },
|
||||
@@ -155,6 +158,12 @@ export const formSchema: FormSchema[] = [
|
||||
component: 'InputNumber',
|
||||
componentProps: { min: 0, precision: 2, placeholder: '请输入总重', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: '托盘及皮重(合计)',
|
||||
field: 'palletTareTotal',
|
||||
component: 'InputNumber',
|
||||
componentProps: { disabled: true, precision: 3, style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
// 字段升级为字符串类型,支持桌面端拆码明细多行拼接(如 20/1/)
|
||||
label: '总份数',
|
||||
@@ -168,6 +177,18 @@ export const formSchema: FormSchema[] = [
|
||||
component: 'Input',
|
||||
componentProps: { placeholder: '请输入每份总重(多行明细用 / 拼接)', style: { width: '100%' } },
|
||||
},
|
||||
{
|
||||
label: '包装物皮重',
|
||||
field: 'portionPackagingTare',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '拆码明细拼接(/ 分隔)' },
|
||||
},
|
||||
{
|
||||
label: '托盘重量',
|
||||
field: 'portionPalletWeight',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true, placeholder: '拆码明细拼接(/ 分隔)' },
|
||||
},
|
||||
{
|
||||
label: '每份包数',
|
||||
field: 'portionPackages',
|
||||
@@ -258,7 +279,8 @@ export const superQuerySchema = {
|
||||
materialName: { title: '物料名称', order: 4, view: 'text' },
|
||||
supplierName: { title: '供应商名称', order: 5, view: 'text' },
|
||||
totalWeight: { title: '总重(KG)', order: 6, view: 'number' },
|
||||
testStatus: { title: '检测状态', order: 7, view: 'list', dictCode: 'xslmes_test_status' },
|
||||
isSpecialAdoption: { title: '是否特采', order: 8, view: 'list', dictCode: 'yn' },
|
||||
status: { title: '状态', order: 9, view: 'list', dictCode: 'xslmes_entry_status' },
|
||||
palletTareTotal: { title: '托盘及皮重(合计)', order: 7, view: 'number' },
|
||||
testStatus: { title: '检测状态', order: 8, view: 'list', dictCode: 'xslmes_test_status' },
|
||||
isSpecialAdoption: { title: '是否特采', order: 9, view: 'list', dictCode: 'yn' },
|
||||
status: { title: '状态', order: 10, view: 'list', dictCode: 'xslmes_entry_status' },
|
||||
};
|
||||
|
||||
@@ -15,6 +15,8 @@ export const columns: BasicColumn[] = [
|
||||
{ title: '供应商', align: 'center', dataIndex: 'supplierName', width: 160, ellipsis: true },
|
||||
{ title: '保质期', align: 'center', dataIndex: 'shelfLife', width: 120 },
|
||||
{ title: '总重', align: 'center', dataIndex: 'totalWeight', width: 110 },
|
||||
{ title: '包装物皮重', align: 'center', dataIndex: 'packagingTare', width: 110 },
|
||||
{ title: '托盘重量', align: 'center', dataIndex: 'palletWeight', width: 100 },
|
||||
{ title: '剩余重量', align: 'center', dataIndex: 'remainingWeight', width: 110 },
|
||||
{ title: '剩余数量', align: 'center', dataIndex: 'remainingQuantity', width: 110 },
|
||||
{ title: '检测结果', align: 'center', dataIndex: 'testResult_dictText', width: 110 },
|
||||
@@ -64,9 +66,11 @@ export const superQuerySchema = {
|
||||
supplierName: { title: '供应商', order: 4, view: 'text' },
|
||||
shelfLife: { title: '保质期', order: 5, view: 'text' },
|
||||
totalWeight: { title: '总重', order: 6, view: 'number' },
|
||||
remainingWeight: { title: '剩余重量', order: 7, view: 'number' },
|
||||
remainingQuantity: { title: '剩余数量', order: 8, view: 'number' },
|
||||
testResult: { title: '检测结果', order: 9, view: 'list', dictCode: 'xslmes_test_result' },
|
||||
status: { title: '状态', order: 10, view: 'list', dictCode: 'xslmes_card_status' },
|
||||
priorityPickup: { title: '优先使用', order: 11, view: 'list', dictCode: 'yn' },
|
||||
packagingTare: { title: '包装物皮重', order: 7, view: 'number' },
|
||||
palletWeight: { title: '托盘重量', order: 8, view: 'number' },
|
||||
remainingWeight: { title: '剩余重量', order: 9, view: 'number' },
|
||||
remainingQuantity: { title: '剩余数量', order: 10, view: 'number' },
|
||||
testResult: { title: '检测结果', order: 11, view: 'list', dictCode: 'xslmes_test_result' },
|
||||
status: { title: '状态', order: 12, view: 'list', dictCode: 'xslmes_card_status' },
|
||||
priorityPickup: { title: '优先使用', order: 13, view: 'list', dictCode: 'yn' },
|
||||
};
|
||||
|
||||
@@ -31,6 +31,30 @@ export const columns: BasicColumn[] = [
|
||||
return Number.isInteger(n) ? String(n) : n.toFixed(2);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '货物皮重',
|
||||
align: 'center',
|
||||
dataIndex: 'cargoTareWeight',
|
||||
width: 100,
|
||||
customRender: ({ text }) => {
|
||||
if (text === null || text === undefined || text === '') return '0';
|
||||
const n = Number(text);
|
||||
if (Number.isNaN(n)) return String(text);
|
||||
return Number.isInteger(n) ? String(n) : n.toFixed(2);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '原料重量',
|
||||
align: 'center',
|
||||
dataIndex: 'rawMaterialWeight',
|
||||
width: 100,
|
||||
customRender: ({ text }) => {
|
||||
if (text === null || text === undefined || text === '') return '';
|
||||
const n = Number(text);
|
||||
if (Number.isNaN(n)) return String(text);
|
||||
return Number.isInteger(n) ? String(n) : n.toFixed(2);
|
||||
},
|
||||
},
|
||||
{ title: '司机', align: 'center', dataIndex: 'driverName', width: 90 },
|
||||
{ title: '手机号', align: 'center', dataIndex: 'driverPhone', width: 120 },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user