diff --git a/src/api/eam/itemDelete/index.ts b/src/api/eam/itemDelete/index.ts new file mode 100644 index 000000000..417f114e1 --- /dev/null +++ b/src/api/eam/itemDelete/index.ts @@ -0,0 +1,65 @@ +import request from '@/config/axios' + +export interface ItemAccountsVO { + itemNumber: string + qty: number + areaNumber: string + isInAccount: string + siteId: string + available: string + concurrencyStamp: number +} + +// 查询备件台账移除列表 +export const getItemAccountsPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = { ...params } + data.qty = 0 + return await request.post({ url: '/eam/item-accounts/senior', data }) + } else { + params.qty = 0 + return await request.get({ url: `/eam/item-accounts/page`, params }) + } +} + +// 查询备件台账详情 +export const getItemAccounts = async (id: number) => { + return await request.get({ url: `/eam/item-accounts/get?id=` + id }) +} + +// 新增备件台账 +export const createItemAccounts = async (data: ItemAccountsVO) => { + return await request.post({ url: `/eam/item-accounts/create`, data }) +} + +// 修改备件台账 +export const updateItemAccounts = async (data: ItemAccountsVO) => { + return await request.put({ url: `/eam/item-accounts/update`, data }) +} + +// 删除备件台账 +export const deleteItemAccounts = async (id: number) => { + return await request.delete({ url: `/eam/item-accounts/delete?id=` + id }) +} + +// 导出备件台账 Excel +export const exportItemAccounts = async (params) => { + return await request.download({ url: `/eam/item-accounts/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/item-accounts/get-import-template' }) +} + +// 更改备件库位 +export const replaceLocation = async (data: Array) => { + return await request.post({ url: `/eam/item-accounts/replaceLocation `, data }) +} + +// 备件不分页 + +export const getItemAccountsNoPage = async (params) => { + return await request.get({ url: `/eam/item-accounts/noPage`, params }) +} diff --git a/src/api/eam/sparePartsApplyMain/index.ts b/src/api/eam/sparePartsApplyMain/index.ts index f2096f2d0..80288a681 100644 --- a/src/api/eam/sparePartsApplyMain/index.ts +++ b/src/api/eam/sparePartsApplyMain/index.ts @@ -65,18 +65,23 @@ export const importTemplate = () => { } // 撤回 -export const cancelSparePartsOutLocation = async (id) => { +export const cancelSparePartsApplyMain = async (id) => { return await request.get({ url: `/eam/spare-parts-apply-main/cancel?id=` + id }) } // 审核 -export const submitExamineSparePartsOutLocation = async (id) => { +export const submitSparePartsApplyMain = async (id) => { return await request.get({ url: `/eam/spare-parts-apply-main/submitExamine?id=` + id }) } // 审核驳回 -export const rejectSparePartsOutLocation = async (id) => { +export const rejectSparePartsApplyMain = async (id) => { return await request.get({ url: `/eam/spare-parts-apply-main/reject?id=` + id }) } // 审核通过 -export const approveSparePartsOutLocation = async (data) => { +export const approveSparePartsApplyMain = async (data) => { return await request.post({ url: `/eam/spare-parts-apply-main/approve`, data }) } + +// 完成 +export const finishSparePartsApplyMain = async (id) => { + return await request.post({ url: `/eam/spare-parts-apply-main/finish?id=` + id }) +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 993ce93a2..1067dc3c3 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -277,69 +277,70 @@ export enum DICT_TYPE { PREDICT_TIME_TYPE = 'predict_time_type', // 预测时间类型 PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型 TRANSFER_REASON = 'transfer_reason', // 调拨出入库原因 - PURCHASERECEIPT_SOURCE_TYPE="purchasereceipt_source_type",//采购收货数据来源 - PLAN_PRODUCTION_TYPE = "plan_production_type", // 生产计划类型 - DELIVER_TYPE="deliver_type",//发货类型 - BILL_TYPE="bill_type", // 发票类型 - CONTAIN_MANAGE_TYPE="contain_menage_type",//器具管理类型 + PURCHASERECEIPT_SOURCE_TYPE = 'purchasereceipt_source_type', //采购收货数据来源 + PLAN_PRODUCTION_TYPE = 'plan_production_type', // 生产计划类型 + DELIVER_TYPE = 'deliver_type', //发货类型 + BILL_TYPE = 'bill_type', // 发票类型 + CONTAIN_MANAGE_TYPE = 'contain_menage_type', //器具管理类型 // ========== 业务 - mes ========== - MESDO_STATUS= 'mes_do_status', // 工单执行状态 - MES_PROCESS_STATUS= 'mes_process_status', // 工单工序状态 - MES_WORKBILL_MODEL='mes_workbill_model',// 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单) - MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式 - MES_PLANDO_STATUS='mes_plando_status', //计划执行状 - PLAN_TYPE_MES='plan_type_mes', - HOLIDAY_TYPE='holiday_type', //节假日类型 + MESDO_STATUS = 'mes_do_status', // 工单执行状态 + MES_PROCESS_STATUS = 'mes_process_status', // 工单工序状态 + MES_WORKBILL_MODEL = 'mes_workbill_model', // 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单) + MES_TASK_MODE = 'mes_task_mode', //生产模式 派工方式、领工方式 + MES_PLANDO_STATUS = 'mes_plando_status', //计划执行状 + PLAN_TYPE_MES = 'plan_type_mes', + HOLIDAY_TYPE = 'holiday_type', //节假日类型 //========== QMS ========== - SAMPLING_TYPE = "sampling_type", // 取样类型 - EVALUATION_MODE = "evaluation_mode", // 评估模式 - INSPECTION_CHARACTERISTICS_FEATURE_TYPE = "inspection_characteristics_feature_type", // 特征类型 - INSPECTION_CHARACTERISTICS_RESULT_ENTRY = "inspection_characteristics_result_entry", // 结果录入方式 - INSPECTION_SEVERITY = 'inspection_severity',//检验严重性 - SPLIT_RULES = "split_rules", // 拆分规则 - INSPECTION_LEVEL = "inspection_level", // 检验水平字典 - BASIC_AQL = "basic_aql", // aql - EVALUATION_CODE = "evaluation_code", // 评估代码 - DEFECT_LEVEL = "defect_level", // 缺陷级别 - DICTIONARY_CLASS = "dictionary_class", // 字典分类 - USAGE_DECISION = "usage_decision", // 使用决策 - INSPECTION_BATCH_SOURCE = "inspection_batch_source", // 检验批来源 - QUALITY_NOTIFICATION_TYPE = "quality_notification_type", // 质量通知类型 - QUALITY_NOTICE_STATUS = "quality_notice_status", // 质量通知状态 - QUALITY_TASK_STATUS = "quality_task_status", // 质量通知任务状态 + SAMPLING_TYPE = 'sampling_type', // 取样类型 + EVALUATION_MODE = 'evaluation_mode', // 评估模式 + INSPECTION_CHARACTERISTICS_FEATURE_TYPE = 'inspection_characteristics_feature_type', // 特征类型 + INSPECTION_CHARACTERISTICS_RESULT_ENTRY = 'inspection_characteristics_result_entry', // 结果录入方式 + INSPECTION_SEVERITY = 'inspection_severity', //检验严重性 + SPLIT_RULES = 'split_rules', // 拆分规则 + INSPECTION_LEVEL = 'inspection_level', // 检验水平字典 + BASIC_AQL = 'basic_aql', // aql + EVALUATION_CODE = 'evaluation_code', // 评估代码 + DEFECT_LEVEL = 'defect_level', // 缺陷级别 + DICTIONARY_CLASS = 'dictionary_class', // 字典分类 + USAGE_DECISION = 'usage_decision', // 使用决策 + INSPECTION_BATCH_SOURCE = 'inspection_batch_source', // 检验批来源 + QUALITY_NOTIFICATION_TYPE = 'quality_notification_type', // 质量通知类型 + QUALITY_NOTICE_STATUS = 'quality_notice_status', // 质量通知状态 + QUALITY_TASK_STATUS = 'quality_task_status', // 质量通知任务状态 // ========== 业务 - mes -gaojs ========== - QUALIFY_STATUS = 'qualify_status',//质检状态 - QUALIFY_ITEM_DATA_TYPE='qualify_item_data_type',//质检项目数据类型 - QUALIFY_ITEM_VERIFY_MODE='qualify_item_verify_mode',//质检项目校验方式 - QUALIFY_FORM_OPERATION='qualify_form_operation',//质检表单操作 - OPERSTEP_COLLECT_TYPE='operstep_collect_type',//操作步骤采集方式 - REWORK_TYPE='rework_type',//工作类型:返工登记、返修登记 - REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成 - REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件 - DISMANTLING_BILL_TYPE = 'dismantling_bill_type',//工单类型 - DISMANTLING_MATERIAL_STATUS = 'dismantling_material_status',//报废拆解物料状态 - DISMANTLING_MATERIAL_HANDLE_STATUS = 'dismantling_material_handle_status',//报废拆解处理状态 - MES_REQUEST_TYPE = 'mes_request_type',//生产物料申请类型 + QUALIFY_STATUS = 'qualify_status', //质检状态 + QUALIFY_ITEM_DATA_TYPE = 'qualify_item_data_type', //质检项目数据类型 + QUALIFY_ITEM_VERIFY_MODE = 'qualify_item_verify_mode', //质检项目校验方式 + QUALIFY_FORM_OPERATION = 'qualify_form_operation', //质检表单操作 + OPERSTEP_COLLECT_TYPE = 'operstep_collect_type', //操作步骤采集方式 + REWORK_TYPE = 'rework_type', //工作类型:返工登记、返修登记 + REWORK_STATUS = 'rework_status', //返工返修状态:待返修,返修中,返修完成 + REWORK_REPLACE_FLAG = 'rework_replace_flag', //是否有替换件 + DISMANTLING_BILL_TYPE = 'dismantling_bill_type', //工单类型 + DISMANTLING_MATERIAL_STATUS = 'dismantling_material_status', //报废拆解物料状态 + DISMANTLING_MATERIAL_HANDLE_STATUS = 'dismantling_material_handle_status', //报废拆解处理状态 + MES_REQUEST_TYPE = 'mes_request_type', //生产物料申请类型 SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态 SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态 // ========== system - 消息通知优化 - ========== - MESSAGE_NOTICE_TABLE = 'message_notice_table',//消息通知表 - NOTICE_ACTION_TYPE = 'notice_action_type',//消息通知动作类型 - RECEIVER_TYPE = 'receiver_type',//接收人类型 + MESSAGE_NOTICE_TABLE = 'message_notice_table', //消息通知表 + NOTICE_ACTION_TYPE = 'notice_action_type', //消息通知动作类型 + RECEIVER_TYPE = 'receiver_type', //接收人类型 - BASIC_TEAM_TYPE='basic_team_type',//班组类型 - TAX_RATE_DICT='tax_rate_dict', //税率 + BASIC_TEAM_TYPE = 'basic_team_type', //班组类型 + TAX_RATE_DICT = 'tax_rate_dict', //税率 INTERFACE_STATUS = 'interfaceStatus', // 接口调用信息 接口状态 - SYSTEM_DAY = 'system_day', // 系统天数 + SYSTEM_DAY = 'system_day', // 系统天数 PURCHASE_INVOICE_ORDER_TYPE = 'purchase_invoice_order_type', // 发票采购订单类型 // ========== eam - 业务 - ========== DEVICE_TYPE = 'device_type', // 设备分类 + EAM_OUT_TYPE = 'eam_out_type', // 出库类型 IS_UPDATED = 'is_updated', //是否可修改 DATA_SCOPE = 'data_scope', // 数据范围 ROLE_STATUS = 'role_status', // 角色状态 @@ -353,10 +354,10 @@ export enum DICT_TYPE { REPAIR_DEGREE = 'repair_degree', //维修紧急程度 REPAIR_LEVEL = 'repair_level', //维修级别 IS_COMPLETED = 'is_completed', //是否完成 - MAINTENANCE_CYCLE ='maintenance_cycle', // 保养周期 - INSPECTION_CYCLE ='inspection_cycle', // 巡检周期 - SPOTCHECK_CYCLE ='spotcheck_cycle', // 巡检周期 - EAM_ORDER_STATUS = 'eam_order_status',// 工单状态 + MAINTENANCE_CYCLE = 'maintenance_cycle', // 保养周期 + INSPECTION_CYCLE = 'inspection_cycle', // 巡检周期 + SPOTCHECK_CYCLE = 'spotcheck_cycle', // 巡检周期 + EAM_ORDER_STATUS = 'eam_order_status', // 工单状态 TOOL_CLASS = 'tool_class', //工装类型 TOOL_OUT_TYPE = 'tool_out_type', //工装出库类型 EAM_PLAN_STATUS = 'eam_plan_status', // 保养计划状态 @@ -370,7 +371,7 @@ export enum DICT_TYPE { EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态 EAM_COMPLETE_RESULT = 'eam_complete_result', // 维修状态 OFF_BACK_STATUS = 'off_back_status', - SPAREPARTS_APPLY_STATUS_ENUM = 'spareparts_apply_status_enum',// 流程状态 + SPAREPARTS_APPLY_STATUS_ENUM = 'spareparts_apply_status_enum', // 流程状态 IS_LINE_ITEM = 'is_line_item', // 是否是线边 - PUT_IN_TYPE = 'put_in_type',// 入库类型 + PUT_IN_TYPE = 'put_in_type' // 入库类型 } diff --git a/src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts b/src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts index c8c2cd386..56a2508a2 100644 --- a/src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts +++ b/src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts @@ -15,51 +15,57 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas( field: 'number', sort: 'custom', isSearch: true, - isForm: false, + isForm: false + }, + { + label: '出库编号', + field: 'requestNumber', + sort: 'custom', + isSearch: true, + isForm: false }, { label: '入库主题', field: 'theme', sort: 'custom', - isSearch: true, - },{ + isSearch: true + }, + { label: '入库类型', field: 'type', sort: 'custom', dictType: DICT_TYPE.PUT_IN_TYPE, - dictClass: 'string', - + dictClass: 'string' }, { label: '流程状态', field: 'status', sort: 'custom', isSearch: false, - isForm:false, - + isForm: false, + dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, - dictClass: 'string', - + dictClass: 'string' }, { label: '入库申请人', field: 'applyer', sort: 'custom', - isSearch: false, + isSearch: false }, { label: '审核人', field: 'approver', sort: 'custom', isSearch: false, - isForm:false + isForm: false }, { label: '审核内容', field: 'approveContent', sort: 'custom', isSearch: false, - isForm:false + isForm: false }, { label: '审核时间', @@ -67,7 +73,7 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas( sort: 'custom', formatter: dateFormatter, isSearch: false, - isForm:false, + isForm: false, search: { component: 'DatePicker', componentProps: { @@ -85,7 +91,7 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas( }, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, + } }, { label: '入库时间', @@ -104,17 +110,15 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas( isForm: false, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, + } }, - - + { label: '备注', field: 'remark', sort: 'custom', - isSearch: false, - }, - + isSearch: false + } ]) ) @@ -138,9 +142,9 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( searchListPlaceholder: '请选择库位编号', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库位信息', // 查询弹窗标题 - - searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 - searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 + + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchCondition: [ { key: 'available', @@ -155,7 +159,7 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( searchListPlaceholder: '请选择备件编号', // 输入框占位文本 searchField: 'itemNumber', // 查询弹窗赋值字段 searchTitle: '备件信息', // 查询弹窗标题 - + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchCondition: [ @@ -177,7 +181,7 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( disabled: true } }, - tableForm:{ + tableForm: { disabled: true } }, @@ -193,7 +197,7 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( disabled: true } }, - tableForm:{ + tableForm: { disabled: true } }, @@ -205,13 +209,13 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( tableForm: { disabled: true }, - form:{ - componentProps:{ - disabled: true - } + form: { + componentProps: { + disabled: true + } }, - isDetail:false, - isTable:false + isDetail: false, + isTable: false }, { label: '申领数量', @@ -234,14 +238,14 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( } }, isForm: false, - isTableForm:false + isTableForm: false }, { label: '备注', field: 'remark', sort: 'custom', - isSearch: true, - }, + isSearch: true + } ]) ) diff --git a/src/views/eam/itemDelete/index.vue b/src/views/eam/itemDelete/index.vue new file mode 100644 index 000000000..3d750cfe9 --- /dev/null +++ b/src/views/eam/itemDelete/index.vue @@ -0,0 +1,399 @@ + + + diff --git a/src/views/eam/itemDelete/itemAccounts.data.ts b/src/views/eam/itemDelete/itemAccounts.data.ts new file mode 100644 index 000000000..0f1284160 --- /dev/null +++ b/src/views/eam/itemDelete/itemAccounts.data.ts @@ -0,0 +1,352 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' + +import * as LocationApi from '@/api/wms/location' +import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' + +import * as SparePartApi from '@/api/eam/sparePart' +import { SparePart } from '@/views/eam/sparePart/sparePart.data' + +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const ItemAccountsRules = reactive({ + itemNumber: [required], + singlePrice: [required], + locationNumber: [required], + qty: [required] +}) + +export const ItemAccounts = useCrudSchemas( + reactive([ + { + label: '备件编号', + field: 'itemNumber', + sort: 'custom', + table: { + width: 180, + fixed: 'left' + }, + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '编号信息', // 查询弹窗标题 + searchAllSchemas: SparePart.allSchemas, // 查询弹窗所需类 + searchPage: SparePartApi.getSparePartPage, // 查询弹窗所需分页方法 + searchCondition: [ + // { + // key: 'warehouseCode', + // value: 'warehouseCode', + // message: '请填写仓库代码!', + // isMainValue: true + // }, + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + } + }, + + { + label: '备件名称', + field: 'name', + sort: 'custom', + isSearch: true, + isForm: true, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '备件分类', + field: 'classification', + sort: 'custom', + dictType: DICT_TYPE.PART_CLASS, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: false, + form: { + component: 'Select', + componentProps: { + disabled: true + } + } + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + isTable: false, + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '规格型号', + field: 'specifications', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '存放位置', + field: 'locationNumber', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位编号', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 + searchCondition: [ + // { + // key: 'warehouseCode', + // value: 'warehouseCode', + // message: '请填写仓库代码!', + // isMainValue: true + // }, + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + } + }, + { + label: '库区编号', + field: 'areaNumber', + sort: 'custom', + isTable: false, + isSearch: true, + table: { + width: 180 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '库存数量', + field: 'qty', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + } + }, + + // { + // label: '品牌', + // field: 'brand', + // sort: 'custom', + // isSearch: false, + // form: { + // componentProps: { + // disabled: true + // } + // } + // }, + + // { + // label: '是否全局', + // field: 'isOverall', + // sort: 'custom', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // isSearch: false, + // form: { + // component: 'Switch', + // value: 'TRUE', + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE', + // disabled: true + // } + // } + // }, + // { + // label: '科目', + // field: 'subject', + // sort: 'custom', + // dictType: DICT_TYPE.SUBJECT, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // isSearch: false, + // form: { + // component: 'Select', + // componentProps: { + // disabled: true + // } + // } + // }, + // { + // label: '科目代码', + // field: 'subjectCode', + // sort: 'custom', + // isSearch: false, + // form: { + // componentProps: { + // disabled: true + // } + // } + // }, + // { + // label: '类别', + // field: 'type', + // sort: 'custom', + // isSearch: false, + // form: { + // componentProps: { + // disabled: true + // } + // } + // }, + // { + // label: '区域', + // field: 'region', + // sort: 'custom', + // dictType: DICT_TYPE.REGION, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // isSearch: false, + // form: { + // component: 'Select', + // componentProps: { + // disabled: true + // } + // } + // }, + + { + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: false, + form: { + componentProps: { + disabled: true + } + } + }, + + { + label: '生产厂家', + field: 'manufacturer', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + } + }, + // { + // label: '库存下限', + // field: 'minInventory', + // sort: 'custom', + // isSearch: false, + // form: { + // component: 'InputNumber', + // value: 0, + // componentProps: { + // disabled: true + // } + // } + // }, + // { + // label: '库存上限', + // field: 'maxInventory', + // sort: 'custom', + // isSearch: false, + // form: { + // component: 'InputNumber', + // value: 0, + // componentProps: { + // disabled: true + // } + // } + // }, + // { + // label: '更换周期', + // field: 'replacementCycle', + // sort: 'custom', + // isSearch: false, + // form: { + // component: 'InputNumber', + // value: 0, + // componentProps: { + // disabled: true + // } + // } + // }, + // { + // label: '存放位置描述', + // field: 'storageLocation', + // sort: 'custom', + // isSearch: false, + // form: { + // componentProps: { + // disabled: true + // } + // } + // }, + // { + // label: '备注', + // field: 'remark', + // sort: 'custom', + // isSearch: false, + // componentProps: { + // disabled: true + // } + // }, + // { + // label: '是否可用', + // field: 'available', + // sort: 'custom', + // isSearch: false, + // isTable: false, + // isForm: false, + // isDetail: false, + // componentProps: { + // disabled: true + // } + // }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } + ]) +) diff --git a/src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts b/src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts index 799716543..19a1a537a 100644 --- a/src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts +++ b/src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts @@ -17,11 +17,81 @@ export const SparePartsApplyMain = useCrudSchemas( isSearch: true, isForm: false }, + { + label: '出库类型', + field: 'outType', + dictType: DICT_TYPE.EAM_OUT_TYPE, + dictClass: 'string', + isTable: true, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + tableForm: { + type: 'Select' + } + }, + { + label: '关联工单', + field: 'workNumber', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchTitle: '设备信息', // 查询弹窗标题 + searchListPlaceholder: '请选择 设备编号', // 输入框占位文本 + searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类 + searchField: 'code', // 查询弹窗赋值字段 + searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法 + multiple: true, + searchCondition: [ + { + key: 'status', + value: 'NORMAL', + action: '==', + isSearch: true, + isMainValue: false + } + ] + } + }, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '备件信息', // 查询弹窗标题 + searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类 + searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'status', + value: 'NORMAL', + action: '==', + isSearch: true, + isMainValue: false + } + ] + } + }, + + { + label: '出库主题', + field: 'theme', + sort: 'custom', + isSearch: true + }, { label: '描述', field: 'description', sort: 'custom', - isSearch: true + isSearch: false, + isTable: false, + isForm: false }, { label: '申领备件总价', @@ -38,6 +108,8 @@ export const SparePartsApplyMain = useCrudSchemas( dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, + isTable: true, + isForm: false, form: { component: 'Select' } @@ -136,11 +208,11 @@ export const SparePartsApplyMain = useCrudSchemas( isForm: false }, { - label: '操作', + label: '操作11', field: 'action', isForm: false, table: { - width: 150, + width: 180, fixed: 'right' } } @@ -149,7 +221,8 @@ export const SparePartsApplyMain = useCrudSchemas( //表单校验 export const SparePartsApplyMainRules = reactive({ - description: [{ required: true, message: '描述不能为空', trigger: 'change' }] + outType: [{ required: true, message: '请输入出库类型', trigger: 'blur' }], + theme: [{ required: true, message: '请输入出库主题', trigger: 'blur' }] }) /** * @returns {Array} 备件申请子表 @@ -197,67 +270,6 @@ export const SparePartsApplyDetail = useCrudSchemas( ] } }, - { - label: '设备类别', - field: 'type', - dictType: DICT_TYPE.DEVICE_TYPE, - dictClass: 'string', - isTable: true, - sort: 'custom', - isSearch: false, - table: { - width: 150 - }, - tableForm: { - type: 'Select' - } - }, - { - label: '设备工装编号', - field: 'equipmentCode', - sort: 'custom', - table: { - width: 150 - }, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - isSearchList: true, // 开启查询弹窗 - searchTitle: '设备信息', // 查询弹窗标题 - searchListPlaceholder: '请选择 设备编号', // 输入框占位文本 - searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类 - searchField: 'code', // 查询弹窗赋值字段 - searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法 - multiple: true, - searchCondition: [ - { - key: 'status', - value: 'NORMAL', - action: '==', - isSearch: true, - isMainValue: false - } - ] - } - }, - tableForm: { - isInpuFocusShow: true, - searchListPlaceholder: '请选择备件编号', // 输入框占位文本 - searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '备件信息', // 查询弹窗标题 - searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类 - searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法 - searchCondition: [ - { - key: 'status', - value: 'NORMAL', - action: '==', - isSearch: true, - isMainValue: false - } - ] - } - }, { label: '库存数量', @@ -298,3 +310,21 @@ export const SparePartsApplyDetail = useCrudSchemas( export const SparePartsApplyDetailRules = reactive({ applyQty: [{ required: true, message: '请输入标包数量', trigger: 'blur' }] }) + +// 审核完成字段 +export const SparePartsApplyExamine = useCrudSchemas( + reactive([ + { + label: '审核内容', + field: 'approveContent', + sort: 'custom', + isSearch: false, + form: { + component: 'Input', + componentProps: { + type: 'textarea' + } + } + } + ]) +) diff --git a/src/views/eam/sparePartsApplyMain/index.vue b/src/views/eam/sparePartsApplyMain/index.vue index 698503b35..a74455eb8 100644 --- a/src/views/eam/sparePartsApplyMain/index.vue +++ b/src/views/eam/sparePartsApplyMain/index.vue @@ -61,6 +61,7 @@ @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" + @onChange="onChange" /> @@ -79,6 +80,16 @@ :detailButtonIsShow="true" /> + + + + { tableColumns.value = val @@ -199,9 +210,8 @@ const buttonBaseClick = (val, item) => { } } -// 根据状态返回该按钮是否显示 -const isShowMainButton = (row, val) => { - if (val.indexOf(row.available) > -1) { +const isShowStatusButton = (row, val) => { + if (val.indexOf(row.status) > -1) { return false } else { return true @@ -211,7 +221,34 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - // defaultButtons.mainAdjust(null),// 盘点调整 + defaultButtons.mainListEditBtn({ + hide: isShowStatusButton(row, ['0']), + hasPermi: 'eam:spare-parts-in-location-main:update' + }), // 编辑 + defaultButtons.mainListDeleteBtn({ + hide: isShowStatusButton(row, ['0']), + hasPermi: 'eam:spare-parts-in-location-main:delete' + }), // 删除 + defaultButtons.mainListAuditingBtn({ + hide: isShowStatusButton(row, ['0']), + hasPermi: 'eam:spare-parts-in-location-main:examine' + }), //审核 + defaultButtons.mainListRevokeBtn({ + hide: isShowStatusButton(row, ['3']), + hasPermi: 'eam:spare-parts-in-location-main:cancel' + }), // 撤回 + defaultButtons.mainListTurnDownBtn({ + hide: isShowStatusButton(row, ['3']), + hasPermi: 'eam:spare-parts-in-location-main:rejecte' + }), //驳回 + defaultButtons.mainListApproveBtn({ + hide: isShowStatusButton(row, ['3']), + hasPermi: 'eam:spare-parts-in-location-main:approve' + }), //审批通过 + defaultButtons.mainListFinishBtn({ + hide: isShowStatusButton(row, ['4']), + hasPermi: 'eam:spare-parts-in-location-main:finish' + }) //完成 ] } @@ -220,12 +257,22 @@ const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - } - // else if (val == 'mainOrderClo') { - // // 关闭 - // handleClose(row.id) - // } - else if (val == 'delete') { + } else if (val == 'auditing') { + //审核 + handleSubmitExamine(row.id) + } else if (val == 'mainTurnDown') { + //驳回 + handleRejecte(row.id) + } else if (val == 'mainApprove') { + //审核通过 + formRefApproved.value.open('update', row, { masterId: row.id }, 'auditing') + } else if (val == 'revoke') { + // 撤回 + handleCancel(row.id) + } else if (val == 'finish') { + // 完成 + handleFinish(row.id) + } else if (val == 'delete') { // 删除 handleDelete(row.id) } @@ -322,6 +369,13 @@ const handleDeleteTable = (item, index) => { // 主子数据 提交 const submitForm = async (formType, data) => { data.subList = tableData.value // 拼接子表数据参数 + console.log(formRef.value) + formRef.value.formLoading = true + let isHave = data.subList.some((item) => item.applyQty > item.currentQty) + if (isHave) { + message.warning('申领数量不能大于库存数量') + return + } try { if (formType === 'create') { await SparePartsApplyMainApi.createSparePartsApplyMain(data) @@ -364,6 +418,81 @@ const searchFormClick = (searchData) => { getList() // 刷新当前列表 } +const onChange = (field, item) => { + if (field == 'outType') { + if (item == '3') { + SparePartsApplyMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'workNumber') { + item.componentProps.disabled = true + item.componentProps.isSearchList = false + } + }) + } else { + SparePartsApplyMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'workNumber') { + item.componentProps.disabled = true + item.componentProps.isSearchList = true + } + }) + } + } +} + +// 审核 +const handleSubmitExamine = async (id: number) => { + await message.delConfirm(t('ts.是否提交审核?')) + try { + await SparePartsApplyMainApi.submitSparePartsApplyMain(id) + message.success(t('ts.提交审批成功!')) + // 刷新列表 + await getList() + } catch {} +} +/** 撤回按钮操作 */ +const handleCancel = async (id: number) => { + await message.delConfirm(t('ts.是否撤回所选中数据?')) + try { + await SparePartsApplyMainApi.cancelSparePartsApplyMain(id) + message.success(t('ts.撤回成功!')) + // 刷新列表 + await getList() + } catch {} +} + +//审核驳回按钮 +const handleRejecte = async (id: number) => { + await message.delConfirm(t('ts.是否驳回所选中数据?')) + try { + await SparePartsApplyMainApi.rejectSparePartsApplyMain(id) + message.success(t('ts.驳回成功!')) + // 刷新列表 + await getList() + } catch {} +} +// 审核通过 +const approveSparePartsApplyMain = async (formType, data) => { + try { + await SparePartsApplyMainApi.approveSparePartsApplyMain(data) + message.success(t('ts.审核通过!')) + // 刷新列表 + formRefApproved.value.dialogVisible = false + await getList() + } finally { + formRefApproved.value.formLoading = false + } +} + +//审核驳回按钮 +const handleFinish = async (id: number) => { + await message.delConfirm(t('ts.是否完成所选中数据?')) + try { + await SparePartsApplyMainApi.finishSparePartsApplyMain(id) + message.success(t('ts.完成成功!')) + // 刷新列表 + await getList() + } catch {} +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts b/src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts index e1747c8de..a4fdd03c6 100644 --- a/src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts +++ b/src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts @@ -11,12 +11,19 @@ import { dateFormatter } from '@/utils/formatTime' export const SparePartsOutLocationMain = useCrudSchemas( reactive([ { - label: '申请编号', + label: '编号', field: 'number', sort: 'custom', isSearch: true, isForm: false }, + { + label: '申请编号', + field: 'applyNumber', + sort: 'custom', + isSearch: true, + isForm: false + }, { label: '描述', field: 'description',