黄伟杰 2 months ago
commit 772cbdbb32

@ -102,5 +102,14 @@ export const DeviceLedgerApi = {
exportMold: async (params) => { exportMold: async (params) => {
return await request.download({ url: `/mes/device-ledger/export-mold`, params }) return await request.download({ url: `/mes/device-ledger/export-mold`, params })
},
// 查询设备关键件明细
getDeviceCriticalComponent: async (id: number) => {
return await request.get({ url: `/mes/device-critical-component/getDetails?deviceId=` + id })
},
exportDeviceComponent: async (params: any) => {
return await request.download({ url: `/mes/device-critical-component/export-excel`, params })
} }
} }

@ -716,6 +716,17 @@ const remainingRouter: AppRouteRecordRaw[] = [
activeMenu: '/mes/deviceledger' activeMenu: '/mes/deviceledger'
}, },
component: () => import('@/views/mes/deviceledger/detail/index.vue') component: () => import('@/views/mes/deviceledger/detail/index.vue')
},
{
path: 'device-ledger/detail/editIndex:id',
name: 'MesDeviceLedgerEditDetail',
meta: {
title: '编辑设备台账',
noCache: true,
hidden: true,
activeMenu: '/mes/deviceledger'
},
component: () => import('@/views/mes/deviceledger/detail/editIndex.vue')
} }
] ]
} }

