From ab6036b3c7d3558e09c72cfc4b87c450ab093062 Mon Sep 17 00:00:00 2001 From: TengXF <302828528@qq.com> Date: Tue, 4 Jun 2024 19:40:43 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=A4=9A=E4=BD=99=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customersettleRequestMain.data.ts | 5 +++- .../saleShipmentMain.data.ts | 5 +++- .../stockupMainRequest.data.ts | 24 ++++++++++++++----- .../processproductionRequestMain.data.ts | 7 +++--- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/views/wms/deliversettlementManage/customersettle/customersettleRequestMain/customersettleRequestMain.data.ts b/src/views/wms/deliversettlementManage/customersettle/customersettleRequestMain/customersettleRequestMain.data.ts index ef3a18a36..e5344f0b5 100644 --- a/src/views/wms/deliversettlementManage/customersettle/customersettleRequestMain/customersettleRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customersettle/customersettleRequestMain/customersettleRequestMain.data.ts @@ -421,6 +421,8 @@ export const CustomersettleRequestDetail = useCrudSchemas(reactive label: '单据号', field: 'number', sort: 'custom', + isTable: false, + isForm: false, table: { width: 180, fixed: 'left' @@ -717,6 +719,7 @@ export const CustomersettleRequestDetail = useCrudSchemas(reactive field: 'action', isDetail: false, isForm: false , + isTable: false, table: { width: 150, fixed: 'right' @@ -745,4 +748,4 @@ export const CustomersettleRequestDetailRules = reactive({ itemCode: [ { required: true, message: '请选择物料代码', trigger: 'change' } ], -}) \ No newline at end of file +}) diff --git a/src/views/wms/deliversettlementManage/saleShipmentMainRequest/saleShipmentMain.data.ts b/src/views/wms/deliversettlementManage/saleShipmentMainRequest/saleShipmentMain.data.ts index 757c0e434..0655ce008 100644 --- a/src/views/wms/deliversettlementManage/saleShipmentMainRequest/saleShipmentMain.data.ts +++ b/src/views/wms/deliversettlementManage/saleShipmentMainRequest/saleShipmentMain.data.ts @@ -219,6 +219,9 @@ export const SaleShipmentMain = useCrudSchemas(reactive([ field: 'createTime', sort: 'custom', formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, search: { component: 'DatePicker', componentProps: { @@ -507,4 +510,4 @@ export const SaleShipmentDetail = useCrudSchemas(reactive([ hiddenInMain:true, isTableForm:false, } -])) \ No newline at end of file +])) diff --git a/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts b/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts index 4d95a75b1..561429701 100644 --- a/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts +++ b/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts @@ -165,6 +165,9 @@ export const StockupMainRequest = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, search: { component: 'DatePicker', componentProps: { @@ -186,6 +189,9 @@ export const StockupMainRequest = useCrudSchemas(reactive([ formatter: dateFormatter, isSearch: false, isTable: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, search: { component: 'DatePicker', componentProps: { @@ -212,6 +218,9 @@ export const StockupMainRequest = useCrudSchemas(reactive([ formatter: dateFormatter, isSearch: false, isTable: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, search: { component: 'DatePicker', componentProps: { @@ -238,6 +247,9 @@ export const StockupMainRequest = useCrudSchemas(reactive([ formatter: dateFormatter, isSearch: false, isTable: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, search: { component: 'DatePicker', componentProps: { @@ -489,7 +501,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ table: { width: 180 }, - hiddenInMain: true + hiddenInMain: true }, // { // label: '包装号', @@ -508,7 +520,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ // searchCondition: [ // // { // // key:'customerCode', // 查询列表中字段 - // // value:'customerCode', // 指主表某字段 + // // value:'customerCode', // 指主表某字段 // // message: '请选择客户代码!', // 当前置条件为空时 弹出信息提示 // // isMainValue: true // 表示查询条件是主表的字段的值 // // } @@ -526,7 +538,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ // searchCondition: [ // // { // // key:'customerCode', // 查询列表中字段 - // // value:'customerCode', // 指主表某字段 + // // value:'customerCode', // 指主表某字段 // // message: '请选择客户代码!', // 当前置条件为空时 弹出信息提示 // // isMainValue: true // 表示查询条件是主表的字段的值 // // } @@ -633,7 +645,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ table: { width: 120 }, - hiddenInMain: true + hiddenInMain: true }, { label: '物品描述2', @@ -644,7 +656,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ table: { width: 120 }, - hiddenInMain: true + hiddenInMain: true }, { label: '项目代码', @@ -655,7 +667,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ table: { width: 120 }, - hiddenInMain: true + hiddenInMain: true }, { label: '数量', diff --git a/src/views/wms/productionManage/processproduction/processproductionRequest/processproductionRequestMain.data.ts b/src/views/wms/productionManage/processproduction/processproductionRequest/processproductionRequestMain.data.ts index c0088a6f3..7c4a2c5c5 100644 --- a/src/views/wms/productionManage/processproduction/processproductionRequest/processproductionRequestMain.data.ts +++ b/src/views/wms/productionManage/processproduction/processproductionRequest/processproductionRequestMain.data.ts @@ -1,5 +1,5 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' -import { dateFormatter } from '@/utils/formatTime' +import {dateFormatter, dateFormatter2} from '@/utils/formatTime' import * as ItembasicApi from '@/api/wms/itembasic' import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' import * as ProductionlineitemApi from '@/api/wms/productionlineitem' @@ -289,7 +289,7 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive Date: Tue, 4 Jun 2024 19:41:18 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B1=BB=E5=9E=8B=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productputaway/productputawayRequestMain/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue b/src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue index 36f19ee82..b2a0b323e 100644 --- a/src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue +++ b/src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue @@ -77,8 +77,8 @@ /> - + diff --git a/src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts b/src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts index 21b9f9dbb..9785ed4d6 100644 --- a/src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts +++ b/src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts @@ -1,9 +1,9 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' -import { dateFormatter } from '@/utils/formatTime' import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data"; import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data"; import * as WorkshopApi from "@/api/wms/workshop"; +import {dateFormatter} from '@/utils/formatTime' // 表单校验 export const EquipmentReportRepairRequestRules = reactive({ @@ -149,40 +149,40 @@ export const EquipmentReportRepairRequest = useCrudSchemas(reactive - @@ -66,7 +69,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 '@/components/Detail/src/Detail.vue' -import {Maintenance} from "@/views/eam/maintenance/maintenance.data"; +import AudiForm from '@/views/eam/equipmentReportRepairRequest/audiForm.vue' import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data"; import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data"; @@ -137,11 +140,26 @@ const buttonBaseClick = (val, item) => { } } + +const isShowStatusButton = (row,val) => { + if (val.indexOf(row.status) > -1) { + return false + } else { + return true + } +} + // 列表-操作按钮 -const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentReportRepairRequest:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentReportRepairRequest:delete'}), // 删除 -] +const butttondata = (row) => { + return [ + defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']),hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 编辑 + defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 审核 + defaultButtons.mainListAuditedBtn({hide: isShowStatusButton(row, ['2']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 审核完成 + defaultButtons.mainListRevokeBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), // 撤回 + defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentReportRepairRequest:update'}), + defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentReportRepairRequest:update'}), // 删除 + ] +} // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { @@ -149,6 +167,14 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + } else if (val == 'auditing') { // 审核 + handleAuditing(row.id) + } else if (val == 'revoke') { // 撤回 + handleRevoke(row.id) + } else if (val == 'audited') { // 审核完成 + handleAudited(row) + } else if (val == 'finish') { // 完成 + handleFinish(row.id) } } @@ -199,6 +225,79 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentReportRepairRequest') } +//完成按钮 并生成维修工单 +const handleFinish = async (id: number) => { + await message.delConfirm('是否完成,并创建维修工单?'); + try { + const params = ref({ + id: '', + status:'', + }) + params.value.id = id + params.value.status = '5' + await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} + +//审核完成按钮 +const handleAudited = async (row) => { + message.confirmAudi(t('')).then(async () => { + //打开提交表单 + audiFormRef.value.open('update', row); + }).catch(async (action: Action) => { + if(action === 'cancel'){ + const params = ref({ + id: '', + status:'', + }) + params.value.id = row.id + params.value.status = '4' + await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } + }) +} + +//审核按钮 +const audiFormRef = ref() +const handleAuditing = async (id: number) => { + await message.delConfirm('是否审核所选中工单?'); + try { + const params = ref({ + id: '', + status:'', + }) + params.value.id = id + params.value.status = '2' + await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} + +/** 撤回按钮操作 */ +const handleRevoke = async (id: number) => { + await message.delConfirm('是否撤回所选中工单?'); + try { + const params = ref({ + id: '', + status:'', + }) + params.value.id = id + params.value.status = '1' + await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} + /** 删除按钮操作 */ const handleDelete = async (id: number) => { try { @@ -243,6 +342,34 @@ const importSuccess = () => { getList() } +//audiForm 关闭按钮回传 +const getClosed=(val)=> { + nextTick?.(() => { + getList() + }) +} + +//audiForm 提交按钮回传 +const getData=(val)=> { + nextTick?.(async () => { + + try { + const params = ref({ + id: '', + status:'', + }) + params.value.id = val + params.value.status = '3' + await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value) + message.success(t('工单已流转')) + // 刷新列表 + await getList() + } catch {} + + } + ) +} + const onChange = (field, item) => { //设备