Browse Source

EAM备件申领代码上传

master_hella_20240701
叶佳兴 8 months ago
parent
commit
2d42abb7e1
  1. 65
      src/api/eam/itemDelete/index.ts
  2. 13
      src/api/eam/sparePartsApplyMain/index.ts
  3. 105
      src/utils/dict.ts
  4. 74
      src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts
  5. 399
      src/views/eam/itemDelete/index.vue
  6. 352
      src/views/eam/itemDelete/itemAccounts.data.ts
  7. 160
      src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts
  8. 151
      src/views/eam/sparePartsApplyMain/index.vue
  9. 9
      src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts

65
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<ItemAccountsVO>) => {
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 })
}

13
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 }) 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 }) 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 }) 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 }) 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 })
}

105
src/utils/dict.ts

@ -277,69 +277,70 @@ export enum DICT_TYPE {
PREDICT_TIME_TYPE = 'predict_time_type', // 预测时间类型 PREDICT_TIME_TYPE = 'predict_time_type', // 预测时间类型
PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型 PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型
TRANSFER_REASON = 'transfer_reason', // 调拨出入库原因 TRANSFER_REASON = 'transfer_reason', // 调拨出入库原因
PURCHASERECEIPT_SOURCE_TYPE="purchasereceipt_source_type",//采购收货数据来源 PURCHASERECEIPT_SOURCE_TYPE = 'purchasereceipt_source_type', //采购收货数据来源
PLAN_PRODUCTION_TYPE = "plan_production_type", // 生产计划类型 PLAN_PRODUCTION_TYPE = 'plan_production_type', // 生产计划类型
DELIVER_TYPE="deliver_type",//发货类型 DELIVER_TYPE = 'deliver_type', //发货类型
BILL_TYPE="bill_type", // 发票类型 BILL_TYPE = 'bill_type', // 发票类型
CONTAIN_MANAGE_TYPE="contain_menage_type",//器具管理类型 CONTAIN_MANAGE_TYPE = 'contain_menage_type', //器具管理类型
// ========== 业务 - mes ========== // ========== 业务 - mes ==========
MESDO_STATUS= 'mes_do_status', // 工单执行状态 MESDO_STATUS = 'mes_do_status', // 工单执行状态
MES_PROCESS_STATUS= 'mes_process_status', // 工单工序状态 MES_PROCESS_STATUS = 'mes_process_status', // 工单工序状态
MES_WORKBILL_MODEL='mes_workbill_model',// 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单) MES_WORKBILL_MODEL = 'mes_workbill_model', // 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单)
MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式 MES_TASK_MODE = 'mes_task_mode', //生产模式 派工方式、领工方式
MES_PLANDO_STATUS='mes_plando_status', //计划执行状 MES_PLANDO_STATUS = 'mes_plando_status', //计划执行状
PLAN_TYPE_MES='plan_type_mes', PLAN_TYPE_MES = 'plan_type_mes',
HOLIDAY_TYPE='holiday_type', //节假日类型 HOLIDAY_TYPE = 'holiday_type', //节假日类型
//========== QMS ========== //========== QMS ==========
SAMPLING_TYPE = "sampling_type", // 取样类型 SAMPLING_TYPE = 'sampling_type', // 取样类型
EVALUATION_MODE = "evaluation_mode", // 评估模式 EVALUATION_MODE = 'evaluation_mode', // 评估模式
INSPECTION_CHARACTERISTICS_FEATURE_TYPE = "inspection_characteristics_feature_type", // 特征类型 INSPECTION_CHARACTERISTICS_FEATURE_TYPE = 'inspection_characteristics_feature_type', // 特征类型
INSPECTION_CHARACTERISTICS_RESULT_ENTRY = "inspection_characteristics_result_entry", // 结果录入方式 INSPECTION_CHARACTERISTICS_RESULT_ENTRY = 'inspection_characteristics_result_entry', // 结果录入方式
INSPECTION_SEVERITY = 'inspection_severity',//检验严重性 INSPECTION_SEVERITY = 'inspection_severity', //检验严重性
SPLIT_RULES = "split_rules", // 拆分规则 SPLIT_RULES = 'split_rules', // 拆分规则
INSPECTION_LEVEL = "inspection_level", // 检验水平字典 INSPECTION_LEVEL = 'inspection_level', // 检验水平字典
BASIC_AQL = "basic_aql", // aql BASIC_AQL = 'basic_aql', // aql
EVALUATION_CODE = "evaluation_code", // 评估代码 EVALUATION_CODE = 'evaluation_code', // 评估代码
DEFECT_LEVEL = "defect_level", // 缺陷级别 DEFECT_LEVEL = 'defect_level', // 缺陷级别
DICTIONARY_CLASS = "dictionary_class", // 字典分类 DICTIONARY_CLASS = 'dictionary_class', // 字典分类
USAGE_DECISION = "usage_decision", // 使用决策 USAGE_DECISION = 'usage_decision', // 使用决策
INSPECTION_BATCH_SOURCE = "inspection_batch_source", // 检验批来源 INSPECTION_BATCH_SOURCE = 'inspection_batch_source', // 检验批来源
QUALITY_NOTIFICATION_TYPE = "quality_notification_type", // 质量通知类型 QUALITY_NOTIFICATION_TYPE = 'quality_notification_type', // 质量通知类型
QUALITY_NOTICE_STATUS = "quality_notice_status", // 质量通知状态 QUALITY_NOTICE_STATUS = 'quality_notice_status', // 质量通知状态
QUALITY_TASK_STATUS = "quality_task_status", // 质量通知任务状态 QUALITY_TASK_STATUS = 'quality_task_status', // 质量通知任务状态
// ========== 业务 - mes -gaojs ========== // ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态 QUALIFY_STATUS = 'qualify_status', //质检状态
QUALIFY_ITEM_DATA_TYPE='qualify_item_data_type',//质检项目数据类型 QUALIFY_ITEM_DATA_TYPE = 'qualify_item_data_type', //质检项目数据类型
QUALIFY_ITEM_VERIFY_MODE='qualify_item_verify_mode',//质检项目校验方式 QUALIFY_ITEM_VERIFY_MODE = 'qualify_item_verify_mode', //质检项目校验方式
QUALIFY_FORM_OPERATION='qualify_form_operation',//质检表单操作 QUALIFY_FORM_OPERATION = 'qualify_form_operation', //质检表单操作
OPERSTEP_COLLECT_TYPE='operstep_collect_type',//操作步骤采集方式 OPERSTEP_COLLECT_TYPE = 'operstep_collect_type', //操作步骤采集方式
REWORK_TYPE='rework_type',//工作类型:返工登记、返修登记 REWORK_TYPE = 'rework_type', //工作类型:返工登记、返修登记
REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成 REWORK_STATUS = 'rework_status', //返工返修状态:待返修,返修中,返修完成
REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件 REWORK_REPLACE_FLAG = 'rework_replace_flag', //是否有替换件
DISMANTLING_BILL_TYPE = 'dismantling_bill_type',//工单类型 DISMANTLING_BILL_TYPE = 'dismantling_bill_type', //工单类型
DISMANTLING_MATERIAL_STATUS = 'dismantling_material_status',//报废拆解物料状态 DISMANTLING_MATERIAL_STATUS = 'dismantling_material_status', //报废拆解物料状态
DISMANTLING_MATERIAL_HANDLE_STATUS = 'dismantling_material_handle_status',//报废拆解处理状态 DISMANTLING_MATERIAL_HANDLE_STATUS = 'dismantling_material_handle_status', //报废拆解处理状态
MES_REQUEST_TYPE = 'mes_request_type',//生产物料申请类型 MES_REQUEST_TYPE = 'mes_request_type', //生产物料申请类型
SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态 SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态
SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态 SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态
// ========== system - 消息通知优化 - ========== // ========== system - 消息通知优化 - ==========
MESSAGE_NOTICE_TABLE = 'message_notice_table',//消息通知表 MESSAGE_NOTICE_TABLE = 'message_notice_table', //消息通知表
NOTICE_ACTION_TYPE = 'notice_action_type',//消息通知动作类型 NOTICE_ACTION_TYPE = 'notice_action_type', //消息通知动作类型
RECEIVER_TYPE = 'receiver_type',//接收人类型 RECEIVER_TYPE = 'receiver_type', //接收人类型
BASIC_TEAM_TYPE='basic_team_type',//班组类型 BASIC_TEAM_TYPE = 'basic_team_type', //班组类型
TAX_RATE_DICT='tax_rate_dict', //税率 TAX_RATE_DICT = 'tax_rate_dict', //税率
INTERFACE_STATUS = 'interfaceStatus', // 接口调用信息 接口状态 INTERFACE_STATUS = 'interfaceStatus', // 接口调用信息 接口状态
SYSTEM_DAY = 'system_day', // 系统天数 SYSTEM_DAY = 'system_day', // 系统天数
PURCHASE_INVOICE_ORDER_TYPE = 'purchase_invoice_order_type', // 发票采购订单类型 PURCHASE_INVOICE_ORDER_TYPE = 'purchase_invoice_order_type', // 发票采购订单类型
// ========== eam - 业务 - ========== // ========== eam - 业务 - ==========
DEVICE_TYPE = 'device_type', // 设备分类 DEVICE_TYPE = 'device_type', // 设备分类
EAM_OUT_TYPE = 'eam_out_type', // 出库类型
IS_UPDATED = 'is_updated', //是否可修改 IS_UPDATED = 'is_updated', //是否可修改
DATA_SCOPE = 'data_scope', // 数据范围 DATA_SCOPE = 'data_scope', // 数据范围
ROLE_STATUS = 'role_status', // 角色状态 ROLE_STATUS = 'role_status', // 角色状态
@ -353,10 +354,10 @@ export enum DICT_TYPE {
REPAIR_DEGREE = 'repair_degree', //维修紧急程度 REPAIR_DEGREE = 'repair_degree', //维修紧急程度
REPAIR_LEVEL = 'repair_level', //维修级别 REPAIR_LEVEL = 'repair_level', //维修级别
IS_COMPLETED = 'is_completed', //是否完成 IS_COMPLETED = 'is_completed', //是否完成
MAINTENANCE_CYCLE ='maintenance_cycle', // 保养周期 MAINTENANCE_CYCLE = 'maintenance_cycle', // 保养周期
INSPECTION_CYCLE ='inspection_cycle', // 巡检周期 INSPECTION_CYCLE = 'inspection_cycle', // 巡检周期
SPOTCHECK_CYCLE ='spotcheck_cycle', // 巡检周期 SPOTCHECK_CYCLE = 'spotcheck_cycle', // 巡检周期
EAM_ORDER_STATUS = 'eam_order_status',// 工单状态 EAM_ORDER_STATUS = 'eam_order_status', // 工单状态
TOOL_CLASS = 'tool_class', //工装类型 TOOL_CLASS = 'tool_class', //工装类型
TOOL_OUT_TYPE = 'tool_out_type', //工装出库类型 TOOL_OUT_TYPE = 'tool_out_type', //工装出库类型
EAM_PLAN_STATUS = 'eam_plan_status', // 保养计划状态 EAM_PLAN_STATUS = 'eam_plan_status', // 保养计划状态
@ -370,7 +371,7 @@ export enum DICT_TYPE {
EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态 EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态
EAM_COMPLETE_RESULT = 'eam_complete_result', // 维修状态 EAM_COMPLETE_RESULT = 'eam_complete_result', // 维修状态
OFF_BACK_STATUS = 'off_back_status', 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', // 是否是线边 IS_LINE_ITEM = 'is_line_item', // 是否是线边
PUT_IN_TYPE = 'put_in_type',// 入库类型 PUT_IN_TYPE = 'put_in_type' // 入库类型
} }

74
src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts

@ -15,51 +15,57 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas(
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: false
},
{
label: '出库编号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
isForm: false
}, },
{ {
label: '入库主题', label: '入库主题',
field: 'theme', field: 'theme',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true
},{ },
{
label: '入库类型', label: '入库类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.PUT_IN_TYPE, dictType: DICT_TYPE.PUT_IN_TYPE,
dictClass: 'string', dictClass: 'string'
}, },
{ {
label: '流程状态', label: '流程状态',
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM,
dictClass: 'string', dictClass: 'string'
}, },
{ {
label: '入库申请人', label: '入库申请人',
field: 'applyer', field: 'applyer',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false
}, },
{ {
label: '审核人', label: '审核人',
field: 'approver', field: 'approver',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false isForm: false
}, },
{ {
label: '审核内容', label: '审核内容',
field: 'approveContent', field: 'approveContent',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false isForm: false
}, },
{ {
label: '审核时间', label: '审核时间',
@ -67,7 +73,7 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas(
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false, isForm: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -85,7 +91,7 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas(
}, },
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, }
}, },
{ {
label: '入库时间', label: '入库时间',
@ -104,17 +110,15 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas(
isForm: false, isForm: false,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, }
}, },
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false
}, }
]) ])
) )
@ -138,9 +142,9 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas(
searchListPlaceholder: '请选择库位编号', // 输入框占位文本 searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题 searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [ searchCondition: [
{ {
key: 'available', key: 'available',
@ -155,7 +159,7 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas(
searchListPlaceholder: '请选择备件编号', // 输入框占位文本 searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段 searchField: 'itemNumber', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题 searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [ searchCondition: [
@ -177,7 +181,7 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas(
disabled: true disabled: true
} }
}, },
tableForm:{ tableForm: {
disabled: true disabled: true
} }
}, },
@ -193,7 +197,7 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas(
disabled: true disabled: true
} }
}, },
tableForm:{ tableForm: {
disabled: true disabled: true
} }
}, },
@ -205,13 +209,13 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas(
tableForm: { tableForm: {
disabled: true disabled: true
}, },
form:{ form: {
componentProps:{ componentProps: {
disabled: true disabled: true
} }
}, },
isDetail:false, isDetail: false,
isTable:false isTable: false
}, },
{ {
label: '申领数量', label: '申领数量',
@ -234,14 +238,14 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas(
} }
}, },
isForm: false, isForm: false,
isTableForm:false isTableForm: false
}, },
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true
}, }
]) ])
) )

