From 5a7b617fc01585676b5d3bd8c5d09145fac26e24 Mon Sep 17 00:00:00 2001 From: lidm0086 Date: Thu, 2 Jan 2025 13:15:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.test | 5 +- src/api/battery/monomer/index.ts | 149 +++++++++++++++------------- src/hooks/web/useMessage.ts | 12 +++ src/locales/zh-CN.ts | 2 + src/views/battery/monomer/index.vue | 37 ++++++- 5 files changed, 127 insertions(+), 78 deletions(-) diff --git a/.env.test b/.env.test index 2fabcf5..1f70843 100644 --- a/.env.test +++ b/.env.test @@ -36,17 +36,16 @@ VITE_INTERFACE_URL='http://10.56.17.106:25111/magic/web/index.html' #VITE_INTERFACE_URL='http://dev.ccwin-in.com:25111/magic/web/index.html' # 积木报表请求路径 -VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25111' +VITE_JMREPORT_BASE_URL='http://10.56.17.106:25111' # 租户配置 VITE_TENANT='["东驰新能源"]' # 查看质检报告环境 -VITE_REPORT_URL = 'http://dev.ccwin-in.com:25400' +VITE_REPORT_URL = 'http://10.56.17.106:25400' # 是否需要验证码 VITE_NEED_CODE = true - # 是否需要下载PDA链接 VITE_PDA_URL = true diff --git a/src/api/battery/monomer/index.ts b/src/api/battery/monomer/index.ts index 7330d11..dfc5684 100644 --- a/src/api/battery/monomer/index.ts +++ b/src/api/battery/monomer/index.ts @@ -19,77 +19,77 @@ export interface MonomerVO { procRemark: String type: String - acoreThi: String - acoreWid: String - bcoreThi: String - bcoreWid: String - - oneInjectPreCpk: String - twoInjectPreCpk: String - posCoatDenCpk: String - negCoatDenCpk: String - posRollThickCpk: String - negRollThickCpk: String - oneInjectCpk: String - finalInjectRetenCpk: String - - temOfPriinjectPlant: String - temOfPreStandPlant: String - temOfStandPlant: String - temOfAftStandPlant: String - temOfSecinjectPlant: String - tempOfBefVolSepPlant: String - tempOfVolSepPlant: String - humOfVolAssPlant: String - humOfPriinjectPlant: String - humOfPreStandPlant: String - humOfStandPlant: String - humOfAftStandPlant: String - humOfSecinjectPlant: String - humpOfBefVolSepPlant: String - humpOfVolSepPlant: String - standardOfClean: String - cleanOfCoatPlant: String - cleanOfRollPlant: String - cleanOfSlitPlant: String - cleanOfStackPlant: String - cleanOfPriInjectPlant: String - cOfPreStandPlant: String - clOfStandPlant: String - cleanOfAftStandPlant: String - - passPer: String - equAbnList: String - equAbnAlarm: String - environAbnoralarm: String - - posPowrMagSub: String - negPowrMagSub: String - posSlurMagSub: String - negSlurMagSub: String - posPolOneSidDen: String - negPolOneSidDen: String - posPolDouSidDen: String - negPolDouSidDen: String - posColTh: String - negColTh: String - posPolLen: String - negPolLen: String - diaThiAftDieSli: String - verHeiAftDieSli: String - mosConPolAftBak: String - - vacLeaValOrHelVal: String - helDetAftWel: String - tolInj: String - tolInjPerDev: String - totWeight: String - facVol: String - quantitative: String - impAc: String - celLen: String - celWid: String - celThi: String + // acoreThi: String + // acoreWid: String + // bcoreThi: String + // bcoreWid: String + // + // oneInjectPreCpk: String + // twoInjectPreCpk: String + // posCoatDenCpk: String + // negCoatDenCpk: String + // posRollThickCpk: String + // negRollThickCpk: String + // oneInjectCpk: String + // finalInjectRetenCpk: String + // + // temOfPriinjectPlant: String + // temOfPreStandPlant: String + // temOfStandPlant: String + // temOfAftStandPlant: String + // temOfSecinjectPlant: String + // tempOfBefVolSepPlant: String + // tempOfVolSepPlant: String + // humOfVolAssPlant: String + // humOfPriinjectPlant: String + // humOfPreStandPlant: String + // humOfStandPlant: String + // humOfAftStandPlant: String + // humOfSecinjectPlant: String + // humpOfBefVolSepPlant: String + // humpOfVolSepPlant: String + // standardOfClean: String + // cleanOfCoatPlant: String + // cleanOfRollPlant: String + // cleanOfSlitPlant: String + // cleanOfStackPlant: String + // cleanOfPriInjectPlant: String + // cOfPreStandPlant: String + // clOfStandPlant: String + // cleanOfAftStandPlant: String + // + // passPer: String + // equAbnList: String + // equAbnAlarm: String + // environAbnoralarm: String + // + // posPowrMagSub: String + // negPowrMagSub: String + // posSlurMagSub: String + // negSlurMagSub: String + // posPolOneSidDen: String + // negPolOneSidDen: String + // posPolDouSidDen: String + // negPolDouSidDen: String + // posColTh: String + // negColTh: String + // posPolLen: String + // negPolLen: String + // diaThiAftDieSli: String + // verHeiAftDieSli: String + // mosConPolAftBak: String + // + // vacLeaValOrHelVal: String + // helDetAftWel: String + // tolInj: String + // tolInjPerDev: String + // totWeight: String + // facVol: String + // quantitative: String + // impAc: String + // celLen: String + // celWid: String + // celThi: String } // 查询battery_cell_device列表 @@ -113,6 +113,13 @@ export const createMonomer = async (data: MonomerVO) => { return await request.post({ url: `/battery/monomer/create`, data }) } +export const releaseStatic = async (data: MonomerVO) => { + return await request.put({ url: `/battery/monomer/release-static`, data }) +} + +export const releaseMoving = async (data: MonomerVO) => { + return await request.put({ url: `/battery/monomer/release-moving`, data }) +} // 修改battery_cell_device export const updateMonomer = async (data: MonomerVO) => { return await request.put({ url: `/battery/monomer/update`, data }) diff --git a/src/hooks/web/useMessage.ts b/src/hooks/web/useMessage.ts index 1de1822..b94fef7 100644 --- a/src/hooks/web/useMessage.ts +++ b/src/hooks/web/useMessage.ts @@ -1,5 +1,6 @@ import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' import { useI18n } from './useI18n' +import {releaseStatic} from "@/api/battery/monomer"; export const useMessage = () => { const { t } = useI18n() return { @@ -77,6 +78,17 @@ export const useMessage = () => { type: 'warning' }) }, + releaseConfirm(content?: string, tip?: string) { + return ElMessageBox.confirm( + content ? content : t('common.releaseMessage'), + tip ? tip : t('common.confirmTitle'), + { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + } + ) + }, // 删除窗体 delConfirm(content?: string, tip?: string) { return ElMessageBox.confirm( diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 0dc4185..fc394de 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -46,7 +46,9 @@ export default { updateSuccess: '修改成功', emailSentSuccess: '邮件发送成功', delMessage: '是否删除所选中数据?', + releaseMessage: '是否发布所选中数据?', delDataMessage: '是否删除数据?', + releaseDataMessage: '是否发布数据?', delNoData: '请选择需要删除的数据', delSuccess: '删除成功', index: '序号', diff --git a/src/views/battery/monomer/index.vue b/src/views/battery/monomer/index.vue index 8dec7b2..94dcfe7 100644 --- a/src/views/battery/monomer/index.vue +++ b/src/views/battery/monomer/index.vue @@ -226,6 +226,7 @@ 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 {defaultAddStaticBtn} from "@/utils/disposition/defaultButtons"; +import {releaseMoving, releaseStatic} from "@/api/battery/monomer"; defineOptions({ name: 'CellDevice' }) @@ -263,7 +264,7 @@ const HeadButttondata = [ defaultButtons.defaultAddStaticBtn({hasPermi:'battery:monomer:update'}), // 静态数据 defaultButtons.defaultAddBtn({hasPermi:'battery:monomer:create'}), // 新增 // defaultButtons.defaultImportBtn({hasPermi:'battery:cellDevice:import'}), // 导入 - defaultButtons.defaultExportBtn({hasPermi:'battery:monomer:export'}), // 导出 + // defaultButtons.defaultExportBtn({hasPermi:'battery:monomer:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 // defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -293,13 +294,23 @@ const buttonBaseClick = (val, item) => { console.log('其他按钮', item) } } +// isShowButton +const isShowButton = (row,val) => { + if (row.type == 'static') { + return false + } else if (row.sending == '0') { + return false + } else{ + return true + } +} // 列表-操作按钮 const butttondata = (row,$index) => { return [ - defaultButtons.mainListEditBtn({hasPermi:'battery:monomer:update'}), // 编辑 - defaultButtons.mainListReleaseBtn({hide:(row.release =='0' || row.type !='static'),hasPermi:'battery:monomer:update'}), // 发布 + defaultButtons.mainListEditBtn({hide:isShowButton(row,['FALSE']),hasPermi:'battery:monomer:update'}), // 编辑 + defaultButtons.mainListReleaseBtn({hide:isShowButton(row,['FALSE']),hasPermi:'battery:monomer:update'}), // 发布 defaultButtons.mainListDeleteBtn({hide:row.type =='static' ,hasPermi:'battery:monomer:delete'}), // 删除 ] } @@ -307,10 +318,11 @@ const butttondata = (row,$index) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 - openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + }else if (val == 'release') { // 发布 + handleRelease(row) } } @@ -410,6 +422,23 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicCellDevice') } +const handleRelease = async (row?: any) => { + try { + // 删除的二次确认 + await message.releaseConfirm() + // 发起删除 + if(row.type == 'static'){ + await MonomerApi.releaseStatic(row); + }else{ + await MonomerApi.releaseMoving(row); + } + message.success('发送成功') + // 刷新列表 + await getList() + } catch {} +} + + /** 删除按钮操作 */ const handleDelete = async (id: number) => { try {