From 5742dbf62147e6a8b12fdda2492c3533746821a6 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 15 May 2024 15:31:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?qad=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/qadproductionplan/index.ts | 58 +++++ .../qadproductionplan/index.vue | 244 ++++++++++++++++++ .../qadProductionPlanMain.data.ts | 119 +++++++++ 3 files changed, 421 insertions(+) create mode 100644 src/api/wms/qadproductionplan/index.ts create mode 100644 src/views/wms/productionManage/productionplan/qadproductionplan/index.vue create mode 100644 src/views/wms/productionManage/productionplan/qadproductionplan/qadProductionPlanMain.data.ts diff --git a/src/api/wms/qadproductionplan/index.ts b/src/api/wms/qadproductionplan/index.ts new file mode 100644 index 000000000..c25893833 --- /dev/null +++ b/src/api/wms/qadproductionplan/index.ts @@ -0,0 +1,58 @@ +import request from '@/config/axios' + +export interface QadProductionPlanMainVO { + displayOrder: number + workshop: string + productionLine: string + shift: string + team: string + planDate: Date + details: string + number: string + planType: string + businessType: string + remark: string + woNumber: string + woLine: string +} + +// 查询QAD生产计划主列表 +export const getQadProductionPlanMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/qad-production-plan-main/senior', data }) + } else { + return await request.get({ url: `/wms/qad-production-plan-main/page`, params }) + } +} + +// 查询QAD生产计划主详情 +export const getQadProductionPlanMain = async (id: number) => { + return await request.get({ url: `/wms/qad-production-plan-main/get?id=` + id }) +} + +// 新增QAD生产计划主 +export const createQadProductionPlanMain = async (data: QadProductionPlanMainVO) => { + return await request.post({ url: `/wms/qad-production-plan-main/create`, data }) +} + +// 修改QAD生产计划主 +export const updateQadProductionPlanMain = async (data: QadProductionPlanMainVO) => { + return await request.put({ url: `/wms/qad-production-plan-main/update`, data }) +} + +// 删除QAD生产计划主 +export const deleteQadProductionPlanMain = async (id: number) => { + return await request.delete({ url: `/wms/qad-production-plan-main/delete?id=` + id }) +} + +// 导出QAD生产计划主 Excel +export const exportQadProductionPlanMain = async (params) => { + return await request.download({ url: `/wms/qad-production-plan-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/qad-production-plan-main/get-import-template' }) +} diff --git a/src/views/wms/productionManage/productionplan/qadproductionplan/index.vue b/src/views/wms/productionManage/productionplan/qadproductionplan/index.vue new file mode 100644 index 000000000..1b0427298 --- /dev/null +++ b/src/views/wms/productionManage/productionplan/qadproductionplan/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/wms/productionManage/productionplan/qadproductionplan/qadProductionPlanMain.data.ts b/src/views/wms/productionManage/productionplan/qadproductionplan/qadProductionPlanMain.data.ts new file mode 100644 index 000000000..01a9d1b4a --- /dev/null +++ b/src/views/wms/productionManage/productionplan/qadproductionplan/qadProductionPlanMain.data.ts @@ -0,0 +1,119 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const QadProductionPlanMainRules = reactive({ + workshop: [required], + woNumber: [required], + woLine: [required], +}) + +export const QadProductionPlanMain = useCrudSchemas(reactive([ + { + label: '顺序', + field: 'displayOrder', + sort: 'custom', + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + }, + { + label: '车间', + field: 'workshop', + sort: 'custom', + isSearch: true, + }, + { + label: '生产线', + field: 'productionLine', + sort: 'custom', + isSearch: true, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + isSearch: true, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + }, + { + label: '计划日期', + field: 'planDate', + sort: 'custom', + formatter: dateFormatter, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '明细列表', + field: 'details', + sort: 'custom', + }, + { + label: '计划类型', + field: 'planType', + sort: 'custom', + form: { + component: 'SelectV2' + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + form: { + component: 'SelectV2' + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isForm: false, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isForm: false, + }, + { + label: '订单号', + field: 'woNumber', + sort: 'custom', + }, + { + label: '订单行', + field: 'woLine', + sort: 'custom', + }, + // { + // label: '操作', + // field: 'action', + // isForm: false, + // table: { + // width: 150, + // fixed: 'right' + // } + // } +])) From 2c62fd004c58b6e4f752facce1ed76cdb6c73b20 Mon Sep 17 00:00:00 2001 From: gaojs <757918719@qq.com> Date: Wed, 15 May 2024 15:35:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?EAM=20=E2=80=94=E2=80=94>=20=E4=B8=BB?= =?UTF-8?q?=E8=A6=81=E9=83=A8=E4=BB=B6=20=E6=96=87=E6=A1=A3=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=20=E6=95=85=E9=9A=9C=E7=B1=BB=E5=9E=8B=20=E6=95=85?= =?UTF-8?q?=E9=9A=9C=E5=8E=9F=E5=9B=A0=20=E5=90=AF=E7=94=A8=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=8C=89=E9=92=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/basicFaultCause/index.ts | 8 +- src/api/eam/basicFaultType/index.ts | 8 +- src/api/eam/basicInspectionOption/index.ts | 64 ++++ src/api/eam/documentType/index.ts | 8 +- src/api/eam/equipmentMainPart/index.ts | 8 +- .../basicFaultCause/basicFaultCause.data.ts | 4 +- src/views/eam/basicFaultCause/index.vue | 57 +++- .../eam/basicFaultType/basicFaultType.data.ts | 4 +- src/views/eam/basicFaultType/index.vue | 58 +++- .../basicInspectionOption.data.ts | 168 ++++++++++ src/views/eam/basicInspectionOption/index.vue | 290 ++++++++++++++++++ .../eam/documentType/documentType.data.ts | 4 +- src/views/eam/documentType/index.vue | 57 +++- .../equipmentMainPart.data.ts | 4 +- src/views/eam/equipmentMainPart/index.vue | 62 +++- 15 files changed, 771 insertions(+), 33 deletions(-) create mode 100644 src/api/eam/basicInspectionOption/index.ts create mode 100644 src/views/eam/basicInspectionOption/basicInspectionOption.data.ts create mode 100644 src/views/eam/basicInspectionOption/index.vue diff --git a/src/api/eam/basicFaultCause/index.ts b/src/api/eam/basicFaultCause/index.ts index 391442089..ff5aed0e5 100644 --- a/src/api/eam/basicFaultCause/index.ts +++ b/src/api/eam/basicFaultCause/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import {EquipmentMainPartVO} from "@/api/eam/equipmentMainPart"; export interface BasicFaultCauseVO { id: number @@ -54,4 +55,9 @@ export const exportBasicFaultCause = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/basic-fault-cause/get-import-template' }) -} \ No newline at end of file +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/basic-fault-cause/ables` , data }) +} diff --git a/src/api/eam/basicFaultType/index.ts b/src/api/eam/basicFaultType/index.ts index 727094608..899b82ec4 100644 --- a/src/api/eam/basicFaultType/index.ts +++ b/src/api/eam/basicFaultType/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import {EquipmentMainPartVO} from "@/api/eam/equipmentMainPart"; export interface BasicFaultTypeVO { id: number @@ -53,4 +54,9 @@ export const exportBasicFaultType = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/basic-fault-type/get-import-template' }) -} \ No newline at end of file +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/basic-fault-type/ables` , data }) +} diff --git a/src/api/eam/basicInspectionOption/index.ts b/src/api/eam/basicInspectionOption/index.ts new file mode 100644 index 000000000..c41812cbe --- /dev/null +++ b/src/api/eam/basicInspectionOption/index.ts @@ -0,0 +1,64 @@ +import request from '@/config/axios' +import {EquipmentMainPartVO} from "@/api/eam/equipmentMainPart"; + +export interface BasicInspectionOptionVO { + id: number + code: string + name: string + describing: string + isUpdated: boolean + type: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询巡检方案列表 +export const getBasicInspectionOptionPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/basic-inspection-option/senior', data }) + } else { + return await request.get({ url: `/eam/basic-inspection-option/page`, params }) + } +} + +// 查询巡检方案详情 +export const getBasicInspectionOption = async (id: number) => { + return await request.get({ url: `/eam/basic-inspection-option/get?id=` + id }) +} + +// 新增巡检方案 +export const createBasicInspectionOption = async (data: BasicInspectionOptionVO) => { + return await request.post({ url: `/eam/basic-inspection-option/create`, data }) +} + +// 修改巡检方案 +export const updateBasicInspectionOption = async (data: BasicInspectionOptionVO) => { + return await request.put({ url: `/eam/basic-inspection-option/update`, data }) +} + +// 删除巡检方案 +export const deleteBasicInspectionOption = async (id: number) => { + return await request.delete({ url: `/eam/basic-inspection-option/delete?id=` + id }) +} + +// 导出巡检方案 Excel +export const exportBasicInspectionOption = async (params) => { + return await request.download({ url: `/eam/basic-inspection-option/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/basic-inspection-option/get-import-template' }) +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/basic-inspection-option/ables` , data }) +} diff --git a/src/api/eam/documentType/index.ts b/src/api/eam/documentType/index.ts index 4d73e1d21..0ab30af39 100644 --- a/src/api/eam/documentType/index.ts +++ b/src/api/eam/documentType/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import {EquipmentMainPartVO} from "@/api/eam/equipmentMainPart"; export interface DocumentTypeVO { id: number @@ -53,4 +54,9 @@ export const exportDocumentType = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/document-type/get-import-template' }) -} \ No newline at end of file +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/document-type/ables` , data }) +} diff --git a/src/api/eam/equipmentMainPart/index.ts b/src/api/eam/equipmentMainPart/index.ts index 482c17209..a5d7acdd2 100644 --- a/src/api/eam/equipmentMainPart/index.ts +++ b/src/api/eam/equipmentMainPart/index.ts @@ -37,6 +37,7 @@ export const createEquipmentMainPart = async (data: EquipmentMainPartVO) => { // 修改主要部件 export const updateEquipmentMainPart = async (data: EquipmentMainPartVO) => { + console.log(data) return await request.put({ url: `/eam/equipment-main-part/update`, data }) } @@ -53,4 +54,9 @@ export const exportEquipmentMainPart = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/equipment-main-part/get-import-template' }) -} \ No newline at end of file +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/equipment-main-part/ables` , data }) +} diff --git a/src/views/eam/basicFaultCause/basicFaultCause.data.ts b/src/views/eam/basicFaultCause/basicFaultCause.data.ts index 7f4a449da..3704d71a1 100644 --- a/src/views/eam/basicFaultCause/basicFaultCause.data.ts +++ b/src/views/eam/basicFaultCause/basicFaultCause.data.ts @@ -94,10 +94,10 @@ export const BasicFaultCause = useCrudSchemas(reactive([ sort: 'custom', form: { component: 'Switch', - value: 'TURE', + value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TURE' + activeValue: 'TRUE' } }, }, diff --git a/src/views/eam/basicFaultCause/index.vue b/src/views/eam/basicFaultCause/index.vue index 856520c70..b2157ca64 100644 --- a/src/views/eam/basicFaultCause/index.vue +++ b/src/views/eam/basicFaultCause/index.vue @@ -33,7 +33,7 @@ @@ -131,11 +131,23 @@ const buttonBaseClick = (val, item) => { } } +const isShowMainButton = (row,val) => { + if (val.indexOf(row.available) > -1) { + return false + } else { + return true + } +} + // 列表-操作按钮 -const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'eam:basicFaultCause:update'}), // 编辑 - //defaultButtons.mainListDeleteBtn({hasPermi:'eam:basicFaultCause:delete'}), // 删除 -] +const butttondata = (row) => { + return [ + defaultButtons.mainListEditBtn({hasPermi:'eam:basicFaultCause:update'}), // 编辑 + //defaultButtons.mainListDeleteBtn({hasPermi:'eam:basicInspectionOption:delete'}), // 删除 + defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:basicFaultCause:update'}), + defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:basicFaultCause:update'}), + ] +} // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { @@ -143,6 +155,10 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + }else if (val == 'enable') { + handleEnable(row.id) + }else if (val == 'disable') { + handleDisable(row.id) } } @@ -195,6 +211,37 @@ const handleDelete = async (id: number) => { } catch {} } +/** 启用 */ +const handleEnable = async (id: number) => { + try { + const params = ref({ + id: '', + available:'', + }) + params.value.id = id + params.value.available = 'TRUE' + await BasicFaultCauseApi.updateEnableCode(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} +/** 禁用 */ +const handleDisable = async (id: number) => { + try { + const params = ref({ + id: '', + available:'', + }) + params.value.id = id + params.value.available = 'FALSE' + await BasicFaultCauseApi.updateEnableCode(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { diff --git a/src/views/eam/basicFaultType/basicFaultType.data.ts b/src/views/eam/basicFaultType/basicFaultType.data.ts index 97d3471d9..4a2802690 100644 --- a/src/views/eam/basicFaultType/basicFaultType.data.ts +++ b/src/views/eam/basicFaultType/basicFaultType.data.ts @@ -81,10 +81,10 @@ export const BasicFaultType = useCrudSchemas(reactive([ sort: 'custom', form: { component: 'Switch', - value: 'TURE', + value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TURE' + activeValue: 'TRUE' } }, }, diff --git a/src/views/eam/basicFaultType/index.vue b/src/views/eam/basicFaultType/index.vue index f45fe0e45..8296e6fa9 100644 --- a/src/views/eam/basicFaultType/index.vue +++ b/src/views/eam/basicFaultType/index.vue @@ -33,7 +33,7 @@ @@ -65,6 +65,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 * as BasicInspectionOptionApi from "@/api/eam/basicInspectionOption"; defineOptions({ name: 'BasicFaultType' }) @@ -131,11 +132,23 @@ const buttonBaseClick = (val, item) => { } } +const isShowMainButton = (row,val) => { + if (val.indexOf(row.available) > -1) { + return false + } else { + return true + } +} + // 列表-操作按钮 -const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'eam:basicFaultType:update'}), // 编辑 - //defaultButtons.mainListDeleteBtn({hasPermi:'eam:basicFaultType:delete'}), // 删除 -] +const butttondata = (row) => { + return [ + defaultButtons.mainListEditBtn({hasPermi:'eam:basicFaultType:update'}), // 编辑 + //defaultButtons.mainListDeleteBtn({hasPermi:'eam:basicInspectionOption:delete'}), // 删除 + defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:basicFaultType:update'}), + defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:basicFaultType:update'}), + ] +} // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { @@ -143,6 +156,10 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + }else if (val == 'enable') { + handleEnable(row.id) + }else if (val == 'disable') { + handleDisable(row.id) } } @@ -195,6 +212,37 @@ const handleDelete = async (id: number) => { } catch {} } +/** 启用 */ +const handleEnable = async (id: number) => { + try { + const params = ref({ + id: '', + available:'', + }) + params.value.id = id + params.value.available = 'TRUE' + await BasicFaultTypeApi.updateEnableCode(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} +/** 禁用 */ +const handleDisable = async (id: number) => { + try { + const params = ref({ + id: '', + available:'', + }) + params.value.id = id + params.value.available = 'FALSE' + await BasicFaultTypeApi.updateEnableCode(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { diff --git a/src/views/eam/basicInspectionOption/basicInspectionOption.data.ts b/src/views/eam/basicInspectionOption/basicInspectionOption.data.ts new file mode 100644 index 000000000..6e7fe83bf --- /dev/null +++ b/src/views/eam/basicInspectionOption/basicInspectionOption.data.ts @@ -0,0 +1,168 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const BasicInspectionOptionRules = reactive({ + code: [required], + name: [required], + type: [required], +}) + +export const BasicInspectionOption = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '编号', + field: 'code', + sort: 'custom', + isSearch: true, + }, + { + label: '方案名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '描述', + field: 'describing', + sort: 'custom', + isSearch: true, + }, + { + label: '项是否可修改', + field: 'isUpdated', + sort: 'custom', + isSearch: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '来源于类型配置', + field: 'type', + sort: 'custom', + isSearch: true, + }, + { + 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, + }, + { + label: '部门id', + field: 'departmentCode', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '删除时间', + field: 'deletionTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail: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' + } + }, + }, + { + label: '删除人id', + field: 'deleterId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/basicInspectionOption/index.vue b/src/views/eam/basicInspectionOption/index.vue new file mode 100644 index 000000000..c58bf8890 --- /dev/null +++ b/src/views/eam/basicInspectionOption/index.vue @@ -0,0 +1,290 @@ + + + diff --git a/src/views/eam/documentType/documentType.data.ts b/src/views/eam/documentType/documentType.data.ts index 1ec63a019..38605efc5 100644 --- a/src/views/eam/documentType/documentType.data.ts +++ b/src/views/eam/documentType/documentType.data.ts @@ -83,10 +83,10 @@ export const DocumentType = useCrudSchemas(reactive([ sort: 'custom', form: { component: 'Switch', - value: 'TURE', + value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TURE' + activeValue: 'TRUE' } }, }, diff --git a/src/views/eam/documentType/index.vue b/src/views/eam/documentType/index.vue index b244a4a6e..0f46e6cf1 100644 --- a/src/views/eam/documentType/index.vue +++ b/src/views/eam/documentType/index.vue @@ -33,7 +33,7 @@ @@ -131,11 +131,23 @@ const buttonBaseClick = (val, item) => { } } +const isShowMainButton = (row,val) => { + if (val.indexOf(row.available) > -1) { + return false + } else { + return true + } +} + // 列表-操作按钮 -const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'eam:documentType:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'eam:documentType:delete'}), // 删除 -] +const butttondata = (row) => { + return [ + defaultButtons.mainListEditBtn({hasPermi:'eam:documentType:update'}), // 编辑 + //defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMainPart:delete'}), // 删除 + defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:documentType:update'}), + defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:documentType:update'}), + ] +} // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { @@ -143,6 +155,10 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + }else if (val == 'enable') { + handleEnable(row.id) + }else if (val == 'disable') { + handleDisable(row.id) } } @@ -211,6 +227,37 @@ const handleExport = async () => { } } +/** 启用 */ +const handleEnable = async (id: number) => { + try { + const params = ref({ + id: '', + available:'', + }) + params.value.id = id + params.value.available = 'TRUE' + await DocumentTypeApi.updateEnableCode(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} +/** 禁用 */ +const handleDisable = async (id: number) => { + try { + const params = ref({ + id: '', + available:'', + }) + params.value.id = id + params.value.available = 'FALSE' + await DocumentTypeApi.updateEnableCode(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} + /** 导入 */ const importFormRef = ref() const handleImport = () => { diff --git a/src/views/eam/equipmentMainPart/equipmentMainPart.data.ts b/src/views/eam/equipmentMainPart/equipmentMainPart.data.ts index 8937ab8ef..efba49dec 100644 --- a/src/views/eam/equipmentMainPart/equipmentMainPart.data.ts +++ b/src/views/eam/equipmentMainPart/equipmentMainPart.data.ts @@ -83,10 +83,10 @@ export const EquipmentMainPart = useCrudSchemas(reactive([ isSearch: true, form: { component: 'Switch', - value: 'TURE', + value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TURE' + activeValue: 'TRUE' } }, }, diff --git a/src/views/eam/equipmentMainPart/index.vue b/src/views/eam/equipmentMainPart/index.vue index 97cd0bdaf..6af6d2835 100644 --- a/src/views/eam/equipmentMainPart/index.vue +++ b/src/views/eam/equipmentMainPart/index.vue @@ -33,7 +33,7 @@ @@ -131,11 +131,23 @@ const buttonBaseClick = (val, item) => { } } -// 列表-操作按钮 -const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMainPart:update'}), // 编辑 - //defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMainPart:delete'}), // 删除 -] +const isShowMainButton = (row,val) => { + if (val.indexOf(row.available) > -1) { + return false + } else { + return true + } +} + + +const butttondata = (row) => { + return [ + defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMainPart:update'}), // 编辑 + //defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMainPart:delete'}), // 删除 + defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:equipmentMainPart:update'}), + defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:equipmentMainPart:update'}), + ] +} // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { @@ -143,6 +155,10 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + }else if (val == 'enable') { + handleEnable(row.id) + }else if (val == 'disable') { + handleDisable(row.id) } } @@ -195,6 +211,40 @@ const handleDelete = async (id: number) => { } catch {} } + + + +/** 启用 */ +const handleEnable = async (id: number) => { + try { + const params = ref({ + id: '', + available:'', + }) + params.value.id = id + params.value.available = 'TRUE' + await EquipmentMainPartApi.updateEnableCode(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} +/** 禁用 */ +const handleDisable = async (id: number) => { + try { + const params = ref({ + id: '', + available:'', + }) + params.value.id = id + params.value.available = 'FALSE' + await EquipmentMainPartApi.updateEnableCode(params.value) + message.success(t('common.updateSuccess')) + // 刷新列表 + await getList() + } catch {} +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { From b2b27ba9b8a4cada0d05c5fb343c5dd56e005f55 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Wed, 15 May 2024 15:42:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=A7=9F=E6=88=B7=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.hella13 | 3 +++ .env.hella14 | 3 +++ .env.hella15 | 3 +++ .env.hella16 | 3 +++ .env.hella8 | 4 ++++ .env.hella9 | 3 +++ 6 files changed, 19 insertions(+) diff --git a/.env.hella13 b/.env.hella13 index 9b9e1300c..b60b2be7c 100644 --- a/.env.hella13 +++ b/.env.hella13 @@ -35,3 +35,6 @@ VITE_INTERFACE_URL='http://172.21.32.13:90/magic/web/index.html' # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' + +# 租户配置 +VITE_TENANT='["长春"]' diff --git a/.env.hella14 b/.env.hella14 index 9e15dcdd5..4d29e7b41 100644 --- a/.env.hella14 +++ b/.env.hella14 @@ -35,3 +35,6 @@ VITE_INTERFACE_URL='http://172.21.32.14:90/magic/web/index.html' # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' + +# 租户配置 +VITE_TENANT='["长春"]' diff --git a/.env.hella15 b/.env.hella15 index 30eac259b..dc2a813d1 100644 --- a/.env.hella15 +++ b/.env.hella15 @@ -35,3 +35,6 @@ VITE_INTERFACE_URL='http://172.21.32.15:90/magic/web/index.html' # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.21.32.15:90' + +# 租户配置 +VITE_TENANT='["长春"]' diff --git a/.env.hella16 b/.env.hella16 index 459c68a41..dd8d228a8 100644 --- a/.env.hella16 +++ b/.env.hella16 @@ -35,3 +35,6 @@ VITE_INTERFACE_URL='http://172.21.32.16:90/magic/web/index.html' # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.21.32.16:90' + +# 租户配置 +VITE_TENANT='["长春"]' diff --git a/.env.hella8 b/.env.hella8 index 844c22c0e..d1d914dac 100644 --- a/.env.hella8 +++ b/.env.hella8 @@ -35,3 +35,7 @@ VITE_INTERFACE_URL='http://172.22.32.8:90/magic/web/index.html' # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' + + +# 租户配置 +VITE_TENANT='["成都"]' \ No newline at end of file diff --git a/.env.hella9 b/.env.hella9 index 308a2ffd2..86853d4ef 100644 --- a/.env.hella9 +++ b/.env.hella9 @@ -35,3 +35,6 @@ VITE_INTERFACE_URL='http://172.22.32.9:90/magic/web/index.html' # 积木报表请求路径 VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' + +# 租户配置 +VITE_TENANT='["成都"]' \ No newline at end of file