diff --git a/src/api/eam/equipmentRepairJobMain/index.ts b/src/api/eam/equipmentRepairJobMain/index.ts index 0d19f793a..ed01ac342 100644 --- a/src/api/eam/equipmentRepairJobMain/index.ts +++ b/src/api/eam/equipmentRepairJobMain/index.ts @@ -104,8 +104,13 @@ export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data }) } -//验证不通过,打回维修工单 +//维修验证不通过,打回维修工单 export const backEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => { return await request.post({ url: `/eam/equipment-repair-job-main/fallback`, data }) } +//报修验证不通过,生成新工单 +export const createEquipmentRepairNewOrder = async (data: EquipmentRepairJobMainVO) => { + return await request.post({ url: `/eam/equipment-repair-job-main/createNew`, data }) +} + diff --git a/src/api/eam/sparePartsInLocationDetail/index.ts b/src/api/eam/sparePartsInLocationDetail/index.ts new file mode 100644 index 000000000..827687a36 --- /dev/null +++ b/src/api/eam/sparePartsInLocationDetail/index.ts @@ -0,0 +1,58 @@ +import request from '@/config/axios' + +export interface SparePartsInLocationDetailVO { + id: number + number: string + masterId: number + sparePartsCode: string + isRadeIn: string + applyQty: number + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询备件入库记录子列表 +export const getSparePartsInLocationDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/spare-parts-in-location-detail/senior', data }) + } else { + return await request.get({ url: `/eam/spare-parts-in-location-detail/page`, params }) + } +} + +// 查询备件入库记录子详情 +export const getSparePartsInLocationDetail = async (id: number) => { + return await request.get({ url: `/eam/spare-parts-in-location-detail/get?id=` + id }) +} + +// 新增备件入库记录子 +export const createSparePartsInLocationDetail = async (data: SparePartsInLocationDetailVO) => { + return await request.post({ url: `/eam/spare-parts-in-location-detail/create`, data }) +} + +// 修改备件入库记录子 +export const updateSparePartsInLocationDetail = async (data: SparePartsInLocationDetailVO) => { + return await request.put({ url: `/eam/spare-parts-in-location-detail/update`, data }) +} + +// 删除备件入库记录子 +export const deleteSparePartsInLocationDetail = async (id: number) => { + return await request.delete({ url: `/eam/spare-parts-in-location-detail/delete?id=` + id }) +} + +// 导出备件入库记录子 Excel +export const exportSparePartsInLocationDetail = async (params) => { + return await request.download({ url: `/eam/spare-parts-in-location-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/spare-parts-in-location-detail/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/eam/sparePartsInLocationMain/index.ts b/src/api/eam/sparePartsInLocationMain/index.ts new file mode 100644 index 000000000..100f8fdb9 --- /dev/null +++ b/src/api/eam/sparePartsInLocationMain/index.ts @@ -0,0 +1,65 @@ +import request from '@/config/axios' + +export interface SparePartsInLocationMainVO { + 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 getSparePartsInLocationMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/spare-parts-in-location-main/senior', data }) + } else { + return await request.get({ url: `/eam/spare-parts-in-location-main/page`, params }) + } +} + +// 查询备件领用出库记录主详情 +export const getSparePartsInLocationMain = async (id: number) => { + return await request.get({ url: `/eam/spare-parts-in-location-main/get?id=` + id }) +} + +// 新增备件领用出库记录主 +export const createSparePartsInLocationMain = async (data: SparePartsInLocationMainVO) => { + return await request.post({ url: `/eam/spare-parts-in-location-main/create`, data }) +} + +// 修改备件领用出库记录主 +export const updateSparePartsInLocationMain = async (data: SparePartsInLocationMainVO) => { + return await request.put({ url: `/eam/spare-parts-in-location-main/update`, data }) +} + +// 删除备件领用出库记录主 +export const deleteSparePartsInLocationMain = async (id: number) => { + return await request.delete({ url: `/eam/spare-parts-in-location-main/delete?id=` + id }) +} + +// 导出备件领用出库记录主 Excel +export const exportSparePartsInLocationMain = async (params) => { + return await request.download({ url: `/eam/spare-parts-in-location-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/spare-parts-in-location-main/get-import-template' }) +} \ No newline at end of file diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 77ba581a2..8b6a0636c 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -359,6 +359,12 @@ const props = defineProps({ type: Boolean, required: false, default: true + }, + // 子列表 哪个状态下展示新增修改隐藏 列表 + detailButtonIsShowAddStatusArray:{ + type: Array, + required: false, + default: () => ['1'] }, // 子列表 编辑 展示与隐藏 ,默认展示 detailButtonIsShowEdit:{ @@ -627,7 +633,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 新增 detailButtonAdd = [ defaultButtons.defaultAddBtn({ - hide: isShowMainButton(row, ['1']) + hide: isShowMainButton(row, props.detailButtonIsShowAddStatusArray) }) ] } @@ -646,7 +652,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 编辑 detailButtonEdit = [ defaultButtons.mainListEditBtn({ - hide: isShowMainButton(row, ['1']) + hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray) }) ] } @@ -654,7 +660,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 删除 detailButtonDelete = [ defaultButtons.mainListDeleteBtn({ - hide: isShowMainButton(row, ['1']) + hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray) }) ] } diff --git a/src/components/DetailTable/src/DetailTable.vue b/src/components/DetailTable/src/DetailTable.vue index b09facbf3..ad5a4a890 100644 --- a/src/components/DetailTable/src/DetailTable.vue +++ b/src/components/DetailTable/src/DetailTable.vue @@ -58,7 +58,7 @@ const countScopeType = ref(props.countScopeType) const allList = ref(props.allList) const forrmatter = (val) => { if(val){ - return countScopeType.value.find((cur) => cur.value == val).label + return countScopeType.value.find((cur) => cur.value == val)?.label || '' }else{ return '' } diff --git a/src/components/TableFormCountPlan/src/TableFormCountPlan.vue b/src/components/TableFormCountPlan/src/TableFormCountPlan.vue index e1138a47f..90867dc79 100644 --- a/src/components/TableFormCountPlan/src/TableFormCountPlan.vue +++ b/src/components/TableFormCountPlan/src/TableFormCountPlan.vue @@ -13,82 +13,86 @@ @click="handleDeleteTable(row, $index)" /> - - -
@@ -127,7 +131,7 @@ const props = defineProps({ countScopeType: { type: Array, required: false, - default: null + default: [] }, }) const tableData = props.tableData @@ -162,6 +166,7 @@ const selectChange = (field, val) => { } const tableFormChange = (field, val, row) => { + pageCount.value = 1 emit('tableFormChange', field, val, row) } // 添加数据 @@ -172,6 +177,38 @@ const handleAddTable = () => { const handleDeleteTable = (row, index) => { emit('handleDeleteTable', row, index) } +const pageCount = ref(1) + +const currentList = (options)=>{ + if(options&&options.length>0){ + return options.slice((pageCount.value-1)*15,pageCount.value*15) + }else{ + return [] + } +} +const nextPage = ()=>{ + pageCount.value++ +} +const prexPage = ()=>{ + pageCount.value-- +} +const initOptions_result = ref([]) +const filterMethod = (query,row)=>{ + console.log('filterMethod') + if (query) { + initOptions_result.value = row.initOptions.filter((item) => { + return item.label.includes(query) + }) + } else { + initOptions_result.value = [...row.initOptions] + } +} +const focusValue = (row)=>{ + console.log('focusValue',row) + if(!row.value){ + initOptions_result.value = [...row.initOptions] + } +} // setup 语法糖 抛出方法 defineExpose({ TableBaseComponents_Ref, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 2b6969a8c..dd9d89dee 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -363,5 +363,7 @@ export enum DICT_TYPE { EAM_MAINTENANCE_URGENCY = 'eam_maintenance_urgency', // 维保紧急程度 EAM_MAINTENANCE_LEVEL = 'eam_maintenance_level', // 维保维修级别 EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态 - OFF_BACK_STATUS = 'off_back_status' + OFF_BACK_STATUS = 'off_back_status', + SPAREPARTS_APPLY_STATUS_ENUM = 'spareparts_apply_status_enum',// 流程状态 + IS_LINE_ITEM = 'is_line_item', // 是否是线边 } diff --git a/src/views/eam/equipmentRepairJobMain/index.vue b/src/views/eam/equipmentRepairJobMain/index.vue index 4360f477d..0fd5b724c 100644 --- a/src/views/eam/equipmentRepairJobMain/index.vue +++ b/src/views/eam/equipmentRepairJobMain/index.vue @@ -88,6 +88,7 @@ import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail. import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue' import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue' import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue' +import {createEquipmentRepairNewOrder} from "@/api/eam/equipmentRepairJobMain"; defineOptions({ name: 'EquipmentRepairJobMain' }) @@ -267,20 +268,26 @@ const finishForm3Ref = ref() const handleValidateReport = async (row) => { await message.delConfirm('是否验证所选中工单?'); message.confirmPassword(t('')).then(async () => { - // 二次确认 - //打开提交表单 - finishForm3Ref.value.open('update', row); + const params = ref({id: '', status:''}) + params.value.id = row.id + params.value.status = '8' + //完结流转 + await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value) + message.success(t('工单已结束')) + // 刷新列表 + await getList() + }).catch (async (action: Action) => { - if(action === 'cancel'){ - const params = ref({id: '', status:''}) - params.value.id = row.id - params.value.status = '5' - //生成新工单 - await EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value) - message.success(t('工单已打回')) - // 刷新列表 - await getList() - } + if(action === 'cancel'){ + const params = ref({id: '', number:''}) + params.value.id = row.id + params.value.number = row.number + //生成新工单 + await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value) + message.success(t('工单已结束')) + // 刷新列表 + await getList() + } }) } diff --git a/src/views/eam/sparePart/sparePart.data.ts b/src/views/eam/sparePart/sparePart.data.ts index bd87fd3bf..86f74f2ab 100644 --- a/src/views/eam/sparePart/sparePart.data.ts +++ b/src/views/eam/sparePart/sparePart.data.ts @@ -25,7 +25,7 @@ export const SparePart = useCrudSchemas(reactive([ isSearch: false, isTable: false, isForm: false, - isDetail:false, + isDetail:false }, { label: '备件编号', @@ -197,7 +197,6 @@ export const SparePart = useCrudSchemas(reactive([ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, - isForm: false, }, { label: '部门id', diff --git a/src/views/eam/sparepartsinlocation/index.vue b/src/views/eam/sparepartsinlocation/index.vue new file mode 100644 index 000000000..6b0d3fc8a --- /dev/null +++ b/src/views/eam/sparepartsinlocation/index.vue @@ -0,0 +1,379 @@ + + + diff --git a/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts b/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts new file mode 100644 index 000000000..9a311ae27 --- /dev/null +++ b/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts @@ -0,0 +1,327 @@ +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' + + +// 表单校验 +export const SparePartsInLocationMainRules = reactive({ + number: [required], + theme: [required], + // status: [required], + // areaCode: [required], + // locationCode: [required], + concurrencyStamp: [required], +}) +// 备件入库主表 +export const SparePartsInLocationMain = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '编号', + field: 'number', + sort: 'custom', + isSearch: false, + isForm: false, + }, + { + label: '入库主题', + field: 'theme', + sort: 'custom', + isSearch: false, + }, + { + label: '流程状态', + field: 'status', + sort: 'custom', + isSearch: false, + isForm:false, + + dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, + dictClass: 'string', + + }, + { + label: '入库申请人', + field: 'applyer', + sort: 'custom', + isSearch: false, + }, + { + label: '审核人', + field: 'approver', + sort: 'custom', + isSearch: false, + }, + { + label: '审核内容', + field: 'approveContent', + sort: 'custom', + isSearch: false, + }, + { + label: '审核时间', + field: 'approveTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + 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')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '入库时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + 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, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '库位编号', + field: 'locationCode', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位编号', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + }, + }, + { + label: '库区编号', + field: 'areaCode', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + } + }, + + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + 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, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + isDetail:false + } +])) +// 备件入库子表 +export const SparePartsInLocationDetailRules = reactive({ + number: [required], + masterId: [required], + sparePartsCode: [required], + applyQty: [required], + concurrencyStamp: [required], +}) + +export const SparePartsInLocationDetail = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + isTableForm:false + }, + { + label: '单号', + field: 'number', + sort: 'custom', + + isSearch: false, + isTable: false, + isForm: false, + isTableForm:false + }, + { + label: '主表ID', + field: 'masterId', + sort: 'custom', + form: { + component: 'InputNumber', + value: 0 + }, + isSearch: false, + isTable: false, + isForm: false, + isTableForm:false + }, + { + label: '备件编号', + field: 'sparePartsCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'itemNumber', // 查询弹窗赋值字段 + searchTitle: '备件信息', // 查询弹窗标题 + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + }, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'itemNumber', // 查询弹窗赋值字段 + searchTitle: '备件信息', // 查询弹窗标题 + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + }, + { + label: '库存数量', + field: 'currentQty', + sort: 'custom', + isSearch: false, + tableForm: { + disabled: true + }, + form:{ + componentProps:{ + disabled: true + } + }, + isDetail:false, + isTable:false + }, + { + label: '申领数量', + field: 'applyQty', + 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: true, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + isTableForm:false + } +])) + diff --git a/src/views/wms/countManage/count/countPlanMain/index.vue b/src/views/wms/countManage/count/countPlanMain/index.vue index 726f91745..75f779e81 100644 --- a/src/views/wms/countManage/count/countPlanMain/index.vue +++ b/src/views/wms/countManage/count/countPlanMain/index.vue @@ -374,27 +374,27 @@ const openForm = async (type: string, row?: number) => { ] // 重置明细数据 formRef.value.open(type, row) - Promise.all([getOwnerAllList(), - getSupplierAllList(), - getCustomerAllList(), - getItembasicAllList(), - getWarehouseAllList(), - getAreaAllList(), - getLocationgroupAllList(), - getLocationAllList()]) + // Promise.all([getOwnerAllList(), + // getSupplierAllList(), + // getCustomerAllList(), + // getItembasicAllList(), + // getWarehouseAllList(), + // getAreaAllList(), + // getLocationgroupAllList(), + // getLocationAllList()]) } /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { - getOwnerAllList() - getSupplierAllList() - getCustomerAllList() - getItembasicAllList() - getWarehouseAllList() - getAreaAllList() - getLocationgroupAllList() - getLocationAllList() + // getOwnerAllList() + // getSupplierAllList() + // getCustomerAllList() + // getItembasicAllList() + // getWarehouseAllList() + // getAreaAllList() + // getLocationgroupAllList() + // getLocationAllList() detailRef.value.openDetail(row, titleName, titleValue) } // 详情打开的编辑的时候设置盘点范围值列表 @@ -417,13 +417,13 @@ const detailOpenForm = (type, row) => { formTypeDetail.value = 'Select' switch (row.type) { case 'OWNER': - countPlanAllList.value = allList.value.ownerAllList + getOwnerAllList(null,true) break case 'SUPPLIER': - countPlanAllList.value = allList.value.supplierAllList + getSupplierAllList(null,true) break case 'CUSTOMER': - countPlanAllList.value = allList.value.customerAllList + getCustomerAllList(null,true) break case 'ABC': countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS) @@ -435,19 +435,19 @@ const detailOpenForm = (type, row) => { countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP) break case 'ITEMS_CODE': - countPlanAllList.value = allList.value.itembasicAllList + getItembasicAllList(null,true) break case 'WAREHOUSE_CODE': - countPlanAllList.value = allList.value.warehouseAllList + getWarehouseAllList(null,true) break case 'AREABASIC_CODE': - countPlanAllList.value = allList.value.areaAllList + getAreaAllList(null,true) break case 'LOCATIONGROUP_CODE': - countPlanAllList.value = allList.value.locationgroupAllList + getLocationgroupAllList(null,true) break case 'LOCATION_CODE': - countPlanAllList.value = allList.value.locationAllList + getLocationAllList(null,true) break } } else if (val == 'PROJECT') { @@ -606,13 +606,13 @@ const selectChangeDetail = (field, val) => { formTypeDetail.value = 'Select' switch (val) { case 'OWNER': - countPlanAllList.value = allList.value.ownerAllList + getOwnerAllList(null,true) break case 'SUPPLIER': - countPlanAllList.value = allList.value.supplierAllList + getSupplierAllList(null,true) break case 'CUSTOMER': - countPlanAllList.value = allList.value.customerAllList + getCustomerAllList(null,true) break case 'ABC': countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS) @@ -624,19 +624,19 @@ const selectChangeDetail = (field, val) => { countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP) break case 'ITEMS_CODE': - countPlanAllList.value = allList.value.itembasicAllList + getItembasicAllList(null,true) break case 'WAREHOUSE_CODE': - countPlanAllList.value = allList.value.warehouseAllList + getWarehouseAllList(null,true) break case 'AREABASIC_CODE': - countPlanAllList.value = allList.value.areaAllList + getAreaAllList(null,true) break case 'LOCATIONGROUP_CODE': - countPlanAllList.value = allList.value.locationgroupAllList + getLocationgroupAllList(null,true) break case 'LOCATION_CODE': - countPlanAllList.value = allList.value.locationAllList + getLocationAllList(null,true) break } } else if (val == 'PROJECT') { @@ -664,13 +664,13 @@ const tableFormChange = async (field, val, row) => { row.formType = 'Select' switch (row.type) { case 'OWNER': - row.initOptions = allList.value.ownerAllList + getOwnerAllList(row) break case 'SUPPLIER': - row.initOptions = allList.value.supplierAllList + getSupplierAllList(row) break case 'CUSTOMER': - row.initOptions = allList.value.customerAllList + getCustomerAllList(row) break case 'ABC': row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS) @@ -682,19 +682,19 @@ const tableFormChange = async (field, val, row) => { row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP) break case 'ITEMS_CODE': - row.initOptions = allList.value.itembasicAllList + getItembasicAllList(row) break case 'WAREHOUSE_CODE': - row.initOptions = allList.value.warehouseAllList + getWarehouseAllList(row) break case 'AREABASIC_CODE': - row.initOptions = allList.value.areaAllList + getAreaAllList(row) break case 'LOCATIONGROUP_CODE': - row.initOptions = allList.value.locationgroupAllList + getLocationgroupAllList(row) break case 'LOCATION_CODE': - row.initOptions = allList.value.locationAllList + getLocationAllList(row) break } } else if (row.type == 'PROJECT') { @@ -717,91 +717,254 @@ const allList = ref({ itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP) }) // 获取货主列表 -const getOwnerAllList = async () => { - OwnerApi.getOwnerList().then((res) => { +const getOwnerAllList = async (row,update_countPlanAllList=false) => { + + let getLoading = null + let res = null + if(!allList.value.ownerAllList||allList.value.ownerAllList.length==0){ + try { + getLoading = ElLoading.service({ + lock: true, + text: 'loading...', + background: 'rgba(0, 0, 0, 0.7)' + }) + res = await OwnerApi.getOwnerList() + } finally { + getLoading?.close() + } + } + + if(res){ allList.value.ownerAllList = res.map((element) => { return { value: element.code, label: element.name } }) - }) + } + if(row){ + row.initOptions = allList.value.ownerAllList + } + if(update_countPlanAllList){ + countPlanAllList.value = allList.value.ownerAllList + } } // 获取供应商列表 -const getSupplierAllList = async () => { - SupplierApi.getSupplierList().then((res) => { +const getSupplierAllList = async (row,update_countPlanAllList=false) => { + let getLoading = null + let res = null + if(!allList.value.supplierAllList||allList.value.supplierAllList.length==0){ + try { + getLoading = ElLoading.service({ + lock: true, + text: 'loading...', + background: 'rgba(0, 0, 0, 0.7)' + }) + res = await SupplierApi.getSupplierList() + } finally { + getLoading?.close() + } + } + if(res){ allList.value.supplierAllList = res.map((element) => { return { value: element.code, label: element.name } }) - }) + } + if(row){ + row.initOptions = allList.value.supplierAllList + } + if(update_countPlanAllList){ + countPlanAllList.value = allList.value.supplierAllList + } } // 获取供应商列表 -const getCustomerAllList = async () => { - CustomerApi.getCustomerList().then((res) => { +const getCustomerAllList = async (row,update_countPlanAllList=false) => { + let getLoading = null + let res = null + if(!allList.value.customerAllList||allList.value.customerAllList.length==0){ + try { + getLoading = ElLoading.service({ + lock: true, + text: 'loading...', + background: 'rgba(0, 0, 0, 0.7)' + }) + res = await CustomerApi.getCustomerList() + } finally { + getLoading?.close() + } + } + if(res){ allList.value.customerAllList = res.map((element) => { return { value: element.code, label: element.name } }) - }) + } + if(row){ + row.initOptions = allList.value.customerAllList + } + if(update_countPlanAllList){ + countPlanAllList.value = allList.value.customerAllList + } } // 获取物料代码列表 -const getItembasicAllList = async () => { - ItembasicApi.getItembasicList().then((res) => { +const getItembasicAllList = async (row,update_countPlanAllList=false) => { + let getLoading = null + let res = null + if(!allList.value.itembasicAllList||allList.value.itembasicAllList.length==0){ + try { + getLoading = ElLoading.service({ + lock: true, + text: 'loading...', + background: 'rgba(0, 0, 0, 0.7)' + }) + res = await ItembasicApi.getItembasicList() + } finally { + getLoading?.close() + } + } + if(res){ allList.value.itembasicAllList = res.map((element) => { return { value: element.code, label: element.name + '-'+ element.code } }) - }) + } + if(row){ + row.initOptions = allList.value.itembasicAllList + } + if(update_countPlanAllList){ + countPlanAllList.value = allList.value.itembasicAllList + } } // 获取仓库列表 -const getWarehouseAllList = async () => { - WarehouseApi.getWarehouseList({ available: 'TRUE' }).then((res) => { +const getWarehouseAllList = async (row,update_countPlanAllList=false) => { + let getLoading = null + let res = null + if(!allList.value.warehouseAllList||allList.value.warehouseAllList.length==0){ + try { + getLoading = ElLoading.service({ + lock: true, + text: 'loading...', + background: 'rgba(0, 0, 0, 0.7)' + }) + res = await WarehouseApi.getWarehouseList({ available: 'TRUE' }) + } finally { + getLoading?.close() + } + } + if(res){ allList.value.warehouseAllList = res.map((element) => { return { value: element.code, label: element.name } }) - }) + } + if(row){ + row.initOptions = allList.value.warehouseAllList + } + if(update_countPlanAllList){ + countPlanAllList.value = allList.value.warehouseAllList + } } // 获取库区列表 -const getAreaAllList = async () => { - AreaApi.getAreaList({ available: 'TRUE' }).then((res) => { +const getAreaAllList = async (row,update_countPlanAllList=false) => { + let getLoading = null + let res = null + if(!allList.value.areaAllList||allList.value.areaAllList.length==0){ + try { + getLoading = ElLoading.service({ + lock: true, + text: 'loading...', + background: 'rgba(0, 0, 0, 0.7)' + }) + res = await AreaApi.getAreaList({ available: 'TRUE' }) + } finally { + getLoading?.close() + } + } + if(res){ allList.value.areaAllList = res.map((element) => { return { value: element.code, label: element.name + '-'+ element.code } }) - }) + } + if(row){ + row.initOptions = allList.value.areaAllList + } + if(update_countPlanAllList){ + countPlanAllList.value = allList.value.areaAllList + } } // 获取库位组列表 -const getLocationgroupAllList = async () => { - LocationgroupApi.getLocationgroupList({ available: 'TRUE' }).then((res) => { +const getLocationgroupAllList = async (row,update_countPlanAllList=false) => { + let getLoading = null + let res = null + if(!allList.value.locationgroupAllList||allList.value.locationgroupAllList.length==0){ + try { + getLoading = ElLoading.service({ + lock: true, + text: 'loading...', + background: 'rgba(0, 0, 0, 0.7)' + }) + res = await LocationgroupApi.getLocationgroupList({ available: 'TRUE' }) + } finally { + getLoading?.close() + } + } + if(res){ allList.value.locationgroupAllList = res.map((element) => { return { value: element.code, label: element.name } }) - }) + } + if(row){ + row.initOptions = allList.value.locationgroupAllList + } + if(update_countPlanAllList){ + countPlanAllList.value = allList.value.locationgroupAllList + } } // 获取库位列表 -const getLocationAllList = async () => { - LocationpApi.getLocationList({ available: 'TRUE' }).then((res) => { +const getLocationAllList = async (row,update_countPlanAllList=false) => { + let getLoading = null + let res = null + if(!allList.value.locationAllList||allList.value.locationAllList.length==0){ + getLoading = ElLoading.service({ + lock: true, + text: 'loading...', + background: 'rgba(0, 0, 0, 0.7)' + }) + res = await LocationpApi.getLocationList({ available: 'TRUE' }) + console.log('res',res) + + } + if(res){ allList.value.locationAllList = res.map((element) => { return { value: element.code, label: element.name + '-'+ element.code } }) + } + if(row){ + row.initOptions = allList.value.locationAllList + } + if(update_countPlanAllList){ + countPlanAllList.value = allList.value.locationAllList + } + nextTick(()=>{ + getLoading?.close() }) } /** 初始化 **/ diff --git a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue index b3f3f93b1..e00ac3d7d 100644 --- a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue +++ b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue @@ -222,7 +222,7 @@ const handleSelectionPoint = async ()=>{ window.open(src.value+'&asn_number='+res.cgLabel) } if(!res.cgLabel&&!res.zzLabel){ - message.error('包装不存在,无法打印') + message.warning('包装不存在,无法打印或者是线边物料数据不生成包装!') } }).catch(err => { console.log(err) diff --git a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue index 3d4e61e40..ec7d59008 100644 --- a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue @@ -77,6 +77,9 @@ + +