From b21b5b4e06476f4132950b8a02ff184e1a8d33dc Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 14 Jun 2024 14:26:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=8C=EF=BC=8C=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/itemAccounts/index.ts | 1 + src/api/eam/sparePartsInLocationMain/index.ts | 4 + .../index.ts | 72 ++++++ src/locales/en-US.ts | 6 +- src/locales/zh-CN.ts | 6 +- .../SparePartsOutLocationRecord.data.ts | 223 +++++++----------- .../eam/SparePartsOutLocationRecord/index.vue | 6 +- src/views/eam/sparepartsinlocation/index.vue | 142 ++++++----- .../sparePartsInLocationMain.data.ts | 45 ++-- 9 files changed, 287 insertions(+), 218 deletions(-) create mode 100644 src/api/eam/sparePartsOutLocationRecordDetail/index.ts diff --git a/src/api/eam/itemAccounts/index.ts b/src/api/eam/itemAccounts/index.ts index 88fb3d16f..0ddd0da42 100644 --- a/src/api/eam/itemAccounts/index.ts +++ b/src/api/eam/itemAccounts/index.ts @@ -61,3 +61,4 @@ export const replaceLocation = async (data: Array) => { export const getItemAccountsNoPage = async (params) => { return await request.get({ url: `/eam/item-accounts/noPage`, params }) } + diff --git a/src/api/eam/sparePartsInLocationMain/index.ts b/src/api/eam/sparePartsInLocationMain/index.ts index 2365b84e3..687d99a67 100644 --- a/src/api/eam/sparePartsInLocationMain/index.ts +++ b/src/api/eam/sparePartsInLocationMain/index.ts @@ -85,3 +85,7 @@ export const rejectSparePartsInLocation = async (id) => { export const approveSparePartsInLocation = async (data) => { return await request.post({ url: `/eam/spare-parts-in-location-main/approve`,data }) } +// 完成 +export const finishSparePartsInLocation = async (id) => { + return await request.post({ url: `/eam/spare-parts-in-location-main/finish?id=` + id }) +} \ No newline at end of file diff --git a/src/api/eam/sparePartsOutLocationRecordDetail/index.ts b/src/api/eam/sparePartsOutLocationRecordDetail/index.ts new file mode 100644 index 000000000..c4ea46811 --- /dev/null +++ b/src/api/eam/sparePartsOutLocationRecordDetail/index.ts @@ -0,0 +1,72 @@ +import request from '@/config/axios' + +export interface SparePartsOutLocationRecordDetailVO { + id: number + number: string + theme: string + status: string + applyer: string + approver: number + approveContent: string + approveTime: Date + autoExamine: string + autoAgree: string + directCreateRecord: string + areaCode: string + locationCode: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询备件入库记录主列表 +export const getSparePartsOutLocationDetailRecordPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = { ...params } + return await request.post({ url: '/eam/spare-parts-in-location-main-record/senior', data }) + } else { + return await request.get({ url: `/eam/spare-parts-in-location-main-record/page`, params }) + } +} + +// 查询备件入库记录主详情 +export const getSparePartsOutLocationDetailRecord = async (id: number) => { + return await request.get({ url: `/eam/spare-parts-in-location-main-record/get?id=` + id }) +} + +// 新增备件入库记录主 +export const createSparePartsOutLocationDetailRecord = async ( + data: SparePartsInLocationMainRecordVO +) => { + return await request.post({ url: `/eam/spare-parts-in-location-main-record/create`, data }) +} + +// 修改备件入库记录主 +export const updateSparePartsOutLocationDetailRecord = async ( + data: SparePartsInLocationMainRecordVO +) => { + return await request.put({ url: `/eam/spare-parts-in-location-main-record/update`, data }) +} + +// 删除备件入库记录主 +export const deleteSparePartsOutLocationDetailRecord = async (id: number) => { + return await request.delete({ url: `/eam/spare-parts-in-location-main-record/delete?id=` + id }) +} + +// 导出备件入库记录主 Excel +export const exportSparePartsOutLocationDetailRecord = async (params) => { + return await request.download({ + url: `/eam/spare-parts-in-location-main-record/export-excel`, + params + }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/spare-parts-in-location-main-record/get-import-template' }) +} diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 04a464311..108e09df2 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -946,6 +946,7 @@ export default { '是否发布所选中数据?':'Do you publish the selected data?', '是否关闭所选中数据?':'Do you want to close the selected data?', '是否作废所选中数据?':'Do you want to void the selected data?', + '是否完成所选中数据?':'Do you want to finish the selected data?', '发布成功!':'Release Successfully!', '是否下架所选中数据?':'Do you want to remove selected data?', '下架成功!':'Removed Successfully!', @@ -955,6 +956,7 @@ export default { '打开成功!':'Open Successfully!', '关闭成功!':'Closed Successfully', '作废成功!':'Invalid successfully', + '完成成功!':'Finish successfully', '失效时间要大于生效时间':'The expiration time must be longer than the effective time', '供应商导入模版':'Supplier import template', '供应商物料':'Supplier Material', @@ -1055,8 +1057,8 @@ export default { 供应商发货申请主导入模版:'Supplier delivery request is led into the template', 供应商发票申请明细:'Supplier invoice request details', 供应商发票记录主:'Supplier invoice record master data', - 审核通过:'Pass the audit', - 撤回成功:'Recall successful', + '审核通过!':'Pass the audit', + '撤回成功!':'Recall successful', 作废:'Cancellation', '是否审批拒绝所选中数据?':'Do you want to approve and reject selected data?', '审批成功!':'Approval is successful!', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 24c79366e..65556113f 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -946,6 +946,7 @@ export default { '是否发布所选中数据?':'是否发布所选中数据?', '是否关闭所选中数据?':'是否关闭所选中数据?', '是否作废所选中数据?':'是否作废所选中数据?', + '是否完成所选中数据?':'是否完成所选中数据?', '发布成功!':'发布成功!', '是否下架所选中数据?':'是否下架所选中数据?', '下架成功!':'下架成功!', @@ -955,6 +956,7 @@ export default { '打开成功!':'打开成功!', '关闭成功!':'关闭成功!', '作废成功!':'作废成功!', + '完成成功!':'完成成功!', '失效时间要大于生效时间':'失效时间要大于生效时间', '供应商导入模版':'供应商导入模版', '供应商物料':'供应商物料', @@ -1055,8 +1057,8 @@ export default { 供应商发货申请主导入模版:'供应商发货申请主导入模版', 供应商发票申请明细:'供应商发票申请明细', 供应商发票记录主:'供应商发票记录主', - 审核通过:'审核通过', - 撤回成功:'撤回成功', + '审核通过!':'审核通过!', + '撤回成功!':'撤回成功!', 作废:'作废', '是否审批拒绝所选中数据?':'是否审批拒绝所选中数据?', '审批成功!':'审批成功!', diff --git a/src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts b/src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts index cc5804fdd..c8c2cd386 100644 --- a/src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts +++ b/src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts @@ -11,64 +11,55 @@ import { dateFormatter } from '@/utils/formatTime' export const SparePartsOutLocationRecordMain = useCrudSchemas( reactive([ { - label: '申请编号', + label: '编号', field: 'number', sort: 'custom', isSearch: true, - isForm: false + isForm: false, }, { - label: '描述', - field: 'description', + label: '入库主题', + field: 'theme', sort: 'custom', - isSearch: true - }, - { - label: '申领备件总价', - field: 'sumVal', + isSearch: true, + },{ + label: '入库类型', + field: 'type', sort: 'custom', - isSearch: false, - isTable: false, - isForm: false + dictType: DICT_TYPE.PUT_IN_TYPE, + dictClass: 'string', + }, { label: '流程状态', field: 'status', sort: 'custom', + isSearch: false, + isForm:false, + dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - isSearch: true, - form: { - component: 'Select' - } + dictClass: 'string', + }, { - label: '申请人', + label: '入库申请人', field: 'applyer', sort: 'custom', isSearch: false, - isTable: false, - isForm: false }, { label: '审核人', field: 'approver', sort: 'custom', isSearch: false, - isTable: false, - isForm: false, - form: { - component: 'InputNumber', - value: 0 - } + isForm:false }, { label: '审核内容', field: 'approveContent', sort: 'custom', - isSearch: true, - isTable: false, - isForm: false + isSearch: false, + isForm:false }, { label: '审核时间', @@ -76,8 +67,7 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas( sort: 'custom', formatter: dateFormatter, isSearch: false, - isTable: false, - isForm: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -92,39 +82,17 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas( type: 'datetime', valueFormat: 'x' } - } - }, - { - label: '自动审核', - field: 'autoExamine', - sort: 'custom', - isSearch: false, - isTable: false, - isForm: false - }, - { - label: '自动通过', - field: 'autoAgree', - sort: 'custom', - isSearch: false, - isTable: false, - isForm: false - }, - { - label: '直接生成记录', - field: 'directCreateRecord', - sort: 'custom', - isSearch: false, - isTable: false, - isForm: false + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, }, { - label: '创建时间', + label: '入库时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, isSearch: false, - isTable: false, search: { component: 'DatePicker', componentProps: { @@ -133,17 +101,20 @@ export const SparePartsOutLocationRecordMain = useCrudSchemas( defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, - isForm: false + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, }, + + { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' - } - } + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + ]) ) @@ -157,21 +128,19 @@ export const SparePartsOutLocationRecordMainRules = reactive({ export const SparePartsOutLocationRecordDetail = useCrudSchemas( reactive([ { - label: '备件编号', - field: 'sparePartsCode', + label: '库位编号', + field: 'locationCode', sort: 'custom', - table: { - width: 150 - }, + isSearch: false, form: { - // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择备件编号', // 输入框占位文本 - searchField: 'itemNumber', // 查询弹窗赋值字段 - searchTitle: '备件信息', // 查询弹窗标题 - searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 - searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 + searchListPlaceholder: '请选择库位编号', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchCondition: [ { key: 'available', @@ -186,6 +155,7 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( searchListPlaceholder: '请选择备件编号', // 输入框占位文本 searchField: 'itemNumber', // 查询弹窗赋值字段 searchTitle: '备件信息', // 查询弹窗标题 + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchCondition: [ @@ -198,67 +168,35 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( } }, { - label: '设备类别', - field: 'type', - dictType: DICT_TYPE.DEVICE_TYPE, - dictClass: 'string', - isTable: true, + label: '库区编号', + field: 'areaCode', sort: 'custom', isSearch: false, - table: { - width: 150 + form: { + componentProps: { + disabled: true + } }, - tableForm: { - type: 'Select' + tableForm:{ + disabled: true } }, { - label: '设备工装编号', - field: 'equipmentCode', + label: '备件编号', + field: 'sparePartsCode', 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 - } - ] + disabled: true } }, - tableForm: { - isInpuFocusShow: true, - searchListPlaceholder: '请选择备件编号', // 输入框占位文本 - searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '备件信息', // 查询弹窗标题 - searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类 - searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法 - searchCondition: [ - { - key: 'status', - value: 'NORMAL', - action: '==', - isSearch: true, - isMainValue: false - } - ] + tableForm:{ + disabled: true } }, - { label: '库存数量', field: 'currentQty', @@ -266,7 +204,14 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( isSearch: false, tableForm: { disabled: true - } + }, + form:{ + componentProps:{ + disabled: true + } + }, + isDetail:false, + isTable:false }, { label: '申领数量', @@ -274,23 +219,29 @@ export const SparePartsOutLocationRecordDetail = useCrudSchemas( sort: 'custom', isSearch: false }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + isTableForm:false + }, { label: '备注', field: 'remark', sort: 'custom', - isSearch: false + isSearch: true, }, - { - label: '操作', - field: 'action', - isDetail: false, - isForm: false, - table: { - width: 150, - fixed: 'right' - }, - isTableForm: false - } ]) ) diff --git a/src/views/eam/SparePartsOutLocationRecord/index.vue b/src/views/eam/SparePartsOutLocationRecord/index.vue index 72ea2dd4f..35ed57fbc 100644 --- a/src/views/eam/SparePartsOutLocationRecord/index.vue +++ b/src/views/eam/SparePartsOutLocationRecord/index.vue @@ -95,9 +95,9 @@ import { SparePartsOutLocationRecordMainRules, SparePartsOutLocationRecordDetail, SparePartsOutLocationRecordDetailRules -} from './SparePartsOutLocationRecord.data' +} from './sparePartsOutLocationRecord.data' import * as SparePartsOutLocationRecordMainApi from '@/api/eam/sparePartsOutLocationRecordMain/index' -import * as SparePartsOutLocationRecordDetailApi from '@/api/eam/sparePartsOutLocationRecordDetail/sparePartsOutLocationDetailRecord.js' +import * as SparePartsOutLocationRecordDetailApi from '@/api/eam/sparePartsOutLocationRecordDetail/index' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' @@ -161,7 +161,7 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn(null), // 新增 + // defaultButtons.defaultAddBtn(null), // 新增 // defaultButtons.defaultImportBtn(null), // 导入 // defaultButtons.defaultExportBtn(null), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 diff --git a/src/views/eam/sparepartsinlocation/index.vue b/src/views/eam/sparepartsinlocation/index.vue index f7fdcfb65..72589ea1b 100644 --- a/src/views/eam/sparepartsinlocation/index.vue +++ b/src/views/eam/sparepartsinlocation/index.vue @@ -76,7 +76,8 @@ :apiDelete="SparePartsInLocationDetailApi.deleteSparePartsInLocationDetail" @searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="true" - :detailButtonIsShowAdd="false" + :detailButtonIsShowAdd="true" + :detailButtonIsShowAddStatusArray="['0']" /> @@ -85,6 +86,7 @@ :rules="SparePartsInLocationMainRules" :formAllSchemas="SparePartsInLocationExamine.allSchemas" @submitForm="approveSparePartsInLocation" + :isCol="false" /> nextTick(() => { const setV = {} setV[formField] = val[0][searchField] + console.log(11, val[0]) if (type == 'tableForm') { if (formField == 'locationCode') { - // row['sparePartsCode'] = val[0].itemNumber - row['locationCode'] = val[0].code - row['areaCode'] = val[0].areaCode - row['sparePartsCode'] = val[0].sparePartsCode + row['locationCode'] = val[0].locationNumber + row['areaCode'] = val[0].areaNumber + row['sparePartsCode'] = val[0].itemNumber row['currentQty'] = val[0].qty row['isRadeIn'] = val[0].isRadeIn } } else { if (formField == 'locationCode') { - setV['locationCode'] = val[0].code - setV['areaCode'] = val[0].areaCode - setV['sparePartsCode'] = val[0].sparePartsCode + setV['locationCode'] = val[0].locationNumber + setV['areaCode'] = val[0].areaNumber + setV['sparePartsCode'] = val[0].itemNumber setV['currentQty'] = val[0].qty setV['isRadeIn'] = val[0].isRadeIn - } } formRef.setValues(setV) @@ -162,11 +163,11 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { nextTick(async () => { const setV = {} if (formField == 'locationCode') { - setV['locationCode'] = val[0].code - setV['areaCode'] = val[0].areaCode - setV['sparePartsCode'] = val[0].sparePartsCode - setV['currentQty'] = val[0].qty - setV['isRadeIn'] = val[0].isRadeIn + setV['locationCode'] = val[0].locationNumber + setV['areaCode'] = val[0].areaNumber + setV['sparePartsCode'] = val[0].itemNumber + setV['currentQty'] = val[0].qty + setV['isRadeIn'] = val[0].isRadeIn } formRef.setValues(setV) }) @@ -183,9 +184,9 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn({hasPermi:'eam:spare-parts-in-location-main:create'}), // 新增 - defaultButtons.defaultImportBtn({hasPermi:'eam:spare-parts-in-location-main:import'}), // 导入 - defaultButtons.defaultExportBtn({hasPermi:'eam:spare-parts-in-location-main:export'}), // 导出 + defaultButtons.defaultAddBtn({ hasPermi: 'eam:spare-parts-in-location-main:create' }), // 新增 + defaultButtons.defaultImportBtn({ hasPermi: 'eam:spare-parts-in-location-main:import' }), // 导入 + defaultButtons.defaultExportBtn({ hasPermi: 'eam:spare-parts-in-location-main:export' }), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null) // 设置 @@ -233,12 +234,34 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - 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.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' + }) //完成 ] } @@ -247,29 +270,28 @@ const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - } - else if (val == 'auditing') { + } else if (val == 'auditing') { //审核 handleSubmitExamine(row.id) - } - else if (val == 'mainTurnDown') { + } else if (val == 'mainTurnDown') { //驳回 handleRejecte(row.id) - } - else if (val == 'mainApprove') { + } else if (val == 'mainApprove') { //审核通过 - formRefApproved.value.open('update',row,{masterId:row.id},'auditing') - } - else if (val == 'revoke') { // 撤回 + formRefApproved.value.open('update', row, { masterId: row.id }, 'auditing') + } else if (val == 'revoke') { + // 撤回 handleCancel(row.id) - } - else if (val == 'delete') { + } else if (val == 'finish') { + // 完成 + handleFinish(row.id) + } else if (val == 'delete') { // 删除 handleDelete(row.id) } } -const isShowStatusButton = (row,val) => { +const isShowStatusButton = (row, val) => { if (val.indexOf(row.status) > -1) { return false } else { @@ -343,6 +365,11 @@ 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 SparePartsInLocationMainApi.createSparePartsInLocationMain(data) @@ -386,7 +413,7 @@ const searchFormClick = (searchData) => { } // 审核 const handleSubmitExamine = async (id: number) => { - await message.delConfirm(t('ts.是否提交审核?')); + await message.delConfirm(t('ts.是否提交审核?')) try { await SparePartsInLocationMainApi.submitExamineSparePartsInLocation(id) message.success(t('ts.提交审批成功!')) @@ -396,40 +423,49 @@ const handleSubmitExamine = async (id: number) => { } /** 撤回按钮操作 */ const handleCancel = async (id: number) => { - await message.delConfirm(t('ts.是否撤回所选中数据?')); + await message.delConfirm(t('ts.是否撤回所选中数据?')) try { await SparePartsInLocationMainApi.cancelSparePartsInLocation(id) - message.success(t('ts.撤回成功')) + message.success(t('ts.撤回成功!')) // 刷新列表 await getList() } catch {} } //审核驳回按钮 -const handleRejecte=async(id: number)=> { - await message.delConfirm(t('ts.是否驳回所选中数据?')); +const handleRejecte = async (id: number) => { + await message.delConfirm(t('ts.是否驳回所选中数据?')) try { await SparePartsInLocationMainApi.rejectSparePartsInLocation(id) - message.success(t('ts.驳回成功!')) - // 刷新列表 - await getList() + message.success(t('ts.驳回成功!')) + // 刷新列表 + await getList() } catch {} } // 审核通过 -const approveSparePartsInLocation =async(formType,data)=> { - console.log(data) +const approveSparePartsInLocation = async (formType, data) => { try { - // const params = { - // id: - // } await SparePartsInLocationMainApi.approveSparePartsInLocation(data) - message.success(t('ts.审核通过!')) - // 刷新列表 - await getList() + 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 SparePartsInLocationMainApi.finishSparePartsInLocation(id) + message.success(t('ts.完成成功!')) + // 刷新列表 + await getList() } catch {} - - } + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts b/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts index c9cd5edb4..eef186df0 100644 --- a/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts +++ b/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts @@ -1,7 +1,5 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import * as LocationApi from '@/api/wms/location' -import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' import * as ItemAccountsApi from '@/api/eam/itemAccounts' import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data' @@ -161,8 +159,9 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( searchListPlaceholder: '请选择库位编号', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库位信息', // 查询弹窗标题 - searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 - searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 + + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchCondition: [ { key: 'available', @@ -173,19 +172,20 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( } }, tableForm: { - // isInpuFocusShow: true, - // searchListPlaceholder: '请选择备件编号', // 输入框占位文本 - // searchField: 'itemNumber', // 查询弹窗赋值字段 - // searchTitle: '备件信息', // 查询弹窗标题 - // searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 - // searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 - // searchCondition: [ - // { - // key: 'available', - // value: 'TRUE', - // isMainValue: false - // } - // ] + isInpuFocusShow: true, + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'itemNumber', // 查询弹窗赋值字段 + searchTitle: '备件信息', // 查询弹窗标题 + + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] } }, { @@ -199,7 +199,7 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( } }, tableForm:{ - // disabled: true + disabled: true } }, { @@ -215,7 +215,7 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( } }, tableForm:{ - // disabled: true + disabled: true } }, { @@ -272,7 +272,7 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( fixed: 'right' }, isTableForm:false, - isTable:false + } ])) export const SparePartsInLocationExamineRules = reactive({ @@ -288,8 +288,9 @@ export const SparePartsInLocationExamine = useCrudSchemas(reactive sort: 'custom', isSearch: false, form:{ - componentProps:{ - + component: 'Input', + componentProps: { + type: 'textarea' } } },