399
src/views/eam/itemDelete/index.vue

@ -0,0 +1,399 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="ItemAccounts.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemAccounts.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
<!-- <template #upload="{ row }">
<ButtonBase
v-if="row.filePathList != null && row.filePathList.length != 0"
:Butttondata="butttondataView(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> -->
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemAccountsRules"
:formAllSchemas="ItemAccounts.allSchemas"
:apiUpdate="ItemAccountsApi.updateItemAccounts"
:apiCreate="ItemAccountsApi.createItemAccounts"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemAccounts.allSchemas" />
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/item-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemAccounts, ItemAccountsRules } from './itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/itemDelete'
import { SparePart } from '@/views/eam/sparePart/sparePart.data'
import * as ItemApi from '@/api/eam/sparePart'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ItemDelete' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const locationNumber = ref()
const wantId1 = ref()
routeName.value = route.name
const tableColumns = ref(ItemAccounts.allSchemas.tableColumns)
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'locationNumber') {
setV['locationNumber'] = val[0].code
setV['areaNumber'] = val[0].areaCode
}
if (formField == 'itemNumber') {
setV['itemNumber'] = val[0].code
setV['name'] = val[0].name
setV['brand'] = val[0].brand
setV['specifications'] = val[0].specifications
setV['isOverall'] = val[0].isOverall
setV['subject'] = val[0].subject
setV['subjectCode'] = val[0].subjectCode
setV['type'] = val[0].type
setV['region'] = val[0].region
setV['classification'] = val[0].classification
setV['uom'] = val[0].uom
setV['manufacturer'] = val[0].manufacturer
setV['minInventory'] = val[0].minInventory
setV['maxInventory'] = val[0].maxInventory
setV['replacementCycle'] = val[0].replacementCycle
setV['storageLocation'] = val[0].storageLocation
setV['remark'] = val[0].remark
setV['available'] = val[0].available
}
formRef.setValues(setV)
})
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ItemAccountsApi.getItemAccountsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'item:itemAccounts:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'item:itemAccounts:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'item:itemAccounts:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// -
// const butttondata = [
// defaultButtons.mainListEditBtn({ hasPermi: 'item:itemAccounts:update' }), //
// defaultButtons.replaceLocation({ hasPermi: 'item:itemAccounts:replaceLocation' }), //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemAccounts:delete' }) //
// ]
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'item:itemAccounts:update' }), //
// defaultButtons.replaceLocation({ hasPermi: 'item:itemAccounts:replaceLocation' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemAccounts:delete' }) //
// defaultButtons.viewBtn({ hide: !(row.filePathList != null && row.filePathList.length != 0) })
//defaultButtons.backoutBtn({hasPermi:'eam:device-repair-request:cancel', hide: !(row.result == 'PENDING' && row.declarer == userStore.getUser.id )}), //
]
}
// -
const butttondataView = (row) => {
return [defaultButtons.viewBtn(null)]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'replaceLocation') {
openItem(row.locationNumber, row.id)
} else if (val == 'view') {
//
openForm('view', row)
}
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String, wantId: number) => {
locationNumber.value = number
wantId1.value = wantId
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
ItemApi.getItemPage,
null,
Item.allSchemas.searchSchema,
true,
null,
null,
null,
null
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
id: wantId1.value,
locationNumber: locationNumber.value,
itemNumber: element.number
}))
ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => {
message.success(t('更换成功'))
//
getList()
})
}
const getItemWithOutBind = async () => {
try {
const res = await ItemApi.getItemPage({
...Item.allSchemas.searchSchema,
available: 'TRUE'
})
if (res.list?.length > 0) {
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema);
// const filteredList = res.list.filter(item => {
// return !response.list?.some(element => {
// return item.number === element.itemNumber
// });
// });
// console.log('filteredList',filteredList);
const filteredList = res.list
return filteredList //
}
return [] //
} catch (error) {
console.error(error)
throw error //
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if (type == 'view') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} else {
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType, data) => {
var isHave = ItemAccounts.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return
}
}
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await ItemAccountsApi.createItemAccounts(data)
message.success(t('common.createSuccess'))
} else {
await ItemAccountsApi.updateItemAccounts(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemAccounts')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ItemAccountsApi.deleteItemAccounts(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ItemAccountsApi.exportItemAccounts(tableObject.params)
download.excel(data, '备件台账.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemAccountsApi.importTemplate()
})
</script>

352
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<CrudSchema[]>([
{
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'
}
}
])
)

