|
|
|
|
@ -19,14 +19,14 @@
|
|
|
|
|
<el-form-item prop="keyword">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.keyword"
|
|
|
|
|
placeholder="请输入编码/名称/产品型号"
|
|
|
|
|
:placeholder="t('MoldManagement.MoldBrandPage.placeholderKeyword')"
|
|
|
|
|
clearable
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item prop="status">
|
|
|
|
|
<el-select v-model="queryParams.status" placeholder="模具状态" clearable class="!w-180px">
|
|
|
|
|
<el-select v-model="queryParams.status" :placeholder="t('MoldManagement.MoldBrandPage.placeholderStatus')" clearable class="!w-180px">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in statusOptions"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
@ -36,12 +36,12 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item prop="productId">
|
|
|
|
|
<el-select v-model="queryParams.productId" placeholder="产品型号" clearable filterable class="!w-180px">
|
|
|
|
|
<el-select v-model="queryParams.productId" :placeholder="t('MoldManagement.MoldBrandPage.placeholderProduct')" clearable filterable class="!w-180px">
|
|
|
|
|
<el-option v-for="product in productOptions" :key="product.id" :label="product.name" :value="product.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item prop="currentDevice">
|
|
|
|
|
<el-select v-model="queryParams.currentDevice" placeholder="当前设备" clearable filterable class="!w-180px">
|
|
|
|
|
<el-select v-model="queryParams.currentDevice" :placeholder="t('MoldManagement.MoldBrandPage.placeholderDevice')" clearable filterable class="!w-180px">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="device in deviceOptions"
|
|
|
|
|
:key="device.id"
|
|
|
|
|
@ -51,19 +51,19 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="resetQuery">重置</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleQuery">查询</el-button>
|
|
|
|
|
<el-button @click="resetQuery">{{ t('MoldManagement.MoldBrandPage.reset') }}</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleQuery">{{ t('MoldManagement.MoldBrandPage.query') }}</el-button>
|
|
|
|
|
<el-button type="primary" plain @click="openForm('create')" v-hasPermi="['erp:mold-brand:create']">
|
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> {{ t('MoldManagement.MoldBrandPage.add') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="success" plain @click="handleExport" :loading="exportLoading" v-hasPermi="['erp:mold-brand:export']">
|
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> {{ t('MoldManagement.MoldBrandPage.export') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" row-key="id">
|
|
|
|
|
<el-table-column label="图片" align="center" width="92">
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" row-key="id" style="margin-top: 16px;">
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.image')" align="center" width="92">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-image
|
|
|
|
|
v-if="getImageList(scope.row.images).length"
|
|
|
|
|
@ -76,31 +76,31 @@
|
|
|
|
|
<span v-else class="mold-brand-page__empty">-</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="编码" prop="code" min-width="150" sortable />
|
|
|
|
|
<el-table-column label="名称" prop="name" min-width="160" sortable />
|
|
|
|
|
<el-table-column label="产品型号" prop="productName" min-width="140" />
|
|
|
|
|
<el-table-column label="版本" prop="version" width="100" />
|
|
|
|
|
<el-table-column label="状态" prop="status" width="100" align="center">
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.code')" prop="code" min-width="150" sortable />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.name')" prop="name" min-width="160" sortable />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.productName')" prop="productName" min-width="140" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.version')" prop="version" width="100" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.status')" prop="status" width="100" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ERP_MOLD_STATUS" :value="scope.row.status" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="当前设备" min-width="140">
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.currentDevice')" min-width="140">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ scope.row.currentDevice || scope.row.machineName || '-' }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="子模数" prop="moldSize" width="90" align="center" />
|
|
|
|
|
<el-table-column label="创建时间" prop="createTime" :formatter="dateFormatter" width="180" sortable />
|
|
|
|
|
<el-table-column label="操作" fixed="right" min-width="240">
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.moldSize')" prop="moldSize" width="90" align="center" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.createTime')" prop="createTime" :formatter="dateFormatter" width="180" sortable />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.operate')" fixed="right" min-width="240">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button link type="primary" @click="openDetail(scope.row.id)">详情</el-button>
|
|
|
|
|
<el-button link type="primary" @click="openOperateForm(1, scope.row)">上模</el-button>
|
|
|
|
|
<el-button link type="primary" @click="openOperateForm(2, scope.row)">下模</el-button>
|
|
|
|
|
<el-button link type="warning" @click="handleReservedAction('维修')">维修</el-button>
|
|
|
|
|
<el-button link type="primary" @click="previewQrcode(scope.row)">二维码</el-button>
|
|
|
|
|
<el-button link type="primary" @click="openForm('update', scope.row.id)" v-hasPermi="['erp:mold-brand:update']">编辑</el-button>
|
|
|
|
|
<el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['erp:mold-brand:delete']">删除</el-button>
|
|
|
|
|
<el-button link type="primary" @click="openDetail(scope.row.id)">{{ t('MoldManagement.MoldBrandPage.detail') }}</el-button>
|
|
|
|
|
<el-button link type="primary" @click="openOperateForm(1, scope.row)">{{ t('MoldManagement.MoldBrandPage.moldUp') }}</el-button>
|
|
|
|
|
<el-button link type="primary" @click="openOperateForm(2, scope.row)">{{ t('MoldManagement.MoldBrandPage.moldDown') }}</el-button>
|
|
|
|
|
<el-button link type="warning" @click="handleReservedAction(t('MoldManagement.MoldBrandPage.repair'))">{{ t('MoldManagement.MoldBrandPage.repair') }}</el-button>
|
|
|
|
|
<el-button link type="primary" @click="previewQrcode(scope.row)">{{ t('MoldManagement.MoldBrandPage.qrcode') }}</el-button>
|
|
|
|
|
<el-button link type="primary" @click="openForm('update', scope.row.id)" v-hasPermi="['erp:mold-brand:update']">{{ t('MoldManagement.MoldBrandPage.edit') }}</el-button>
|
|
|
|
|
<el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['erp:mold-brand:delete']">{{ t('MoldManagement.MoldBrandPage.delete') }}</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
@ -117,16 +117,16 @@
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div class="mold-operate-page">
|
|
|
|
|
<div class="mold-operate-page__header">
|
|
|
|
|
<el-button @click="closeOperateForm"><Icon icon="ep:arrow-left" class="mr-5px" /> 返回</el-button>
|
|
|
|
|
<el-button @click="closeOperateForm"><Icon icon="ep:arrow-left" class="mr-5px" /> {{ t('MoldManagement.MoldBrandPage.back') }}</el-button>
|
|
|
|
|
<div class="mold-operate-page__tabs">
|
|
|
|
|
<el-button
|
|
|
|
|
:type="operateType === 1 ? 'primary' : ''"
|
|
|
|
|
@click="switchOperateType(1)"
|
|
|
|
|
>上模</el-button>
|
|
|
|
|
>{{ t('MoldManagement.MoldBrandPage.moldUp') }}</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
:type="operateType === 2 ? 'primary' : ''"
|
|
|
|
|
@click="switchOperateType(2)"
|
|
|
|
|
>下模</el-button>
|
|
|
|
|
>{{ t('MoldManagement.MoldBrandPage.moldDown') }}</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@ -140,31 +140,31 @@
|
|
|
|
|
/>
|
|
|
|
|
<div class="mold-operate-page__info-empty" v-else></div>
|
|
|
|
|
<div class="mold-operate-page__info-item">
|
|
|
|
|
<span class="mold-operate-page__info-label">模具编码</span>
|
|
|
|
|
<span class="mold-operate-page__info-label">{{ t('MoldManagement.MoldBrandPage.moldCode') }}</span>
|
|
|
|
|
<span class="mold-operate-page__info-value">{{ currentMold.code }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mold-operate-page__info-item">
|
|
|
|
|
<span class="mold-operate-page__info-label">模具名称</span>
|
|
|
|
|
<span class="mold-operate-page__info-label">{{ t('MoldManagement.MoldBrandPage.moldName') }}</span>
|
|
|
|
|
<span class="mold-operate-page__info-value">{{ currentMold.name }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mold-operate-page__info-item">
|
|
|
|
|
<span class="mold-operate-page__info-label">产品型号</span>
|
|
|
|
|
<span class="mold-operate-page__info-label">{{ t('MoldManagement.MoldBrandPage.productName') }}</span>
|
|
|
|
|
<span class="mold-operate-page__info-value">{{ currentMold.productName }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mold-operate-page__info-item">
|
|
|
|
|
<span class="mold-operate-page__info-label">子模数</span>
|
|
|
|
|
<span class="mold-operate-page__info-label">{{ t('MoldManagement.MoldBrandPage.moldSize') }}</span>
|
|
|
|
|
<span class="mold-operate-page__info-value">{{ currentMold.moldSize }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mold-operate-page__info-item">
|
|
|
|
|
<span class="mold-operate-page__info-label">当前状态</span>
|
|
|
|
|
<span class="mold-operate-page__info-label">{{ t('MoldManagement.MoldBrandPage.status') }}</span>
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ERP_MOLD_STATUS" :value="currentMold.status" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mold-operate-page__info-item">
|
|
|
|
|
<span class="mold-operate-page__info-label">当前设备</span>
|
|
|
|
|
<span class="mold-operate-page__info-label">{{ t('MoldManagement.MoldBrandPage.currentDevice') }}</span>
|
|
|
|
|
<span class="mold-operate-page__info-value">{{ currentMold.currentDevice || '-' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mold-operate-page__info-item">
|
|
|
|
|
<span class="mold-operate-page__info-label">上次更换时间</span>
|
|
|
|
|
<span class="mold-operate-page__info-label">{{ t('MoldManagement.MoldBrandPage.lastChangeTime') }}</span>
|
|
|
|
|
<span class="mold-operate-page__info-value">{{ currentMold.lastChangeTime ? dateFormatter(currentMold.lastChangeTime) : '-' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -173,82 +173,79 @@
|
|
|
|
|
<!-- 左侧表单 -->
|
|
|
|
|
<div class="mold-operate-page__form">
|
|
|
|
|
<el-form ref="operateFormRef" :model="operateFormData" :rules="operateFormRules" label-width="100px">
|
|
|
|
|
<el-form-item label="目标产线" prop="targetLine">
|
|
|
|
|
<el-select v-model="operateFormData.targetLine" filterable clearable placeholder="请选择产线" class="!w-full">
|
|
|
|
|
<el-form-item :label="t('MoldManagement.MoldBrandPage.targetLine')" prop="lineId">
|
|
|
|
|
<el-select v-model="operateFormData.lineId" filterable clearable :placeholder="t('MoldManagement.MoldBrandPage.placeholderTargetLine')" class="!w-full">
|
|
|
|
|
<el-option v-for="line in lineOptions" :key="line.id" :label="line.name" :value="String(line.id)" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="目标设备" prop="deviceId">
|
|
|
|
|
<el-select v-model="operateFormData.deviceId" filterable clearable placeholder="请选择设备" class="!w-full">
|
|
|
|
|
<el-form-item :label="t('MoldManagement.MoldBrandPage.targetDevice')" prop="deviceId">
|
|
|
|
|
<el-select v-model="operateFormData.deviceId" filterable clearable :placeholder="t('MoldManagement.MoldBrandPage.placeholderTargetDevice')" class="!w-full">
|
|
|
|
|
<el-option v-for="device in deviceOptions" :key="device.id" :label="`${device.deviceName}(${device.deviceCode})`" :value="device.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="模具" prop="moldId" v-if="operateType === 1">
|
|
|
|
|
<el-select v-model="operateFormData.moldId" clearable filterable placeholder="请选择模具" class="!w-full">
|
|
|
|
|
<el-option v-for="item in moldList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="操作时间" prop="operateTime">
|
|
|
|
|
<el-date-picker v-model="operateFormData.operateTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间" class="!w-full" />
|
|
|
|
|
<el-form-item :label="t('MoldManagement.MoldBrandPage.operateTime')" prop="operateTime">
|
|
|
|
|
<el-date-picker v-model="operateFormData.operateTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" :placeholder="t('MoldManagement.MoldBrandPage.placeholderOperateTime')" class="!w-full" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="操作人" prop="operatorId">
|
|
|
|
|
<el-select v-model="operateFormData.operatorId" filterable clearable placeholder="请选择操作人" class="!w-full">
|
|
|
|
|
<el-form-item :label="t('MoldManagement.MoldBrandPage.operator')" prop="operatorId">
|
|
|
|
|
<el-select v-model="operateFormData.operatorId" filterable clearable :placeholder="t('MoldManagement.MoldBrandPage.placeholderOperator')" class="!w-full">
|
|
|
|
|
<el-option v-for="item in operatorOptions" :key="String(item.id)" :label="item.nickname" :value="String(item.id)" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
<el-input v-model="operateFormData.remark" placeholder="请输入备注(选填)" type="textarea" :rows="3" />
|
|
|
|
|
<el-form-item :label="t('MoldManagement.MoldBrandPage.remark')" prop="remark">
|
|
|
|
|
<el-input v-model="operateFormData.remark" :placeholder="t('MoldManagement.MoldBrandPage.placeholderRemark')" type="textarea" :rows="3" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div class="mold-operate-page__form-actions">
|
|
|
|
|
<el-button @click="closeOperateForm">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitOperateForm" :loading="operateLoading">提交</el-button>
|
|
|
|
|
<el-button @click="closeOperateForm">{{ t('MoldManagement.MoldBrandPage.cancel') }}</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitOperateForm" :loading="operateLoading">{{ t('MoldManagement.MoldBrandPage.submit') }}</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 右侧记录列表 -->
|
|
|
|
|
<div class="mold-operate-page__history">
|
|
|
|
|
<div class="mold-operate-page__history-header">
|
|
|
|
|
<span class="mold-operate-page__history-title">最近上下模记录</span>
|
|
|
|
|
<span class="mold-operate-page__history-title">{{ t('MoldManagement.MoldBrandPage.recentRecords') }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="recentOperateList" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
<el-table-column label="操作类型" width="100">
|
|
|
|
|
<el-table :data="recentOperateList" :stripe="true" :show-overflow-tooltip="true" v-loading="recentLoading">
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.operateType')">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span :class="scope.row.operateType === 1 ? 'text-primary' : 'text-success'">
|
|
|
|
|
{{ scope.row.operateType === 1 ? '安装(上模)' : '拆卸(下模)' }}
|
|
|
|
|
<span :class="scope.row.operateType === '1' ? 'text-primary' : 'text-success'">
|
|
|
|
|
{{ scope.row.operateType === '1' ? t('MoldManagement.MoldBrandPage.installUp') : t('MoldManagement.MoldBrandPage.uninstallDown') }}
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="模具编码" prop="moldCode" width="140" />
|
|
|
|
|
<el-table-column label="操作时间" prop="createTime" width="160" :formatter="dateFormatter" />
|
|
|
|
|
<el-table-column label="操作人" prop="creatorName" width="100" />
|
|
|
|
|
<el-table-column label="状态" width="80" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ERP_MOLD_STATUS" :value="scope.row.status" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.moldName')" prop="moldName" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.lineName')" prop="lineName" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.operateTime')" prop="createTime" width="160" :formatter="dateFormatter" />
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldBrandPage.operator')" prop="operatorName" width="100" />
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-empty v-if="!recentOperateList.length" description="暂无操作记录" />
|
|
|
|
|
<el-empty v-if="!recentOperateList.length" :description="t('MoldManagement.MoldBrandPage.noRecords')" />
|
|
|
|
|
<Pagination
|
|
|
|
|
:total="recentTotal"
|
|
|
|
|
v-model:page="recentPageNo"
|
|
|
|
|
v-model:limit="recentPageSize"
|
|
|
|
|
@pagination="fetchRecentOperateList"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
<Dialog v-model="qrcodeVisible" title="模具二维码" width="360px">
|
|
|
|
|
<Dialog v-model="qrcodeVisible" :title="t('MoldManagement.MoldBrandPage.qrcodeDialogTitle')" width="360px">
|
|
|
|
|
<QrcodeActionCard
|
|
|
|
|
:image-url="currentQrcodeRow?.qrCodeUrl"
|
|
|
|
|
:print-id="currentQrcodeRow?.id"
|
|
|
|
|
:print-template-type="4"
|
|
|
|
|
:print-title="`${currentQrcodeRow?.name || '模具'}码打印预览`"
|
|
|
|
|
:print-title="t('MoldManagement.MoldBrandPage.qrcodePrintTitle', { name: currentQrcodeRow?.name || t('MoldManagement.MoldBrandPage.mold') })"
|
|
|
|
|
:print-paper-width="80"
|
|
|
|
|
:print-paper-height="80"
|
|
|
|
|
:print-max-width="220"
|
|
|
|
|
empty-text="暂无二维码"
|
|
|
|
|
error-text="二维码加载失败"
|
|
|
|
|
:empty-text="t('MoldManagement.MoldBrandPage.qrcodeEmpty')"
|
|
|
|
|
:error-text="t('MoldManagement.MoldBrandPage.qrcodeLoadError')"
|
|
|
|
|
:refresh-url="getQrcodeRefreshUrl()"
|
|
|
|
|
:refresh-disabled="!currentQrcodeRow?.id || !currentQrcodeRow?.code"
|
|
|
|
|
refresh-confirm-text="确认刷新该模具二维码吗?"
|
|
|
|
|
:refresh-confirm-text="t('MoldManagement.MoldBrandPage.qrcodeRefreshConfirm')"
|
|
|
|
|
@refresh-success="handleQrcodeRefreshSuccess"
|
|
|
|
|
/>
|
|
|
|
|
</Dialog>
|
|
|
|
|
@ -259,7 +256,7 @@
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { defineAsyncComponent } from 'vue'
|
|
|
|
|
import { ProductApi, type ProductVO } from '@/api/erp/product/product'
|
|
|
|
|
import { MoldBrandApi, type MoldBrandVO, type MoldVO } from '@/api/erp/mold'
|
|
|
|
|
import { MoldBrandApi, type MoldBrandVO } from '@/api/erp/mold'
|
|
|
|
|
import { DeviceLedgerApi, type DeviceLedgerVO } from '@/api/mes/deviceledger'
|
|
|
|
|
import { MoldOperateApi, type MoldOperateVO } from '@/api/mes/moldoperate'
|
|
|
|
|
import { OrganizationApi, type OrganizationVO } from '@/api/mes/organization'
|
|
|
|
|
@ -271,6 +268,7 @@ import QrcodeActionCard from '@/components/QrcodeActionCard/index.vue'
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'MoldBrand' })
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
const message = useMessage()
|
|
|
|
|
const { push } = useRouter()
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
@ -313,11 +311,14 @@ const currentMold = ref<MoldBrandVO | null>(null)
|
|
|
|
|
const operateLoading = ref(false)
|
|
|
|
|
const operateFormRef = ref()
|
|
|
|
|
const recentOperateList = ref<MoldOperateVO[]>([])
|
|
|
|
|
const recentPageNo = ref(1)
|
|
|
|
|
const recentPageSize = ref(5)
|
|
|
|
|
const recentTotal = ref(0)
|
|
|
|
|
const recentLoading = ref(false)
|
|
|
|
|
|
|
|
|
|
// 表单数据
|
|
|
|
|
const operateFormData = reactive({
|
|
|
|
|
moldId: undefined as number | undefined,
|
|
|
|
|
targetLine: undefined as string | undefined,
|
|
|
|
|
lineId: undefined as string | undefined,
|
|
|
|
|
deviceId: undefined as number | undefined,
|
|
|
|
|
operateTime: undefined as string | undefined,
|
|
|
|
|
operatorId: undefined as string | undefined,
|
|
|
|
|
@ -326,24 +327,22 @@ const operateFormData = reactive({
|
|
|
|
|
|
|
|
|
|
// 表单验证规则
|
|
|
|
|
const operateFormRules = reactive({
|
|
|
|
|
moldId: [{ required: true, message: '请选择模具', trigger: 'blur' }],
|
|
|
|
|
targetLine: [{ required: true, message: '请选择目标产线', trigger: 'blur' }],
|
|
|
|
|
deviceId: [{ required: true, message: '请选择目标设备', trigger: 'blur' }],
|
|
|
|
|
operateTime: [{ required: true, message: '请选择操作时间', trigger: 'blur' }],
|
|
|
|
|
operatorId: [{ required: true, message: '请选择操作人', trigger: 'blur' }]
|
|
|
|
|
lineId: [{ required: true, message: t('MoldManagement.MoldBrandPage.validatorTargetLineRequired'), trigger: 'blur' }],
|
|
|
|
|
deviceId: [{ required: true, message: t('MoldManagement.MoldBrandPage.validatorTargetDeviceRequired'), trigger: 'blur' }],
|
|
|
|
|
operateTime: [{ required: true, message: t('MoldManagement.MoldBrandPage.validatorOperateTimeRequired'), trigger: 'blur' }],
|
|
|
|
|
operatorId: [{ required: true, message: t('MoldManagement.MoldBrandPage.validatorOperatorRequired'), trigger: 'blur' }]
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 下拉选项
|
|
|
|
|
const lineOptions = ref<OrganizationVO[]>([])
|
|
|
|
|
const operatorOptions = ref<UserVO[]>([])
|
|
|
|
|
const moldList = ref<MoldVO[]>([])
|
|
|
|
|
|
|
|
|
|
const statusCards = computed(() => [
|
|
|
|
|
{ key: 'all', label: '全部', value: counters.allCount, status: undefined },
|
|
|
|
|
{ key: 'onMachine', label: '在机', value: counters.onMachineCount, status: 1 },
|
|
|
|
|
{ key: 'standby', label: '待用', value: counters.standbyCount, status: 0 },
|
|
|
|
|
{ key: 'repairing', label: '维修', value: counters.repairingCount, status: 2 },
|
|
|
|
|
{ key: 'scrapped', label: '报废', value: counters.scrappedCount, status: 3 }
|
|
|
|
|
{ key: 'all', label: t('MoldManagement.MoldBrandPage.all'), value: counters.allCount, status: undefined },
|
|
|
|
|
{ key: 'onMachine', label: t('MoldManagement.MoldBrandPage.onMachine'), value: counters.onMachineCount, status: 1 },
|
|
|
|
|
{ key: 'standby', label: t('MoldManagement.MoldBrandPage.standby'), value: counters.standbyCount, status: 0 },
|
|
|
|
|
{ key: 'repairing', label: t('MoldManagement.MoldBrandPage.repairing'), value: counters.repairingCount, status: 2 },
|
|
|
|
|
{ key: 'scrapped', label: t('MoldManagement.MoldBrandPage.scrapped'), value: counters.scrappedCount, status: 3 }
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const parseKeyword = () => {
|
|
|
|
|
@ -413,7 +412,7 @@ const handleDelete = async (id: number) => {
|
|
|
|
|
try {
|
|
|
|
|
await message.delConfirm()
|
|
|
|
|
await MoldBrandApi.deleteMoldBrand(id)
|
|
|
|
|
message.success('删除成功')
|
|
|
|
|
message.success(t('common.delSuccess'))
|
|
|
|
|
await getList()
|
|
|
|
|
} catch {}
|
|
|
|
|
}
|
|
|
|
|
@ -424,14 +423,14 @@ const handleExport = async () => {
|
|
|
|
|
exportLoading.value = true
|
|
|
|
|
parseKeyword()
|
|
|
|
|
const data = await MoldBrandApi.exportMoldBrand(queryParams)
|
|
|
|
|
download.excel(data, '模具台账.xls')
|
|
|
|
|
download.excel(data, t('MoldManagement.MoldBrandPage.exportFilename'))
|
|
|
|
|
} finally {
|
|
|
|
|
exportLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleReservedAction = (action: string) => {
|
|
|
|
|
message.info(`${action}功能预留中`)
|
|
|
|
|
message.info(t('MoldManagement.MoldBrandPage.reservedAction', { action }))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const previewQrcode = (row: MoldBrandVO) => {
|
|
|
|
|
@ -466,8 +465,7 @@ const openOperateForm = async (type: number, row: MoldBrandVO) => {
|
|
|
|
|
operateFormVisible.value = true
|
|
|
|
|
|
|
|
|
|
// 重置表单
|
|
|
|
|
operateFormData.moldId = undefined
|
|
|
|
|
operateFormData.targetLine = undefined
|
|
|
|
|
operateFormData.lineId = undefined
|
|
|
|
|
operateFormData.deviceId = undefined
|
|
|
|
|
operateFormData.operateTime = undefined
|
|
|
|
|
operateFormData.operatorId = undefined
|
|
|
|
|
@ -477,6 +475,7 @@ const openOperateForm = async (type: number, row: MoldBrandVO) => {
|
|
|
|
|
await initOperateOptions()
|
|
|
|
|
|
|
|
|
|
// 获取最近操作记录
|
|
|
|
|
recentPageNo.value = 1
|
|
|
|
|
await fetchRecentOperateList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -498,13 +497,6 @@ const initOperateOptions = async () => {
|
|
|
|
|
lineOptions.value = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取模具列表
|
|
|
|
|
try {
|
|
|
|
|
moldList.value = await MoldBrandApi.getBrandList()
|
|
|
|
|
} catch {
|
|
|
|
|
moldList.value = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取操作人选项
|
|
|
|
|
try {
|
|
|
|
|
operatorOptions.value = (await getSimpleUserList()) ?? []
|
|
|
|
|
@ -516,15 +508,20 @@ const initOperateOptions = async () => {
|
|
|
|
|
const fetchRecentOperateList = async () => {
|
|
|
|
|
if (!currentMold.value?.id) return
|
|
|
|
|
|
|
|
|
|
recentLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const data = await MoldOperateApi.getMoldOperatePage({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 5,
|
|
|
|
|
pageNo: recentPageNo.value,
|
|
|
|
|
pageSize: recentPageSize.value,
|
|
|
|
|
moldId: currentMold.value.id
|
|
|
|
|
})
|
|
|
|
|
recentOperateList.value = data?.list ?? []
|
|
|
|
|
recentTotal.value = data?.total ?? 0
|
|
|
|
|
} catch {
|
|
|
|
|
recentOperateList.value = []
|
|
|
|
|
recentTotal.value = 0
|
|
|
|
|
} finally {
|
|
|
|
|
recentLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -538,22 +535,24 @@ const submitOperateForm = async () => {
|
|
|
|
|
|
|
|
|
|
const submitData = {
|
|
|
|
|
operateType: operateType.value,
|
|
|
|
|
moldId: operateType.value === 1 ? operateFormData.moldId : currentMold.value?.id,
|
|
|
|
|
moldId: currentMold.value?.id,
|
|
|
|
|
lineId: operateFormData.lineId,
|
|
|
|
|
deviceId: operateFormData.deviceId,
|
|
|
|
|
remark: operateFormData.remark,
|
|
|
|
|
targetLine: operateFormData.targetLine,
|
|
|
|
|
operateTime: operateFormData.operateTime,
|
|
|
|
|
operatorId: operateFormData.operatorId
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await MoldOperateApi.createMoldOperate(submitData)
|
|
|
|
|
|
|
|
|
|
message.success(operateType.value === 1 ? '上模成功' : '下模成功')
|
|
|
|
|
message.success(operateType.value === 1 ? t('MoldManagement.MoldBrandPage.moldUpSuccess') : t('MoldManagement.MoldBrandPage.moldDownSuccess'))
|
|
|
|
|
|
|
|
|
|
closeOperateForm()
|
|
|
|
|
await getList()
|
|
|
|
|
// 提交成功暂不返回列表
|
|
|
|
|
// closeOperateForm()
|
|
|
|
|
// await getList()
|
|
|
|
|
fetchRecentOperateList()
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('提交失败:', error)
|
|
|
|
|
console.error(t('MoldManagement.MoldBrandPage.submitFailed'), error)
|
|
|
|
|
} finally {
|
|
|
|
|
operateLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
@ -707,7 +706,7 @@ onMounted(async () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mold-operate-page__history {
|
|
|
|
|
width: 420px;
|
|
|
|
|
width: 600px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
|