diff --git a/src/api/eam/equipmentMaintenanceMain/index.ts b/src/api/eam/equipmentMaintenanceMain/index.ts index 1a0396846..e257dd16a 100644 --- a/src/api/eam/equipmentMaintenanceMain/index.ts +++ b/src/api/eam/equipmentMaintenanceMain/index.ts @@ -70,6 +70,11 @@ export const updateEquipmentMaintenanceMain = async (data: EquipmentMaintenanceM return await request.put({ url: `/eam/equipment-maintenance-main/update`, data }) } +// 修改设备保养工单主 +export const updateEquipmentMaintenance = async (data: EquipmentMaintenanceMainVO) => { + return await request.post({ url: `/eam/equipment-maintenance-main/updateOrders`, data }) +} + // 删除设备保养工单主 export const deleteEquipmentMaintenanceMain = async (id: number) => { return await request.delete({ url: `/eam/equipment-maintenance-main/delete?id=` + id }) diff --git a/src/api/eam/equipmentRepairJobMain/index.ts b/src/api/eam/equipmentRepairJobMain/index.ts index 471f98905..0d83bcb3e 100644 --- a/src/api/eam/equipmentRepairJobMain/index.ts +++ b/src/api/eam/equipmentRepairJobMain/index.ts @@ -1,5 +1,4 @@ import request from '@/config/axios' -import {EquipmentReportRepairRequestVO} from "@/api/eam/equipmentReportRepairRequest"; export interface EquipmentRepairJobMainVO { id: number @@ -72,6 +71,16 @@ export const updateEquipmentRepairJobMain = async (data: EquipmentRepairJobMainV return await request.put({ url: `/eam/equipment-repair-job-main/update`, data }) } +// 修改维修工单主 +export const updateEquipmentRepairMain = async (data: EquipmentRepairJobMainVO) => { + return await request.post({ url: `/eam/equipment-repair-job-main/updateRepair`, data }) +} + +// 完成维修工单主 +export const executeEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => { + return await request.post({ url: `/eam/equipment-repair-job-main/execute`, data }) +} + // 删除维修工单主 export const deleteEquipmentRepairJobMain = async (id: number) => { return await request.delete({ url: `/eam/equipment-repair-job-main/delete?id=` + id }) diff --git a/src/views/eam/equipmentMaintenanceMain/finishForm2.vue b/src/views/eam/equipmentMaintenanceMain/finishForm2.vue index 60b73fe59..946493a41 100644 --- a/src/views/eam/equipmentMaintenanceMain/finishForm2.vue +++ b/src/views/eam/equipmentMaintenanceMain/finishForm2.vue @@ -50,6 +50,7 @@ import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain' import { SearchTable } from '@/components/SearchTable' import {ElInput} from "element-plus"; +import {updateEquipmentMaintenance} from "@/api/eam/equipmentMaintenanceMain"; defineOptions({ name: 'TeamForm' }) @@ -168,15 +169,17 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const submitForm = async (val) => { - //把success函数传递到父页面 - emit('success',formData.value.id) + // 校验表单 if (!basicFormRef) return const valid = await basicFormRef.value.validate() if (!valid) return //发送数据 - await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value) + await EquipmentMaintenanceMainApi.updateEquipmentMaintenance(formData.value); + + //把success函数传递到父页面 + emit('success',formData.value.id) dialogVisible.value = false } diff --git a/src/views/eam/equipmentMaintenanceMain/index.vue b/src/views/eam/equipmentMaintenanceMain/index.vue index e4219bc6d..d9f106904 100644 --- a/src/views/eam/equipmentMaintenanceMain/index.vue +++ b/src/views/eam/equipmentMaintenanceMain/index.vue @@ -547,7 +547,7 @@ const getData2=(val)=> { params.value.status = '5' // 发起 await EquipmentMaintenanceMainApi.executeMaintenanceOrder(params.value) - message.success(t('工单已完成')) + //message.success(t('工单已完成')) // 刷新列表 await getList() }) diff --git a/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts b/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts index 4be0eadb5..f516ddd2a 100644 --- a/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts +++ b/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts @@ -245,6 +245,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isTable: false, + isForm: false, + isDetail:false, search: { component: 'DatePicker', componentProps: { @@ -481,7 +484,10 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive([ export const EquipmentRepairJobDetailRules = reactive({ number: [required], masterId: [required], - concurrencyStamp: [required], + describing:[required], + faultCause:[required], + workOut:[required], + maintenances:[required], }) export const EquipmentRepairJobDetail = useCrudSchemas(reactive([ @@ -552,7 +558,7 @@ export const EquipmentRepairJobDetail = useCrudSchemas(reactive([ isSearch: true, }, { - label: '维修人员字符串多个', + label: '维修人员', field: 'maintenances', sort: 'custom', isSearch: true, @@ -589,7 +595,10 @@ export const EquipmentRepairJobDetail = useCrudSchemas(reactive([ label: '备注', field: 'remark', sort: 'custom', - isSearch: true, + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, }, { label: '地点ID', diff --git a/src/views/eam/equipmentRepairJobMain/finishForm2.vue b/src/views/eam/equipmentRepairJobMain/finishForm2.vue new file mode 100644 index 000000000..9228d1980 --- /dev/null +++ b/src/views/eam/equipmentRepairJobMain/finishForm2.vue @@ -0,0 +1,262 @@ + + + + diff --git a/src/views/eam/equipmentRepairJobMain/index.vue b/src/views/eam/equipmentRepairJobMain/index.vue index 2d5d60699..d341b418a 100644 --- a/src/views/eam/equipmentRepairJobMain/index.vue +++ b/src/views/eam/equipmentRepairJobMain/index.vue @@ -50,6 +50,8 @@ :isBusiness="false" /> + + @@ -78,6 +83,7 @@ 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 '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.vue' +import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue' defineOptions({ name: 'EquipmentRepairJobMain' }) @@ -174,6 +180,8 @@ const buttonTableClick = async (val, row) => { handleReceive(row.id) } else if (val == 'execute') { // 执行 handleExecute(row.id) + } else if (val == 'finish') { // 完成 + handleFinish(row) } @@ -220,6 +228,39 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentRepairJobMain') } +/** 页面操作 */ +let count = ref(0) +const handleMainFefresh = async()=>{ + count.value++ + getList() +} + +// 子页面查询字典页面返回 +const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { + nextTick(() => { + const setV = {} + let result = ''; + for (var i = 0; i < val.length; i++) { + result += val[i].code + ','; + } + if(result.endsWith(',')){ + result = result.substring(0,result.length -1) + } + setV[formField] = result; + formRef.setValues(setV) + }) +} + +/** 完成按钮操作 */ +const finishForm2Ref = ref() +const handleFinish = async (row) => { + // 二次确认 + await message.delConfirm('是否完成所选中工单?'); + + //打开提交表单 + finishForm2Ref.value.open('update', row); +} + /** 接单按钮操作 */ const handleReceive = async (id: number) => { try { @@ -271,6 +312,32 @@ const handleDelete = async (id: number) => { } catch {} } + + +//finishForm2 关闭按钮回传 +const getClosed2=(val)=> { + nextTick?.(() => { + getList() + }) +} + +//finishForm2 提交按钮回传 +const getData2=(val)=> { + nextTick?.(async () => { + const params = ref({ + id: '', + status: '', + }) + params.value.id = val + params.value.status = '5' + // 发起 + await EquipmentRepairJobMainApi.executeEquipmentRepairJobMain(params.value) + message.success(t('工单已完成')) + // 刷新列表 + await getList() + }) +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue index ec46cb9df..410cf97f0 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue @@ -89,7 +89,7 @@ @searchTableSuccess="searchTableSuccess" @submitForm="submitFormLabel" /> - + @@ -123,7 +123,7 @@ const tableColumns = ref([...ProductionreturnRequestMain.allSchemas.tableColumns const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas const isCreateLabel = ref(false) const formLabelRef = ref() -const labelType = ref('') // 标签类别 采购还是制造等 +const labelType = ref('') // 标签类别 采购还是制造等 const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage }) @@ -199,7 +199,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } else { row['batch'] = '000000' } - // 修改 tableform 属性 数量最大值设置为库存余额中数量 + // 修改 tableform 属性 数量最大值设置为库存余额中数量 // TODO: tableFormColumns 修改属性目前只限于整个列 并不满足行要求 例如: 第一条数据最大10 第二条数据最大20 那么第一条数据会变成最大20限制 ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => { if(item.field == 'qty' && val[0]['qty'] > 0) { @@ -278,7 +278,7 @@ const HeadButttondata = [ defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 - + ] // 头部按钮事件 @@ -492,7 +492,7 @@ const buttonTableClick = async (val, row) => { tableObject.loading = false console.log(err) }) - } else if (val == 'edit') { // 编辑 + } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.masterId) @@ -750,10 +750,19 @@ const labelPrint = async (row) => { // 筛选提交 const searchFormClick = (searchData) => { - tableObject.params = { - isSearch: true, - filters: searchData.filters + tableObject.params.isSearch = true + if(!searchData.filters){//重置的时候应用 + searchData.filters = [] + } + let filters = [...searchData.filters] + if(!filters.find(item=>item.column=='business_type')) { + filters = [...filters,{ + action:'==', + column:'business_type', + value:'ReturnToStore', + }] } + tableObject.params.filters = filters getList() // 刷新当前列表 } diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue b/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue index 94db7444d..6d581ac4a 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue @@ -120,7 +120,7 @@ const tableColumns = ref([...ProductionreturnRequestMain.allSchemas.tableColumns const detailListTableColumns = ProductionreturnRequestDetailNoLabel.allSchemas const isCreateLabel = ref(false) const formLabelRef = ref() -const labelType = ref('') // 标签类别 采购还是制造等 +const labelType = ref('') // 标签类别 采购还是制造等 const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ getListApi: ProductionreturnRequestDetailNoApi.getProductionreturnRequestDetailPage }) @@ -254,7 +254,7 @@ const HeadButttondata = [ defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 - + ] // 头部按钮事件 @@ -468,7 +468,7 @@ const buttonTableClick = async (val, row) => { tableObject.loading = false console.log(err) }) - } else if (val == 'edit') { // 编辑 + } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.masterId) @@ -659,13 +659,23 @@ const importFormRef = ref() // 筛选提交 const searchFormClick = (searchData) => { - tableObject.params = { - isSearch: true, - filters: searchData.filters + tableObject.params.isSearch = true + if(!searchData.filters){//重置的时候应用 + searchData.filters = [] + } + let filters = [...searchData.filters] + if(!filters.find(item=>item.column=='business_type')) { + filters = [...filters,{ + action:'==', + column:'business_type', + value:'ReturnToHold', + }] } + tableObject.params.filters = filters getList() // 刷新当前列表 } + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/inventorychangeRequestMain.data.ts b/src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/inventorychangeRequestMain.data.ts index b29734a9b..b105b47c0 100644 --- a/src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/inventorychangeRequestMain.data.ts +++ b/src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/inventorychangeRequestMain.data.ts @@ -19,15 +19,19 @@ const queryParams = { const businessTypeQueryParams = { pageSize:10, pageNo:1, - code:'Change' + code:'Change', + name:'库存修改' } const data = await getRequestsettingApi.getRequestsettingPage(queryParams) const requestsettingData =data?.list[0]||{} const businessTypeValue = await getBusinessTypeApi.getBusinesstypePage(businessTypeQueryParams) const businessTypeData =businessTypeValue?.list[0]||{} + console.log(businessTypeData.code); + // 获取当前操作人的部门 import { useUserStore } from '@/store/modules/user' import { TableColumn } from '@/types/table' +import { log } from 'console' const userStore = useUserStore() const userDept = userStore.userSelfInfo.dept // id 转str 否则form回显匹配不到