设备对应部位功能新增
This commit is contained in:
@@ -3,6 +3,7 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
enum Api {
|
||||
list = '/xslmes/mesXslEquipmentLedger/list',
|
||||
checkEquipmentCode = '/xslmes/mesXslEquipmentLedger/checkEquipmentCode',
|
||||
nextLedgerNo = '/xslmes/mesXslEquipmentLedger/nextLedgerNo',
|
||||
checkEquipmentName = '/xslmes/mesXslEquipmentLedger/checkEquipmentName',
|
||||
save = '/xslmes/mesXslEquipmentLedger/add',
|
||||
edit = '/xslmes/mesXslEquipmentLedger/edit',
|
||||
@@ -20,6 +21,8 @@ export const checkEquipmentCode = (params: { equipmentCode: string; dataId?: str
|
||||
|
||||
export const checkEquipmentName = (params: { equipmentName: string; dataId?: string }) =>
|
||||
defHttp.get({ url: Api.checkEquipmentName, params }, { successMessageMode: 'none', errorMessageMode: 'none' });
|
||||
|
||||
export const fetchNextLedgerNo = () => defHttp.get({ url: Api.nextLedgerNo }, { successMessageMode: 'none' });
|
||||
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) => {
|
||||
|
||||
@@ -4,6 +4,7 @@ import { checkEquipmentCode, checkEquipmentName } from './MesXslEquipmentLedger.
|
||||
const colHalf = { span: 12 };
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '系统编号', align: 'center', dataIndex: 'ledgerNo', width: 100 },
|
||||
{ title: '设备编号', align: 'center', dataIndex: 'equipmentCode', width: 130 },
|
||||
{ title: '设备名称', align: 'center', dataIndex: 'equipmentName', width: 160 },
|
||||
{ title: '工序', align: 'center', dataIndex: 'processOperationName', width: 120 },
|
||||
@@ -18,6 +19,7 @@ export const columns: BasicColumn[] = [
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{ label: '系统编号', field: 'ledgerNo', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '设备编号', field: 'equipmentCode', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '设备名称', field: 'equipmentName', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '', field: 'processOperationId', component: 'Input', show: false },
|
||||
@@ -80,8 +82,8 @@ export const formSchema: FormSchema[] = [
|
||||
{ label: '', field: 'id', component: 'Input', show: false },
|
||||
{ label: '', field: 'processOperationId', component: 'Input', show: false },
|
||||
{ label: '', field: 'manufacturerId', component: 'Input', show: false },
|
||||
{ label: '', field: 'equipmentCategoryId', component: 'Input', show: false },
|
||||
{ label: '', field: 'equipmentTypeId', component: 'Input', show: false },
|
||||
{ label: '', field: 'equipmentCategoryId', component: 'Input', show: false, dynamicRules: () => [{ required: true, message: '请选择设备类别' }] },
|
||||
{ label: '', field: 'equipmentTypeId', component: 'Input', show: false, dynamicRules: () => [{ required: true, message: '请选择设备类型' }] },
|
||||
{ label: '', field: 'factoryId', component: 'Input', show: false },
|
||||
{
|
||||
label: '所属工序',
|
||||
@@ -91,6 +93,13 @@ export const formSchema: FormSchema[] = [
|
||||
colProps: colHalf,
|
||||
dynamicRules: () => [{ required: true, message: '请选择所属工序' }],
|
||||
},
|
||||
{
|
||||
label: '系统编号',
|
||||
field: 'ledgerNo',
|
||||
component: 'Input',
|
||||
colProps: colHalf,
|
||||
componentProps: { readonly: true, placeholder: '保存时从001起自动生成' },
|
||||
},
|
||||
{
|
||||
label: '设备编号',
|
||||
field: 'equipmentCode',
|
||||
@@ -150,6 +159,7 @@ export const formSchema: FormSchema[] = [
|
||||
component: 'Input',
|
||||
slot: 'equipmentCategoryPicker',
|
||||
colProps: colHalf,
|
||||
dynamicRules: () => [{ required: true, message: '请选择设备类别' }],
|
||||
},
|
||||
{
|
||||
label: '设备类型',
|
||||
@@ -157,6 +167,7 @@ export const formSchema: FormSchema[] = [
|
||||
component: 'Input',
|
||||
slot: 'equipmentTypePicker',
|
||||
colProps: colHalf,
|
||||
dynamicRules: () => [{ required: true, message: '请选择设备类型' }],
|
||||
},
|
||||
{
|
||||
label: '所属工厂',
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { formSchema } from '../MesXslEquipmentLedger.data';
|
||||
import { saveOrUpdate } from '../MesXslEquipmentLedger.api';
|
||||
import { fetchNextLedgerNo, saveOrUpdate } from '../MesXslEquipmentLedger.api';
|
||||
import MesXslProcessOperationSelectModal from '/@/views/xslmes/mesXslEquipmentCategory/components/MesXslProcessOperationSelectModal.vue';
|
||||
import MesXslManufacturerSelectModal from './MesXslManufacturerSelectModal.vue';
|
||||
import MesXslEquipmentCategorySelectModal from '/@/views/xslmes/mesXslEquipmentType/components/MesXslEquipmentCategorySelectModal.vue';
|
||||
@@ -112,7 +112,14 @@
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !data?.showFooter;
|
||||
if (unref(isUpdate)) await setFieldsValue({ ...data.record });
|
||||
else await setFieldsValue({ equipmentStatus: '0', enabledFlag: '1' });
|
||||
else {
|
||||
try {
|
||||
const nextNo = await fetchNextLedgerNo();
|
||||
await setFieldsValue({ equipmentStatus: '0', enabledFlag: '1', ledgerNo: nextNo });
|
||||
} catch {
|
||||
await setFieldsValue({ equipmentStatus: '0', enabledFlag: '1', ledgerNo: '' });
|
||||
}
|
||||
}
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user