160
src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts

@ -17,11 +17,81 @@ export const SparePartsApplyMain = useCrudSchemas(
isSearch: true, isSearch: true,
isForm: false 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: '描述', label: '描述',
field: 'description', field: 'description',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: false,
isTable: false,
isForm: false
}, },
{ {
label: '申领备件总价', label: '申领备件总价',
@ -38,6 +108,8 @@ export const SparePartsApplyMain = useCrudSchemas(
dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, isSearch: true,
isTable: true,
isForm: false,
form: { form: {
component: 'Select' component: 'Select'
} }
@ -136,11 +208,11 @@ export const SparePartsApplyMain = useCrudSchemas(
isForm: false isForm: false
}, },
{ {
label: '操作', label: '操作11',
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 150, width: 180,
fixed: 'right' fixed: 'right'
} }
} }
@ -149,7 +221,8 @@ export const SparePartsApplyMain = useCrudSchemas(
//表单校验 //表单校验
export const SparePartsApplyMainRules = reactive({ export const SparePartsApplyMainRules = reactive({
description: [{ required: true, message: '描述不能为空', trigger: 'change' }] outType: [{ required: true, message: '请输入出库类型', trigger: 'blur' }],
theme: [{ required: true, message: '请输入出库主题', trigger: 'blur' }]
}) })
/** /**
* @returns {Array} * @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: '库存数量', label: '库存数量',
@ -298,3 +310,21 @@ export const SparePartsApplyDetail = useCrudSchemas(
export const SparePartsApplyDetailRules = reactive({ export const SparePartsApplyDetailRules = reactive({
applyQty: [{ required: true, message: '请输入标包数量', trigger: 'blur' }] applyQty: [{ required: true, message: '请输入标包数量', trigger: 'blur' }]
}) })
// 审核完成字段
export const SparePartsApplyExamine = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea'
}
}
}
])
)

151
src/views/eam/sparePartsApplyMain/index.vue

@ -61,6 +61,7 @@
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@onChange="onChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -79,6 +80,16 @@
:detailButtonIsShow="true" :detailButtonIsShow="true"
/> />
<!-- 审核页面 -->
<!-- <AudiForm ref="audiFormRef" @success="handleApprove"/> -->
<BasicForm
ref="formRefApproved"
:rules="SparePartsApplyMainRules"
:formAllSchemas="SparePartsApplyMain.allSchemas"
@submitForm="approveSparePartsApplyMain"
:isCol="false"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
ref="importFormRef" ref="importFormRef"
@ -111,7 +122,7 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(SparePartsApplyMain.allSchemas.tableColumns) const tableColumns = ref(SparePartsApplyMain.allSchemas.tableColumns)
const formRefApproved = ref()
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -199,9 +210,8 @@ const buttonBaseClick = (val, item) => {
} }
} }
// const isShowStatusButton = (row, val) => {
const isShowMainButton = (row, val) => { if (val.indexOf(row.status) > -1) {
if (val.indexOf(row.available) > -1) {
return false return false
} else { } else {
return true return true
@ -211,7 +221,34 @@ const isShowMainButton = (row, val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ 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') { if (val == 'edit') {
// //
openForm('update', row) openForm('update', row)
} } else if (val == 'auditing') {
// else if (val == 'mainOrderClo') { //
// // handleSubmitExamine(row.id)
// handleClose(row.id) } else if (val == 'mainTurnDown') {
// } //
else if (val == 'delete') { 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) handleDelete(row.id)
} }
@ -322,6 +369,13 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // 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 { try {
if (formType === 'create') { if (formType === 'create') {
await SparePartsApplyMainApi.createSparePartsApplyMain(data) await SparePartsApplyMainApi.createSparePartsApplyMain(data)
@ -364,6 +418,81 @@ const searchFormClick = (searchData) => {
getList() // 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 () => { onMounted(async () => {
getList() getList()

9
src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts

@ -11,12 +11,19 @@ import { dateFormatter } from '@/utils/formatTime'
export const SparePartsOutLocationMain = useCrudSchemas( export const SparePartsOutLocationMain = useCrudSchemas(
reactive<CrudSchema[]>([ reactive<CrudSchema[]>([
{ {
label: '申请编号', label: '编号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false isForm: false
}, },
{
label: '申请编号',
field: 'applyNumber',
sort: 'custom',
isSearch: true,
isForm: false
},
{ {
label: '描述', label: '描述',
field: 'description', field: 'description',

Loading…
Cancel
Save