@ -1,11 +1,17 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1080"> <div class="stock-in-panel">
<div class="stock-in-panel__header">
<div class="stock-in-panel__title">{{ dialogTitle }}</div>
<el-button text @click="closeForm">
<Icon icon="ep:close" />
</el-button>
</div>
<div class="stock-in-dialog" v-loading="formLoading">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="110px" label-width="110px"
v-loading="formLoading"
:disabled="disabled" :disabled="disabled"
> >
<el-row :gutter="20"> <el-row :gutter="20">
@ -88,13 +94,15 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap> </ContentWrap>
<template #footer> </div>
<el-button @click="submitForm" type="primary" :disabled="formLoading" v-if="!disabled">
<div class="stock-in-footer">
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
<el-button v-if="!disabled" @click="submitForm" type="primary" :disabled="formLoading">
{{ t('common.ok') }} {{ t('common.ok') }}
</el-button> </el-button>
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button> </div>
</template> </div>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { StockInApi, StockInVO } from '@/api/erp/stock/in' import { StockInApi, StockInVO } from '@/api/erp/stock/in'
@ -107,7 +115,6 @@ defineOptions({ name: 'StockInForm' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - detail - const formType = ref('') // create - update - detail -
@ -158,7 +165,6 @@ const itemFormRef = ref()
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
@ -177,8 +183,12 @@ const open = async (type: string, id?: number) => {
} }
defineExpose({ open }) // open defineExpose({ open }) // open
const closeForm = () => {
emit('closed')
}
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success', 'closed']) // success closed
const submitForm = async () => { const submitForm = async () => {
// //
await formRef.value.validate() await formRef.value.validate()
@ -194,9 +204,9 @@ const submitForm = async () => {
await StockInApi.updateStockIn(data) await StockInApi.updateStockIn(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false
// //
emit('success') emit('success')
closeForm()
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -215,3 +225,57 @@ const resetForm = () => {
formRef.value?.resetFields() formRef.value?.resetFields()
} }
</script> </script>
<style lang="scss" scoped>
.stock-in-panel {
background: #fff;
border-radius: 12px;
box-shadow: var(--el-box-shadow-light);
}
.stock-in-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
}
.stock-in-panel__title {
color: #1f2937;
font-size: 18px;
font-weight: 600;
}
.stock-in-dialog {
max-height: calc(100vh - 220px);
padding: 20px 20px 0;
padding-right: 16px;
overflow-y: auto;
}
.stock-in-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
width: 100%;
padding: 16px 20px 20px;
border-top: 1px solid #ebeef5;
}
@media (max-width: 768px) {
.stock-in-panel__header {
padding: 14px 16px;
}
.stock-in-dialog {
max-height: none;
padding: 16px 16px 0;
overflow-y: visible;
}
.stock-in-footer {
padding: 16px;
}
}
</style>

@ -1,5 +1,6 @@
<template> <template>
<div class="stock-in-page">
<template v-if="!formVisible">
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
@ -218,9 +219,10 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
</template>
<!-- 表单弹窗添加/修改 --> <StockInForm v-else ref="formRef" @success="getList" @closed="formVisible = false" />
<StockInForm ref="formRef" @success="getList" /> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -296,8 +298,12 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const formVisible = ref(false)
formRef.value.open(type, id)
const openForm = async (type: string, id?: number) => {
formVisible.value = true
await nextTick()
formRef.value?.open(type, id)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

@ -1,11 +1,17 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1080"> <div class="stock-out-panel">
<div class="stock-out-panel__header">
<div class="stock-out-panel__title">{{ dialogTitle }}</div>
<el-button text @click="closeForm">
<Icon icon="ep:close" />
</el-button>
</div>
<div class="stock-out-dialog" v-loading="formLoading">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="100px" label-width="100px"
v-loading="formLoading"
:disabled="disabled" :disabled="disabled"
> >
<el-row :gutter="20"> <el-row :gutter="20">
@ -72,13 +78,15 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap> </ContentWrap>
<template #footer> </div>
<el-button @click="submitForm" type="primary" :disabled="formLoading" v-if="!disabled">
{{ t('action.save') }} <div class="stock-out-footer">
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
<el-button v-if="!disabled" @click="submitForm" type="primary" :disabled="formLoading">
{{ t('common.ok') }}
</el-button> </el-button>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button> </div>
</template> </div>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { StockOutApi, StockOutVO } from '@/api/erp/stock/out' import { StockOutApi, StockOutVO } from '@/api/erp/stock/out'
@ -92,7 +100,6 @@ defineOptions({ name: 'StockOutForm' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - detail - const formType = ref('') // create - update - detail -
@ -146,7 +153,6 @@ const itemFormRef = ref()
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
@ -163,8 +169,12 @@ const open = async (type: string, id?: number) => {
} }
defineExpose({ open }) // open defineExpose({ open }) // open
const closeForm = () => {
emit('closed')
}
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success', 'closed']) // success closed
const submitForm = async () => { const submitForm = async () => {
// //
await formRef.value.validate() await formRef.value.validate()
@ -180,9 +190,9 @@ const submitForm = async () => {
await StockOutApi.updateStockOut(data) await StockOutApi.updateStockOut(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false
// //
emit('success') emit('success')
closeForm()
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -201,3 +211,57 @@ const resetForm = () => {
formRef.value?.resetFields() formRef.value?.resetFields()
} }
</script> </script>
<style lang="scss" scoped>
.stock-out-panel {
background: #fff;
border-radius: 12px;
box-shadow: var(--el-box-shadow-light);
}
.stock-out-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
}
.stock-out-panel__title {
color: #1f2937;
font-size: 18px;
font-weight: 600;
}
.stock-out-dialog {
max-height: calc(100vh - 220px);
padding: 20px 20px 0;
padding-right: 16px;
overflow-y: auto;
}
.stock-out-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
width: 100%;
padding: 16px 20px 20px;
border-top: 1px solid #ebeef5;
}
@media (max-width: 768px) {
.stock-out-panel__header {
padding: 14px 16px;
}
.stock-out-dialog {
max-height: none;
padding: 16px 16px 0;
overflow-y: visible;
}
.stock-out-footer {
padding: 16px;
}
}
</style>

@ -1,5 +1,6 @@
<template> <template>
<div class="stock-out-page">
<template v-if="!formVisible">
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
@ -211,9 +212,10 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
</template>
<!-- 表单弹窗添加/修改 --> <StockOutForm v-else ref="formRef" @success="getList" @closed="formVisible = false" />
<StockOutForm ref="formRef" @success="getList" /> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -289,8 +291,12 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const formVisible = ref(false)
formRef.value.open(type, id)
const openForm = async (type: string, id?: number) => {
formVisible.value = true
await nextTick()
formRef.value?.open(type, id)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

@ -1,11 +1,17 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1080"> <div class="stock-out-panel">
<div class="stock-out-panel__header">
<div class="stock-out-panel__title">{{ dialogTitle }}</div>
<el-button text @click="closeForm">
<Icon icon="ep:close" />
</el-button>
</div>
<div class="stock-out-dialog" v-loading="formLoading">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="100px" label-width="100px"
v-loading="formLoading"
:disabled="disabled" :disabled="disabled"
> >
<el-row :gutter="20"> <el-row :gutter="20">
@ -90,13 +96,15 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap> </ContentWrap>
<template #footer> </div>
<el-button @click="submitForm" type="primary" :disabled="formLoading" v-if="!disabled">
<div class="stock-out-footer">
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
<el-button v-if="!disabled" @click="submitForm" type="primary" :disabled="formLoading">
{{ t('common.ok') }} {{ t('common.ok') }}
</el-button> </el-button>
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button> </div>
</template> </div>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { StockOutApi, StockOutVO } from '@/api/erp/stock/out' import { StockOutApi, StockOutVO } from '@/api/erp/stock/out'
@ -109,7 +117,6 @@ defineOptions({ name: 'StockOutForm' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - detail - const formType = ref('') // create - update - detail -
@ -158,7 +165,6 @@ const itemFormRef = ref()
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
@ -176,8 +182,12 @@ const open = async (type: string, id?: number) => {
} }
defineExpose({ open }) // open defineExpose({ open }) // open
const closeForm = () => {
emit('closed')
}
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success', 'closed']) // success closed
const submitForm = async () => { const submitForm = async () => {
// //
await formRef.value.validate() await formRef.value.validate()
@ -193,9 +203,9 @@ const submitForm = async () => {
await StockOutApi.updateStockOut(data) await StockOutApi.updateStockOut(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false
// //
emit('success') emit('success')
closeForm()
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -214,3 +224,57 @@ const resetForm = () => {
formRef.value?.resetFields() formRef.value?.resetFields()
} }
</script> </script>
<style lang="scss" scoped>
.stock-out-panel {
background: #fff;
border-radius: 12px;
box-shadow: var(--el-box-shadow-light);
}
.stock-out-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
}
.stock-out-panel__title {
color: #1f2937;
font-size: 18px;
font-weight: 600;
}
.stock-out-dialog {
max-height: calc(100vh - 220px);
padding: 20px 20px 0;
padding-right: 16px;
overflow-y: auto;
}
.stock-out-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
width: 100%;
padding: 16px 20px 20px;
border-top: 1px solid #ebeef5;
}
@media (max-width: 768px) {
.stock-out-panel__header {
padding: 14px 16px;
}
.stock-out-dialog {
max-height: none;
padding: 16px 16px 0;
overflow-y: visible;
}
.stock-out-footer {
padding: 16px;
}
}
</style>

@ -1,4 +1,6 @@
<template> <template>
<div class="stock-out-page">
<template v-if="!formVisible">
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
@ -282,9 +284,10 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
</template>
<!-- 表单弹窗添加/修改 --> <StockOutForm v-else ref="formRef" @success="getList" @closed="formVisible = false" />
<StockOutForm ref="formRef" @success="getList" /> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -360,8 +363,12 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const formVisible = ref(false)
formRef.value.open(type, id)
const openForm = async (type: string, id?: number) => {
formVisible.value = true
await nextTick()
formRef.value?.open(type, id)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

@ -1,11 +1,17 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px"> <div class="feedback-panel">
<div class="feedback-panel__header">
<div class="feedback-panel__title">{{ dialogTitle }}</div>
<el-button text @click="closeForm">
<Icon icon="ep:close" />
</el-button>
</div>
<div class="feedback-dialog" v-loading="formLoading">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="100px" label-width="100px"
v-loading="formLoading"
> >
<el-form-item label="标题" prop="title"> <el-form-item label="标题" prop="title">
<el-input v-model="formData.title" placeholder="请输入标题" /> <el-input v-model="formData.title" placeholder="请输入标题" />
@ -16,13 +22,13 @@
<el-form-item label="内容" prop="content"> <el-form-item label="内容" prop="content">
<Editor v-model="formData.content" height="150px" /> <Editor v-model="formData.content" height="150px" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> </div>
<div class="feedback-footer">
<el-button @click="closeForm"> </el-button>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> </div>
</template> </div>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { FeedbackApi, FeedbackVO } from '@/api/iot/feedback' import { FeedbackApi, FeedbackVO } from '@/api/iot/feedback'
@ -33,7 +39,6 @@ defineOptions({ name: 'FeedbackForm' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
@ -50,7 +55,6 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
@ -66,8 +70,12 @@ const open = async (type: string, id?: number) => {
} }
defineExpose({ open }) // open defineExpose({ open }) // open
const closeForm = () => {
emit('closed')
}
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success', 'closed']) // success closed
const submitForm = async () => { const submitForm = async () => {
// //
await formRef.value.validate() await formRef.value.validate()
@ -82,7 +90,7 @@ const submitForm = async () => {
await FeedbackApi.updateFeedback(data) await FeedbackApi.updateFeedback(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false closeForm()
// //
emit('success') emit('success')
} finally { } finally {
@ -101,3 +109,57 @@ const resetForm = () => {
formRef.value?.resetFields() formRef.value?.resetFields()
} }
</script> </script>
<style lang="scss" scoped>
.feedback-panel {
background: #fff;
border-radius: 12px;
box-shadow: var(--el-box-shadow-light);
}
.feedback-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
}
.feedback-panel__title {
color: #1f2937;
font-size: 18px;
font-weight: 600;
}
.feedback-dialog {
max-height: calc(100vh - 220px);
padding: 20px 20px 0;
padding-right: 16px;
overflow-y: auto;
}
.feedback-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
width: 100%;
padding: 16px 20px 20px;
border-top: 1px solid #ebeef5;
}
@media (max-width: 768px) {
.feedback-panel__header {
padding: 14px 16px;
}
.feedback-dialog {
max-height: none;
padding: 16px 16px 0;
overflow-y: visible;
}
.feedback-footer {
padding: 16px;
}
}
</style>

@ -1,4 +1,6 @@
<template> <template>
<div class="feedback-page">
<template v-if="!formVisible">
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
@ -105,9 +107,11 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
</template>
<!-- 表单弹窗添加/修改 --> <!-- 表单添加/修改 -->
<FeedbackForm ref="formRef" @success="getList" /> <FeedbackForm v-else ref="formRef" @success="getList" @closed="formVisible = false" />
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -163,8 +167,12 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const formVisible = ref(false)
formRef.value.open(type, id)
const openForm = async (type: string, id?: number) => {
formVisible.value = true
await nextTick()
formRef.value?.open(type, id)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

@ -1,6 +1,13 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="720px"> <div class="critical-component-panel">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px" v-loading="formLoading"> <div class="critical-component-panel__header">
<div class="critical-component-panel__title">{{ dialogTitle }}</div>
<el-button text @click="closeForm">
<Icon icon="ep:close" />
</el-button>
</div>
<div class="critical-component-dialog" v-loading="formLoading">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px">
<el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.code')" prop="code"> <el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.code')" prop="code">
<el-row :gutter="10" style="width: 100%"> <el-row :gutter="10" style="width: 100%">
<el-col :xs="24" :sm="18" :md="16" :lg="14" :xl="12"> <el-col :xs="24" :sm="18" :md="16" :lg="14" :xl="12">
@ -44,20 +51,15 @@
type="textarea" type="textarea"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.count')" prop="count"> <!-- <el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.count')" prop="count">
<el-input <el-input
v-model="formData.count" v-model="formData.count"
:placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderCount')" :placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderCount')"
clearable clearable
type="number" type="number"
/> />
</el-form-item> </el-form-item>-->
<el-row :gutter="16"> <el-row :gutter="16">
<!-- <el-col :span="24">
<el-form-item label="资产编号" prop="id">
<el-input v-model="formData.id" placeholder="系统自动生成" disabled />
</el-form-item>
</el-col> -->
<el-col :span="12" > <el-col :span="12" >
<el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.qrcode')" prop="qrcodeUrl"> <el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.qrcode')" prop="qrcodeUrl">
<QrcodeActionCard <QrcodeActionCard
@ -94,11 +96,12 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> </div>
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button> <div class="critical-component-footer">
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
<el-button type="primary" @click="submitForm" :disabled="formLoading">{{ t('common.ok') }}</el-button> <el-button type="primary" @click="submitForm" :disabled="formLoading">{{ t('common.ok') }}</el-button>
</template> </div>
</Dialog> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -111,7 +114,6 @@ defineOptions({ name: 'CriticalComponentForm' })
const { t } = useI18n() const { t } = useI18n()
const message = useMessage() const message = useMessage()
const dialogVisible = ref(false)
const dialogTitle = ref('') const dialogTitle = ref('')
const formLoading = ref(false) const formLoading = ref(false)
const formType = ref<'create' | 'update'>('create') const formType = ref<'create' | 'update'>('create')
@ -198,8 +200,10 @@ const handleQrcodeRefreshSuccess = async (data: any) => {
formData.value.code = detail?.code ?? formData.value.code formData.value.code = detail?.code ?? formData.value.code
} }
let openRequestId = 0
const open = async (type: 'create' | 'update', id?: number) => { const open = async (type: 'create' | 'update', id?: number) => {
dialogVisible.value = true const currentOpenId = ++openRequestId
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
@ -207,6 +211,7 @@ const open = async (type: 'create' | 'update', id?: number) => {
formLoading.value = true formLoading.value = true
try { try {
const detail = await CriticalComponentApi.getCriticalComponent(id) const detail = await CriticalComponentApi.getCriticalComponent(id)
if (currentOpenId !== openRequestId) return
const templateJson = detail?.templateJson const templateJson = detail?.templateJson
const parsedTemplateJson = typeof templateJson === 'string' const parsedTemplateJson = typeof templateJson === 'string'
? JSON.parse(templateJson) ? JSON.parse(templateJson)
@ -216,7 +221,7 @@ const open = async (type: 'create' | 'update', id?: number) => {
code: detail?.code, code: detail?.code,
isCode: detail?.isCode ?? false, isCode: detail?.isCode ?? false,
name: detail?.name, name: detail?.name,
deviceSpec:detail?.deviceSpec, deviceSpec: detail?.deviceSpec,
description: detail?.description, description: detail?.description,
count: detail?.count, count: detail?.count,
remark: detail?.remark, remark: detail?.remark,
@ -232,7 +237,12 @@ const open = async (type: 'create' | 'update', id?: number) => {
defineExpose({ open }) defineExpose({ open })
const emit = defineEmits(['success']) const emit = defineEmits(['success', 'closed'])
const closeForm = () => {
openRequestId++
emit('closed')
}
const submitForm = async () => { const submitForm = async () => {
await formRef.value.validate() await formRef.value.validate()
@ -245,11 +255,64 @@ const submitForm = async () => {
await CriticalComponentApi.updateCriticalComponent(formData.value) await CriticalComponentApi.updateCriticalComponent(formData.value)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false
emit('success') emit('success')
closeForm()
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
</script> </script>
<style scoped lang="scss"></style>
<style lang="scss" scoped>
.critical-component-panel {
background: #fff;
border-radius: 12px;
box-shadow: var(--el-box-shadow-light);
}
.critical-component-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
}
.critical-component-panel__title {
color: #1f2937;
font-size: 18px;
font-weight: 600;
}
.critical-component-dialog {
max-height: calc(100vh - 220px);
padding: 20px 20px 0;
padding-right: 16px;
overflow-y: auto;
}
.critical-component-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
width: 100%;
padding: 16px 20px 20px;
border-top: 1px solid #ebeef5;
}
@media (max-width: 768px) {
.critical-component-panel__header {
padding: 14px 16px;
}
.critical-component-dialog {
max-height: none;
padding: 16px 16px 0;
overflow-y: visible;
}
.critical-component-footer {
padding: 16px;
}
}
</style>

@ -1,33 +1,62 @@
<template> <template>
<div class="critical-component-page">
<template v-if="!formVisible">
<ContentWrap> <ContentWrap>
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" min-label-width="68px"> <el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" min-label-width="68px">
<el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.code')" prop="code"> <el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.code')" prop="code">
<el-input <el-input
v-model="queryParams.code" :placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderCode')" v-model="queryParams.code"
clearable @keyup.enter="handleQuery" class="!w-240px" /> :placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderCode')"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.name')" prop="name"> <el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.name')" prop="name">
<el-input <el-input
v-model="queryParams.name" :placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderName')" v-model="queryParams.name"
clearable @keyup.enter="handleQuery" class="!w-240px" /> :placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderName')"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.description')" prop="description" v-show="showAllFilters"> <el-form-item
:label="t('EquipmentManagement.EquipmentKeyItems.description')"
prop="description"
v-show="showAllFilters"
>
<el-input <el-input
v-model="queryParams.description" v-model="queryParams.description"
:placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderDescription')" clearable :placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderDescription')"
@keyup.enter="handleQuery" class="!w-240px" /> clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.remark')" prop="remark" v-show="showAllFilters"> <el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.remark')" prop="remark" v-show="showAllFilters">
<el-input <el-input
v-model="queryParams.remark" v-model="queryParams.remark"
:placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderRemark')" clearable :placeholder="t('EquipmentManagement.EquipmentKeyItems.placeholderRemark')"
@keyup.enter="handleQuery" class="!w-240px" /> clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item :label="t('EquipmentManagement.EquipmentKeyItems.createTime')" prop="createTime" v-show="showAllFilters"> <el-form-item
:label="t('EquipmentManagement.EquipmentKeyItems.createTime')"
prop="createTime"
v-show="showAllFilters"
>
<el-date-picker <el-date-picker
v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange" v-model="queryParams.createTime"
:start-placeholder="t('common.startTimeText')" :end-placeholder="t('common.endTimeText')" value-format="YYYY-MM-DD HH:mm:ss"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-220px" /> type="daterange"
:start-placeholder="t('common.startTimeText')"
:end-placeholder="t('common.endTimeText')"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-220px"
/>
</el-form-item> </el-form-item>
<el-form-item v-if="filterCount > 3"> <el-form-item v-if="filterCount > 3">
<el-button type="text" class="text-primary" @click="toggleFilters"> <el-button type="text" class="text-primary" @click="toggleFilters">
@ -49,8 +78,12 @@ v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="datera
{{ t('action.add') }} {{ t('action.add') }}
</el-button> </el-button>
<el-button <el-button
type="danger" plain @click="handleBatchDelete" :disabled="!selectedIds.length" type="danger"
v-hasPermi="['mes:critical-component:delete']"> plain
@click="handleBatchDelete"
:disabled="!selectedIds.length"
v-hasPermi="['mes:critical-component:delete']"
>
<Icon icon="ep:delete" class="mr-5px" /> <Icon icon="ep:delete" class="mr-5px" />
{{ t('EquipmentManagement.EquipmentKeyItems.batchDelete') }} {{ t('EquipmentManagement.EquipmentKeyItems.batchDelete') }}
</el-button> </el-button>
@ -59,8 +92,12 @@ type="danger" plain @click="handleBatchDelete" :disabled="!selectedIds.length"
{{ t('action.import') }} {{ t('action.import') }}
</el-button> </el-button>
<el-button <el-button
type="success" plain @click="handleExport" :loading="exportLoading" type="success"
v-hasPermi="['mes:critical-component:export']"> plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['mes:critical-component:export']"
>
<Icon icon="ep:download" class="mr-5px" /> <Icon icon="ep:download" class="mr-5px" />
{{ t('action.export') }} {{ t('action.export') }}
</el-button> </el-button>
@ -70,42 +107,81 @@ type="success" plain @click="handleExport" :loading="exportLoading"
<ContentWrap> <ContentWrap>
<el-table <el-table
v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" v-loading="loading"
@selection-change="handleSelectionChange"> :data="list"
:stripe="true"
:show-overflow-tooltip="true"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column <el-table-column
:label="t('EquipmentManagement.EquipmentKeyItems.code')" align="center" prop="code" :label="t('EquipmentManagement.EquipmentKeyItems.code')"
min-width="140" sortable /> align="center"
prop="code"
min-width="140"
sortable
/>
<el-table-column <el-table-column
:label="t('EquipmentManagement.EquipmentKeyItems.name')" align="center" prop="name" :label="t('EquipmentManagement.EquipmentKeyItems.name')"
min-width="140" sortable /> align="center"
prop="name"
min-width="140"
sortable
/>
<el-table-column <el-table-column
:label="t('EquipmentManagement.EquipmentKeyItems.deviceSpec')" align="center" prop="deviceSpec" :label="t('EquipmentManagement.EquipmentKeyItems.deviceSpec')"
min-width="140" sortable /> align="center"
prop="deviceSpec"
min-width="140"
sortable
/>
<el-table-column <el-table-column
:label="t('EquipmentManagement.EquipmentKeyItems.description')" align="center" prop="description" :label="t('EquipmentManagement.EquipmentKeyItems.description')"
min-width="180" /> align="center"
prop="description"
min-width="180"
/>
<!-- <el-table-column
:label="t('EquipmentManagement.EquipmentKeyItems.count')"
align="center"
prop="count"
min-width="180"
/>-->
<el-table-column <el-table-column
:label="t('EquipmentManagement.EquipmentKeyItems.count')" align="center" prop="count" :label="t('EquipmentManagement.EquipmentKeyItems.remark')"
min-width="180" /> align="center"
prop="remark"
min-width="180"
/>
<el-table-column <el-table-column
:label="t('EquipmentManagement.EquipmentKeyItems.remark')" align="center" prop="remark" :label="t('EquipmentManagement.EquipmentKeyItems.createTime')"
min-width="180" /> align="center"
prop="createTime"
:formatter="dateFormatter"
width="180"
sortable
/>
<el-table-column <el-table-column
:label="t('EquipmentManagement.EquipmentKeyItems.createTime')" align="center" prop="createTime" :label="t('EquipmentManagement.EquipmentKeyItems.operate')"
:formatter="dateFormatter" width="180" sortable /> align="center"
<el-table-column width="140"
:label="t('EquipmentManagement.EquipmentKeyItems.operate')" align="center" width="140" fixed="right"
fixed="right"> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
link type="primary" @click="openForm('update', scope.row.id)" link
v-hasPermi="['mes:critical-component:update']"> type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['mes:critical-component:update']"
>
{{ t('EquipmentManagement.EquipmentKeyItems.edit') }} {{ t('EquipmentManagement.EquipmentKeyItems.edit') }}
</el-button> </el-button>
<el-button <el-button
link type="danger" @click="handleDelete(scope.row.id)" link
v-hasPermi="['mes:critical-component:delete']"> type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['mes:critical-component:delete']"
>
{{ t('EquipmentManagement.EquipmentKeyItems.delete') }} {{ t('EquipmentManagement.EquipmentKeyItems.delete') }}
</el-button> </el-button>
</template> </template>
@ -113,42 +189,16 @@ link type="danger" @click="handleDelete(scope.row.id)"
</el-table> </el-table>
<Pagination <Pagination
:total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" :total="total"
@pagination="getList" /> v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap> </ContentWrap>
</template>
<CriticalComponentForm ref="formRef" @success="getList" /> <CriticalComponentForm v-else ref="formRef" @success="getList" @closed="formVisible = false" />
<Dialog v-model="importDialogVisible" :title="t('action.import')" width="400">
<el-upload
ref="uploadRef" v-model:file-list="importFileList"
:action="importUrl + '?updateSupport=' + updateSupport" :auto-upload="false" :disabled="importLoading"
:headers="uploadHeaders" :limit="1" :on-error="handleImportError" :on-exceed="handleImportExceed"
:on-success="handleImportSuccess" accept=".xlsx, .xls" drag>
<Icon icon="ep:upload" />
<div class="el-upload__text">
将文件拖到此处或点击上传
</div>
<template #tip>
<div class="el-upload__tip text-center">
<div class="el-upload__tip">
<el-checkbox v-model="updateSupport" />
是否更新已存在的数据
</div> </div>
<span>仅支持 .xlsx, .xls 格式</span>
<el-link
:underline="false" style="font-size: 12px; vertical-align: baseline" type="primary"
@click="importTemplate">
下载导入模板
</el-link>
</div>
</template>
</el-upload>
<template #footer>
<el-button :disabled="importLoading" type="primary" @click="submitImport">{{ t('common.ok') }}</el-button>
<el-button @click="importDialogVisible = false">{{ t('common.cancel') }}</el-button>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -231,8 +281,12 @@ const handleSelectionChange = (rows: CriticalComponentVO[]) => {
} }
const formRef = ref() const formRef = ref()
const openForm = (type: 'create' | 'update', id?: number) => { const formVisible = ref(false)
formRef.value.open(type, id)
const openForm = async (type: 'create' | 'update', id?: number) => {
formVisible.value = true
await nextTick()
formRef.value?.open(type, id)
} }
const openImport = () => { const openImport = () => {
@ -309,7 +363,7 @@ const handleImportSuccess = async (response: any) => {
.join('<br />') .join('<br />')
await ElMessageBox.alert(`以下编码导入失败:<br />${detail}`, t('common.confirmTitle'), { await ElMessageBox.alert(`以下编码导入失败:<br />${detail}`, t('common.confirmTitle'), {
type: 'error', type: 'error',
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true
}) })
} else { } else {
message.success('导入成功') message.success('导入成功')

@ -1,12 +1,17 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="920px"> <div class="device-ledger-panel">
<div class="device-ledger-panel__header">
<div class="device-ledger-panel__title">{{ dialogTitle }}</div>
<el-button text @click="closeForm">
<Icon icon="ep:close" />
</el-button>
</div>
<div class="device-ledger-dialog" v-loading="formLoading || fileUploading" element-loading-text="资料上传中,请稍候">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="110px" label-width="110px"
v-loading="formLoading || fileUploading"
element-loading-text="资料上传中,请稍候"
> >
<el-row :gutter="16"> <el-row :gutter="16">
<!-- <el-col :span="24"> <!-- <el-col :span="24">
@ -239,11 +244,12 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> </div>
<div class="device-ledger-footer">
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
<el-button @click="submitForm" type="primary" :disabled="formLoading || fileUploading">{{ t('common.ok') }}</el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading || fileUploading">{{ t('common.ok') }}</el-button>
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button> </div>
</template> </div>
</Dialog>
<el-dialog v-model="criticalComponentDialogVisible" :title="t('EquipmentManagement.EquipmentLedger.gjTitle')" width="1200px" class="device-ledger-transfer-dialog" <el-dialog v-model="criticalComponentDialogVisible" :title="t('EquipmentManagement.EquipmentLedger.gjTitle')" width="1200px" class="device-ledger-transfer-dialog"
append-to-body> append-to-body>
@ -291,8 +297,8 @@
min-width="140" sortable /> min-width="140" sortable />
<el-table-column :label="t('EquipmentManagement.EquipmentKeyItems.description')" align="center" <el-table-column :label="t('EquipmentManagement.EquipmentKeyItems.description')" align="center"
prop="description" min-width="180" /> prop="description" min-width="180" />
<el-table-column :label="t('EquipmentManagement.EquipmentKeyItems.count')" align="center" prop="count" <!-- <el-table-column :label="t('EquipmentManagement.EquipmentKeyItems.count')" align="center" prop="count"
min-width="180" /> min-width="180" />-->
<el-table-column :label="t('EquipmentManagement.EquipmentKeyItems.remark')" align="center" prop="remark" <el-table-column :label="t('EquipmentManagement.EquipmentKeyItems.remark')" align="center" prop="remark"
min-width="180" /> min-width="180" />
<el-table-column :label="t('EquipmentManagement.EquipmentKeyItems.createTime')" align="center" prop="createTime" <el-table-column :label="t('EquipmentManagement.EquipmentKeyItems.createTime')" align="center" prop="createTime"
@ -395,7 +401,6 @@ const total = ref(0)
const bjTotal = ref(0) const bjTotal = ref(0)
const selectedIds = ref<number[]>([]) const selectedIds = ref<number[]>([])
const bjSelectedIds = ref<number[]>([]) const bjSelectedIds = ref<number[]>([])
const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const fileUploading = ref(false) const fileUploading = ref(false)
@ -744,7 +749,6 @@ const ensureOptionsLoaded = async () => {
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number, defaultDeviceTypeId?: number, defaultDeviceLineId?: number) => { const open = async (type: string, id?: number, defaultDeviceTypeId?: number, defaultDeviceLineId?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
@ -992,7 +996,7 @@ const bjToggleSelection = () => {
} }
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success', 'closed']) // success closed
const submitForm = async () => { const submitForm = async () => {
if (fileUploading.value) { if (fileUploading.value) {
message.warning('资料上传中,请等待上传完成后再提交') message.warning('资料上传中,请等待上传完成后再提交')
@ -1027,7 +1031,7 @@ const submitForm = async () => {
await DeviceLedgerApi.updateDeviceLedger(data) await DeviceLedgerApi.updateDeviceLedger(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false closeForm()
// //
emit('success') emit('success')
} finally { } finally {
@ -1108,6 +1112,10 @@ const setBJDefaultSelections = () => {
const closeForm = () => {
emit('closed')
}
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
fileUploading.value = false fileUploading.value = false
@ -1183,4 +1191,56 @@ const resetForm = () => {
.no-select-all :deep(.el-table__header-wrapper .el-checkbox) { .no-select-all :deep(.el-table__header-wrapper .el-checkbox) {
display: none; display: none;
} }
.device-ledger-panel {
background: #fff;
border-radius: 12px;
box-shadow: var(--el-box-shadow-light);
}
.device-ledger-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
}
.device-ledger-panel__title {
color: #1f2937;
font-size: 18px;
font-weight: 600;
}
.device-ledger-dialog {
max-height: calc(100vh - 220px);
padding: 20px 20px 0;
padding-right: 16px;
overflow-y: auto;
}
.device-ledger-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
width: 100%;
padding: 16px 20px 20px;
border-top: 1px solid #ebeef5;
}
@media (max-width: 768px) {
.device-ledger-panel__header {
padding: 14px 16px;
}
.device-ledger-dialog {
max-height: none;
padding: 16px 16px 0;
overflow-y: visible;
}
.device-ledger-footer {
padding: 16px;
}
}
</style> </style>

File diff suppressed because it is too large Load Diff

@ -1,4 +1,6 @@
<template> <template>
<div class="device-ledger-page">
<template v-if="!formVisible">
<div class="device-ledger-layout"> <div class="device-ledger-layout">
<ContentWrap class="device-ledger-left"> <ContentWrap class="device-ledger-left">
<div class="tree-header"> <div class="tree-header">
@ -238,7 +240,7 @@
<el-button link @click="handleDetail(scope.row.id)"> <el-button link @click="handleDetail(scope.row.id)">
{{ t('EquipmentManagement.EquipmentLedger.detail') }} {{ t('EquipmentManagement.EquipmentLedger.detail') }}
</el-button> </el-button>
<el-button link type="primary" @click="openForm('update', scope.row.id)" <el-button link type="primary" @click="handleEditDetail(scope.row.id)"
v-hasPermi="['mes:device-ledger:update']"> v-hasPermi="['mes:device-ledger:update']">
{{ t('EquipmentManagement.EquipmentLedger.edit') }} {{ t('EquipmentManagement.EquipmentLedger.edit') }}
</el-button> </el-button>
@ -320,9 +322,11 @@
</ContentWrap> </ContentWrap>
</div> </div>
</div> </div>
</template>
<!-- 表单弹窗添加/修改 --> <!-- 表单添加/修改 -->
<DeviceLedgerForm ref="formRef" @success="getList" /> <DeviceLedgerForm v-else ref="formRef" @success="getList" @closed="formVisible = false" />
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -734,6 +738,9 @@ const handleDetail = (id: number) => {
router.push({ name: 'MesDeviceLedgerDetail', params: { id } }) router.push({ name: 'MesDeviceLedgerDetail', params: { id } })
} }
const handleEditDetail = (id: number) => {
router.push({name: 'MesDeviceLedgerEditDetail', params: {id } })
}
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
@ -771,7 +778,10 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const formVisible = ref(false)
const openForm = async (type: string, id?: number) => {
formVisible.value = true
await nextTick()
formRef.value.open(type, id, queryParams.deviceType, selectedDeviceLineId.value) formRef.value.open(type, id, queryParams.deviceType, selectedDeviceLineId.value)
} }

@ -1,11 +1,17 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1200"> <div class="mold-get-panel">
<div class="mold-get-panel__header">
<div class="mold-get-panel__title">{{ dialogTitle }}</div>
<el-button text @click="closeForm">
<Icon icon="ep:close" />
</el-button>
</div>
<div class="mold-get-dialog" v-loading="formLoading">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="110px" label-width="110px"
v-loading="formLoading"
:disabled="disabled" :disabled="disabled"
> >
<el-row :gutter="20"> <el-row :gutter="20">
@ -37,24 +43,6 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8">
<el-form-item label="客户" prop="customerId">
<el-select
v-model="formData.customerId"
clearable
filterable
placeholder="请选择客户"
class="!w-1/1"
>
<el-option
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="8"> <el-col :span="8">
<el-form-item :label="t('MoldManagement.MoldGet.outTimeSingle')" prop="outTime"> <el-form-item :label="t('MoldManagement.MoldGet.outTimeSingle')" prop="outTime">
<el-date-picker <el-date-picker
@ -109,13 +97,15 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap> </ContentWrap>
<template #footer> </div>
<el-button @click="submitForm" type="primary" :disabled="formLoading" v-if="!disabled">
{{ t('action.save') }} <div class="mold-get-footer">
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
<el-button v-if="!disabled" @click="submitForm" type="primary" :disabled="formLoading">
{{ t('common.ok') }}
</el-button> </el-button>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button> </div>
</template> </div>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { StockOutApi, StockOutVO } from '@/api/erp/stock/out' import { StockOutApi, StockOutVO } from '@/api/erp/stock/out'
@ -131,7 +121,6 @@ const { t } = useI18n() // 国际化
const message = useMessage() // const message = useMessage() //
const warehouseList = ref<WarehouseVO[]>([]) // const warehouseList = ref<WarehouseVO[]>([]) //
const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - detail - const formType = ref('') // create - update - detail -
@ -179,7 +168,6 @@ const getTodayTimestamp = () => new Date().setHours(0, 0, 0, 0)
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
@ -204,8 +192,12 @@ const open = async (type: string, id?: number) => {
} }
defineExpose({ open }) // open defineExpose({ open }) // open
const closeForm = () => {
emit('closed')
}
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success', 'closed']) // success closed
const submitForm = async () => { const submitForm = async () => {
// //
await formRef.value.validate() await formRef.value.validate()
@ -252,7 +244,7 @@ const submitForm = async () => {
await StockOutApi.updateStockOut(data) await StockOutApi.updateStockOut(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false closeForm()
// //
emit('success') emit('success')
} finally { } finally {
@ -275,3 +267,57 @@ const resetForm = () => {
} }
} }
</script> </script>
<style lang="scss" scoped>
.mold-get-panel {
background: #fff;
border-radius: 12px;
box-shadow: var(--el-box-shadow-light);
}
.mold-get-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
}
.mold-get-panel__title {
color: #1f2937;
font-size: 18px;
font-weight: 600;
}
.mold-get-dialog {
max-height: calc(100vh - 220px);
padding: 20px 20px 0;
padding-right: 16px;
overflow-y: auto;
}
.mold-get-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
width: 100%;
padding: 16px 20px 20px;
border-top: 1px solid #ebeef5;
}
@media (max-width: 768px) {
.mold-get-panel__header {
padding: 14px 16px;
}
.mold-get-dialog {
max-height: none;
padding: 16px 16px 0;
overflow-y: visible;
}
.mold-get-footer {
padding: 16px;
}
}
</style>

@ -1,5 +1,7 @@
<template> <template>
<div class="mold-get-page">
<template v-if="!formVisible">
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
@ -260,9 +262,11 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
</template>
<!-- 表单弹窗添加/修改 --> <!-- 表单添加/修改 -->
<MoldGetForm ref="formRef" @success="getList" /> <MoldGetForm v-else ref="formRef" @success="getList" @closed="formVisible = false" />
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -340,8 +344,12 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const formVisible = ref(false)
formRef.value.open(type, id)
const openForm = async (type: string, id?: number) => {
formVisible.value = true
await nextTick()
formRef.value?.open(type, id)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

@ -1,11 +1,17 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1200"> <div class="mold-return-panel">
<div class="mold-return-panel__header">
<div class="mold-return-panel__title">{{ dialogTitle }}</div>
<el-button text @click="closeForm">
<Icon icon="ep:close" />
</el-button>
</div>
<div class="mold-return-dialog" v-loading="formLoading">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="110px" label-width="110px"
v-loading="formLoading"
:disabled="disabled" :disabled="disabled"
> >
<el-row :gutter="20"> <el-row :gutter="20">
@ -91,13 +97,15 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</ContentWrap> </ContentWrap>
<template #footer> </div>
<el-button @click="submitForm" type="primary" :disabled="formLoading" v-if="!disabled">
{{ t('action.save') }} <div class="mold-return-footer">
<el-button @click="closeForm">{{ t('common.cancel') }}</el-button>
<el-button v-if="!disabled" @click="submitForm" type="primary" :disabled="formLoading">
{{ t('common.ok') }}
</el-button> </el-button>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button> </div>
</template> </div>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { StockInApi, StockInVO } from '@/api/erp/stock/in' import { StockInApi, StockInVO } from '@/api/erp/stock/in'
@ -112,7 +120,6 @@ const { t } = useI18n() // 国际化
const message = useMessage() // const message = useMessage() //
const warehouseList = ref<WarehouseVO[]>([]) // const warehouseList = ref<WarehouseVO[]>([]) //
const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - detail - const formType = ref('') // create - update - detail -
@ -160,7 +167,6 @@ const getTodayTimestamp = () => new Date().setHours(0, 0, 0, 0)
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
@ -185,8 +191,12 @@ const open = async (type: string, id?: number) => {
} }
defineExpose({ open }) // open defineExpose({ open }) // open
const closeForm = () => {
emit('closed')
}
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success', 'closed']) // success closed
const submitForm = async () => { const submitForm = async () => {
// //
await formRef.value.validate() await formRef.value.validate()
@ -233,7 +243,7 @@ const submitForm = async () => {
await StockInApi.updateStockIn(data) await StockInApi.updateStockIn(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false closeForm()
// //
emit('success') emit('success')
} finally { } finally {
@ -256,3 +266,57 @@ const resetForm = () => {
} }
} }
</script> </script>
<style lang="scss" scoped>
.mold-return-panel {
background: #fff;
border-radius: 12px;
box-shadow: var(--el-box-shadow-light);
}
.mold-return-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
}
.mold-return-panel__title {
color: #1f2937;
font-size: 18px;
font-weight: 600;
}
.mold-return-dialog {
max-height: calc(100vh - 220px);
padding: 20px 20px 0;
padding-right: 16px;
overflow-y: auto;
}
.mold-return-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
width: 100%;
padding: 16px 20px 20px;
border-top: 1px solid #ebeef5;
}
@media (max-width: 768px) {
.mold-return-panel__header {
padding: 14px 16px;
}
.mold-return-dialog {
max-height: none;
padding: 16px 16px 0;
overflow-y: visible;
}
.mold-return-footer {
padding: 16px;
}
}
</style>

@ -1,4 +1,7 @@
<template> <template>
<div class="mold-return-page">
<template v-if="!formVisible">
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
@ -257,9 +260,11 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
</template>
<!-- 表单弹窗添加/修改 --> <!-- 表单添加/修改 -->
<MoldReturnForm ref="formRef" @success="getList" /> <MoldReturnForm v-else ref="formRef" @success="getList" @closed="formVisible = false" />
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -335,8 +340,12 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type: string, id?: number) => { const formVisible = ref(false)
formRef.value.open(type, id)
const openForm = async (type: string, id?: number) => {
formVisible.value = true
await nextTick()
formRef.value?.open(type, id)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

@ -1,5 +1,39 @@
<template> <template>
<Dialog v-model="dialogVisible" :title="t('SystemManagement.Role.menuPermission')"> <el-drawer
v-model="dialogVisible"
:with-header="false"
append-to-body
class="role-permission-drawer"
direction="rtl"
size="640px"
>
<div class="role-permission-drawer__shell">
<div class="role-permission-drawer__header">
<div class="role-permission-drawer__title">
<el-button text circle class="role-permission-drawer__close" @click="dialogVisible = false">
<Icon icon="ep:close" />
</el-button>
<span>{{ t('SystemManagement.Role.menuPermission') }}</span>
</div>
<el-dropdown trigger="click">
<el-button>
更多操作
<Icon icon="ep:arrow-down" class="ml-4px" />
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="handleCheckedTreeNodeAll">
{{ t('SystemManagement.Role.selectAll') }}
</el-dropdown-item>
<el-dropdown-item @click="handleCheckedTreeExpand">
{{ t('SystemManagement.Role.expandCollapse') }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<div class="role-permission-drawer__body">
<el-form <el-form
ref="formRef" ref="formRef"
v-loading="formLoading" v-loading="formLoading"
@ -7,15 +41,17 @@
label-width="auto" label-width="auto"
class="role-assign-menu-form" class="role-assign-menu-form"
> >
<el-form-item :label="t('SystemManagement.Role.name')"> <div class="role-assign-menu-form__meta-row">
<el-form-item :label="t('SystemManagement.Role.name')" class="role-assign-menu-form__meta">
<el-tag>{{ formData.name }}</el-tag> <el-tag>{{ formData.name }}</el-tag>
</el-form-item> </el-form-item>
<el-form-item :label="t('SystemManagement.Role.code')"> <el-form-item :label="t('SystemManagement.Role.code')" class="role-assign-menu-form__meta">
<el-tag>{{ formData.code }}</el-tag> <el-tag>{{ formData.code }}</el-tag>
</el-form-item> </el-form-item>
<el-form-item :label="t('SystemManagement.Role.menuPermission')"> </div>
<el-card class="w-full h-400px !overflow-y-scroll" shadow="never"> <el-form-item label-width="0" class="role-assign-menu-form__permission">
<template #header> <div class="role-permission-tree-panel">
<div class="role-permission-tree-panel__title">所拥有的权限</div>
<div class="role-assign-menu-form__header"> <div class="role-assign-menu-form__header">
<el-tabs v-model="activeClientType" @tab-change="handleClientTypeChange"> <el-tabs v-model="activeClientType" @tab-change="handleClientTypeChange">
<el-tab-pane :label="t('SystemManagement.Menu.clientTypeWeb')" :name="1" /> <el-tab-pane :label="t('SystemManagement.Menu.clientTypeWeb')" :name="1" />
@ -40,23 +76,27 @@
/> />
</div> </div>
</div> </div>
</template>
<el-tree <el-tree
ref="treeRef" ref="treeRef"
class="role-permission-tree"
:data="menuOptions" :data="menuOptions"
:props="defaultProps" :props="defaultProps"
:empty-text="t('SystemManagement.Role.loadingText')" :empty-text="t('SystemManagement.Role.loadingText')"
node-key="id" node-key="id"
show-checkbox show-checkbox
/> />
</el-card> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> </div>
<el-button :disabled="formLoading" type="primary" @click="submitForm">{{ t('common.ok') }}</el-button>
<div class="role-permission-drawer__footer">
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button> <el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button>
</template> <el-button :disabled="formLoading" @click="submitForm"></el-button>
</Dialog> <el-button :disabled="formLoading" type="primary" @click="submitForm"></el-button>
</div>
</div>
</el-drawer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { defaultProps, handleTree } from '@/utils/tree' import { defaultProps, handleTree } from '@/utils/tree'
@ -231,25 +271,182 @@ const handleCheckedTreeExpand = () => {
</script> </script>
<style scoped> <style scoped>
.role-permission-drawer :deep(.el-drawer__body) {
padding: 0;
overflow: hidden;
}
.role-permission-drawer__shell {
display: flex;
flex-direction: column;
height: 100%;
background: var(--el-bg-color);
}
.role-permission-drawer__header {
display: flex;
align-items: center;
justify-content: space-between;
flex: 0 0 74px;
padding: 0 24px 0 16px;
box-sizing: border-box;
border-bottom: 1px solid var(--el-border-color-lighter);
}
.role-permission-drawer__title {
display: flex;
align-items: center;
min-width: 0;
color: var(--el-text-color-primary);
font-size: 16px;
font-weight: 600;
}
.role-permission-drawer__close {
margin-right: 10px;
color: var(--el-text-color-secondary);
}
.role-permission-drawer__body {
flex: 1;
min-height: 0;
overflow: auto;
padding: 24px 18px 92px;
box-sizing: border-box;
}
.role-permission-drawer__footer {
position: absolute;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
display: flex;
justify-content: flex-end;
gap: 10px;
padding: 14px 18px;
box-sizing: border-box;
border-top: 1px solid var(--el-border-color-lighter);
background: var(--el-bg-color);
}
.role-assign-menu-form :deep(.el-form-item__label) { .role-assign-menu-form :deep(.el-form-item__label) {
min-width: 80px; min-width: 80px;
} }
.role-assign-menu-form__meta-row {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 16px;
margin-bottom: 16px;
}
.role-assign-menu-form__meta {
margin-bottom: 0;
}
.role-assign-menu-form__meta :deep(.el-form-item__content) {
min-width: 0;
}
.role-assign-menu-form__meta :deep(.el-tag) {
max-width: 100%;
height: 28px;
overflow: hidden;
border-color: var(--el-border-color-lighter);
background: var(--el-fill-color-extra-light);
color: var(--el-text-color-primary);
line-height: 26px;
text-overflow: ellipsis;
white-space: nowrap;
}
.role-assign-menu-form__permission {
margin-top: 6px;
margin-bottom: 0;
}
.role-permission-tree-panel {
width: 100%;
}
.role-permission-tree-panel__title {
margin-bottom: 22px;
color: var(--el-text-color-primary);
font-size: 16px;
line-height: 24px;
}
.role-assign-menu-form__header { .role-assign-menu-form__header {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 16px; gap: 16px;
margin-bottom: 12px;
} }
.role-assign-menu-form__header :deep(.el-tabs__header) { .role-assign-menu-form__header :deep(.el-tabs__header) {
margin: 0; margin: 0;
} }
.role-assign-menu-form__header :deep(.el-tabs__nav-wrap::after) {
display: none;
}
.role-assign-menu-form__actions { .role-assign-menu-form__actions {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
flex-wrap: wrap; flex-wrap: wrap;
} }
.role-permission-tree {
--el-tree-node-hover-bg-color: transparent;
color: var(--el-text-color-primary);
font-size: 14px;
}
.role-permission-tree :deep(.el-tree-node__content) {
height: 28px;
padding-right: 8px;
}
.role-permission-tree :deep(.el-tree-node__expand-icon) {
color: var(--el-text-color-primary);
font-size: 12px;
}
.role-permission-tree :deep(.el-checkbox) {
height: 18px;
margin-right: 8px;
}
.role-permission-tree :deep(.el-checkbox__inner) {
width: 16px;
height: 16px;
border-radius: 4px;
}
.role-permission-tree :deep(.el-tree-node__label) {
line-height: 22px;
}
@media (max-width: 768px) {
.role-permission-drawer :deep(.el-drawer) {
width: 100% !important;
}
.role-permission-drawer__header {
padding-right: 14px;
}
.role-permission-drawer__body {
padding-right: 14px;
padding-left: 14px;
}
.role-assign-menu-form__meta-row {
grid-template-columns: 1fr;
}
}
</style> </style>

Loading…
Cancel
Save