|
|
|
@ -13,11 +13,11 @@
|
|
|
|
|
<el-option v-for='dict in mes_route_active_flag' :key='dict.value' :label='dict.label' :value='dict.value'/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label='首件检验' prop='needFirstInspect'>-->
|
|
|
|
|
<!-- <el-select v-model='queryParams.needFirstInspect' placeholder='请选择首件检验' clearable>-->
|
|
|
|
|
<!-- <el-option v-for='dict in mes_need_first_inspect' :key='dict.value' :label='dict.label' :value='dict.value'/>-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label='首件检验' prop='needFirstInspect'>-->
|
|
|
|
|
<!-- <el-select v-model='queryParams.needFirstInspect' placeholder='请选择首件检验' clearable>-->
|
|
|
|
|
<!-- <el-option v-for='dict in mes_need_first_inspect' :key='dict.value' :label='dict.label' :value='dict.value'/>-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type='primary' icon='Search' @click='handleQuery'>搜索</el-button>
|
|
|
|
|
<el-button icon='Refresh' @click='resetQuery'>重置</el-button>
|
|
|
|
@ -110,23 +110,14 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='操作' align='center' class-name='small-padding fixed-width'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<!-- <el-tooltip content='修改' placement='top'>
|
|
|
|
|
<el-button link type='primary' icon='Edit' @click='handleUpdate(scope.row)'
|
|
|
|
|
v-hasPermi="['mes:baseRoute:edit']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content='删除' placement='top'>
|
|
|
|
|
<el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'
|
|
|
|
|
v-hasPermi="['mes:baseRoute:remove']"></el-button>
|
|
|
|
|
</el-tooltip>-->
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="routeProcessUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['mes:baseRoute:edit']"
|
|
|
|
|
>工艺步骤
|
|
|
|
|
</el-button>
|
|
|
|
|
<!-- <el-tooltip content='修改' placement='top'>
|
|
|
|
|
<el-button link type='primary' icon='Edit' @click='handleUpdate(scope.row)'
|
|
|
|
|
v-hasPermi="['mes:baseRoute:edit']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content='删除' placement='top'>
|
|
|
|
|
<el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'
|
|
|
|
|
v-hasPermi="['mes:baseRoute:remove']"></el-button>
|
|
|
|
|
</el-tooltip>-->
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
@ -137,6 +128,15 @@
|
|
|
|
|
>关联物料
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="routeProcessUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['mes:baseRoute:edit']"
|
|
|
|
|
>关联工艺步骤
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -176,20 +176,20 @@
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label='审核原因' prop='auditReason'>-->
|
|
|
|
|
<!-- <el-input v-model='form.auditReason' placeholder='请输入审核原因' />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label='审核人' prop='approveBy'>-->
|
|
|
|
|
<!-- <el-input v-model='form.approveBy' placeholder='请输入审核人' />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label='审核时间' prop='approveTime'>-->
|
|
|
|
|
<!-- <el-date-picker clearable-->
|
|
|
|
|
<!-- v-model='form.approveTime'-->
|
|
|
|
|
<!-- type='datetime'-->
|
|
|
|
|
<!-- value-format='YYYY-MM-DD HH:mm:ss'-->
|
|
|
|
|
<!-- placeholder='请选择审核时间'>-->
|
|
|
|
|
<!-- </el-date-picker>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label='审核原因' prop='auditReason'>-->
|
|
|
|
|
<!-- <el-input v-model='form.auditReason' placeholder='请输入审核原因' />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label='审核人' prop='approveBy'>-->
|
|
|
|
|
<!-- <el-input v-model='form.approveBy' placeholder='请输入审核人' />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label='审核时间' prop='approveTime'>-->
|
|
|
|
|
<!-- <el-date-picker clearable-->
|
|
|
|
|
<!-- v-model='form.approveTime'-->
|
|
|
|
|
<!-- type='datetime'-->
|
|
|
|
|
<!-- value-format='YYYY-MM-DD HH:mm:ss'-->
|
|
|
|
|
<!-- placeholder='请选择审核时间'>-->
|
|
|
|
|
<!-- </el-date-picker>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label='首件检验' prop='needFirstInspect'>
|
|
|
|
|
<el-radio-group v-model='form.needFirstInspect'>
|
|
|
|
|
<el-radio
|
|
|
|
@ -211,16 +211,16 @@
|
|
|
|
|
<el-form-item label='批次量' prop='batchSize'>
|
|
|
|
|
<el-input-number v-model='form.batchSize' placeholder='请输入批次量' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label='状态' prop='activeFlag'>-->
|
|
|
|
|
<!-- <el-radio-group v-model='form.activeFlag'>-->
|
|
|
|
|
<!-- <el-radio-->
|
|
|
|
|
<!-- v-for='dict in mes_route_active_flag'-->
|
|
|
|
|
<!-- :key='dict.value'-->
|
|
|
|
|
<!-- :value='dict.value'-->
|
|
|
|
|
<!-- >{{ dict.label }}-->
|
|
|
|
|
<!-- </el-radio>-->
|
|
|
|
|
<!-- </el-radio-group>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label='状态' prop='activeFlag'>-->
|
|
|
|
|
<!-- <el-radio-group v-model='form.activeFlag'>-->
|
|
|
|
|
<!-- <el-radio-->
|
|
|
|
|
<!-- v-for='dict in mes_route_active_flag'-->
|
|
|
|
|
<!-- :key='dict.value'-->
|
|
|
|
|
<!-- :value='dict.value'-->
|
|
|
|
|
<!-- >{{ dict.label }}-->
|
|
|
|
|
<!-- </el-radio>-->
|
|
|
|
|
<!-- </el-radio-group>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label='备注' prop='remark'>
|
|
|
|
|
<el-input v-model='form.remark' placeholder='请输入备注' />
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -233,64 +233,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--维护工艺路线步骤对话框-->
|
|
|
|
|
<el-dialog :title='dialog.title' v-model='ifOpen' width='500px' append-to-body>
|
|
|
|
|
<el-form ref='baseRouteFormRef' :model='form' :rules='rules' label-width='110px'>
|
|
|
|
|
<el-form-item label='工艺路线名称' prop='routeName'>
|
|
|
|
|
<el-input v-model='form.routeName' placeholder='请输入工艺路线名称' disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-divider content-position='center'>工艺路线组成信息</el-divider>
|
|
|
|
|
<el-row :gutter='10' class='mb8'>
|
|
|
|
|
<el-col :span='1.5'>
|
|
|
|
|
<el-button type='primary' icon='Plus' size='small' @click='handleAddProdBaseRouteProcess'>添加</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span='1.5'>
|
|
|
|
|
<el-button type='danger' icon='Delete' size='small' @click='handleDeleteProdBaseRouteProcess'>删除</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span='1.5'>
|
|
|
|
|
<span v-show='tagShow'>提示:该工艺路线已关联生产工单,无法修改!</span>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- <el-table :data='routeProcessBoList' :row-class-name='rowProdBaseRouteProcessIndex'
|
|
|
|
|
@selection-change='handleProdBaseRouteProcessSelectionChange' ref='mesBaseRouteProcess'>-->
|
|
|
|
|
<el-table
|
|
|
|
|
:data="routeProcessBoList"
|
|
|
|
|
:row-class-name="rowProdBaseRouteProcessIndex"
|
|
|
|
|
@selection-change="handleProdBaseRouteProcessSelectionChange"
|
|
|
|
|
ref="mesBaseRouteProcess"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type='selection' width='50' align='center' />
|
|
|
|
|
<el-table-column label='序号' align='center' prop='index' v-if='false' />
|
|
|
|
|
<el-table-column label='工艺路线顺序' prop='processOrder' width='100'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<el-input v-model='scope.row.processOrder' />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='工序' prop='processId'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<el-select v-model='scope.row.processId' filterable placeholder='请选择工序' clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for='item in processList'
|
|
|
|
|
:key='item.processId'
|
|
|
|
|
:label='item.processName'
|
|
|
|
|
:value='item.processId'
|
|
|
|
|
:disabled='routeProcessBoList.some(i => i.processId === item.processId)'
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class='dialog-footer'>
|
|
|
|
|
<el-button type='primary' @click='submitForm' v-show='submitShow'>确 定</el-button>
|
|
|
|
|
<el-button @click='cancel'>取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!--维护工艺路线关联物料对话框-->
|
|
|
|
|
<!--维护工艺路线关联物料对话框-->
|
|
|
|
|
<el-dialog :title='dialog.title' v-model='materialOpen' width='700px' append-to-body>
|
|
|
|
|
<el-form ref='baseRouteFormRef' :model='form' :rules='rules' label-width='110px'>
|
|
|
|
|
<el-form-item label='工艺路线名称' prop='routeName'>
|
|
|
|
@ -338,7 +281,7 @@
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class='dialog-footer'>
|
|
|
|
|
<el-button type='primary' @click='submitForm' v-show='submitShow'>确 定</el-button>
|
|
|
|
|
<el-button type='primary' @click='submitForm' >确 定</el-button>
|
|
|
|
|
<el-button @click='cancel'>取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -353,20 +296,344 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 关联工艺步骤对话框 -->
|
|
|
|
|
<el-dialog :title='dialog.title' v-model='processOpen' width='1200px' append-to-body>
|
|
|
|
|
<el-form ref='baseRouteFormRef' :model='form' label-width='100px'>
|
|
|
|
|
<el-form-item label='工艺路线名称' prop='routeName'>
|
|
|
|
|
<el-input v-model='form.routeName' placeholder='请输入工艺路线名称' disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-divider content-position='center'>工艺路线关联工艺步骤信息</el-divider>
|
|
|
|
|
<el-row :gutter='10' class='mb8'>
|
|
|
|
|
<el-col :span='1.5'>
|
|
|
|
|
<el-button type='primary' icon='Plus' size='small' @click='handleAddRouteProcess'>添加工艺步骤</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="routeProcessList"
|
|
|
|
|
:row-class-name="rowRouteProcessIndex"
|
|
|
|
|
ref="mesBaseRouteProcess"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type='selection' width='50' align='center' />
|
|
|
|
|
<el-table-column label='序号' align='center' prop='index' v-if='false' />
|
|
|
|
|
<el-table-column label='关联工序' prop='processId' align='center' width='180'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<span>{{ getProcessName(scope.row.processId) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='工艺路线顺序' prop='processOrder' align='center' width='120' />
|
|
|
|
|
<el-table-column label='委外标识' prop='outsourcingFlag' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_outsourcing_flag' :value='scope.row.outsourcingFlag'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='工序类型' prop='operationType' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='process_type' :value='scope.row.operationType'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='是否需要上料' prop='needFeeding' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_need_feeding' :value='scope.row.needFeeding'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='设备点检' prop='needEquipmentCheck' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_need_equipment_check' :value='scope.row.needEquipmentCheck'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='实际产出率(%)' prop='actualYieldRate' align='center' width='120' />
|
|
|
|
|
<el-table-column label='领料方式' prop='materialIssuance' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_material_method' :value='scope.row.materialIssuance'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='委外提前期(秒)' prop='outsourcingLeadTime' align='center' width='120' />
|
|
|
|
|
<el-table-column label='准备时间(秒)' prop='setupTime' align='center' width='120' />
|
|
|
|
|
<el-table-column label='加工时间(秒)' prop='processingTime' align='center' width='120' />
|
|
|
|
|
<el-table-column label='拆卸时间(秒)' prop='teardownTime' align='center' width='120' />
|
|
|
|
|
<el-table-column label='生产节拍(秒/件)' prop='productionTakt' align='center' width='120' />
|
|
|
|
|
<el-table-column label='质检方式' prop='inspectionMethod' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_inspection_method' :value='scope.row.inspectionMethod'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='质量检验规则ID' prop='qualityRuleId' align='center' width='120' />
|
|
|
|
|
<el-table-column label='关键工序' prop='isKeyOperation' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_is_key_operation' :value='scope.row.isKeyOperation'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='下工序要求' prop='nextStepRequirement' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_next_step_requirement' :value='scope.row.nextStepRequirement'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='最后工序' prop='isFinalStep' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_is_final_step' :value='scope.row.isFinalStep'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='生成流转卡任务' prop='generatePrepareTask' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='generate_prepare_task' :value='scope.row.generatePrepareTask'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='瓶颈工序' prop='bottleneckFlag' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_bottleneck_flag' :value='scope.row.bottleneckFlag'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='瓶颈设置' prop='bottleneckSetting' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_bottleneck_setting' :value='scope.row.bottleneckSetting'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='接续关系' prop='successorRelation' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<dict-tag :options='mes_successor_relation' :value='scope.row.successorRelation'/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='偏置时间(秒)' prop='offsetTime' align='center' width='120' />
|
|
|
|
|
<el-table-column label='技术附件' prop='techAttachments' align='center' width='120' />
|
|
|
|
|
<el-table-column label='质检员' prop='inspectors' align='center' width='120' />
|
|
|
|
|
<el-table-column label='备注' prop='remark' align='center' width='120' />
|
|
|
|
|
<el-table-column label='操作' align='center' width='120'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="Edit"
|
|
|
|
|
@click="handleEditRouteProcess(scope.row)"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="Delete"
|
|
|
|
|
@click="handleDeleteRouteProcess(scope.row)"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class='dialog-footer'>
|
|
|
|
|
<el-button type='primary' @click='submitForm'>确 定</el-button>
|
|
|
|
|
<el-button @click='cancel'>取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 工艺步骤编辑弹窗 -->
|
|
|
|
|
<el-dialog :title='processDialog.title' v-model='processDialog.visible' width='800px' append-to-body>
|
|
|
|
|
<el-form ref='processFormRef' :model='processForm' :rules='processRules' label-width='120px'>
|
|
|
|
|
<el-form-item label='关联工序' prop='processId'>
|
|
|
|
|
<el-select v-model='processForm.processId' placeholder='请选择关联工序' clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for='item in processList'
|
|
|
|
|
:key='item.processId'
|
|
|
|
|
:label='item.processName'
|
|
|
|
|
:value='item.processId'
|
|
|
|
|
:disabled='routeProcessList.some(i => i.processId === item.processId && i !== processForm)'
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='工艺路线顺序' prop='processOrder'>
|
|
|
|
|
<el-input-number v-model='processForm.processOrder' :min='1' :controls='false' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='委外标识' prop='outsourcingFlag'>
|
|
|
|
|
<el-radio-group v-model='processForm.outsourcingFlag'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_outsourcing_flag'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='工序类型' prop='operationType'>
|
|
|
|
|
<el-select v-model='processForm.operationType' placeholder='请选择工序类型'>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for='dict in process_type'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:label='dict.label'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='是否需要上料' prop='needFeeding'>
|
|
|
|
|
<el-radio-group v-model='processForm.needFeeding'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_need_feeding'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='设备点检' prop='needEquipmentCheck'>
|
|
|
|
|
<el-radio-group v-model='processForm.needEquipmentCheck'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_need_equipment_check'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='实际产出率(%)' prop='actualYieldRate'>
|
|
|
|
|
<el-input-number v-model='processForm.actualYieldRate' :min='0' :max='100' :controls='false' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='领料方式' prop='materialIssuance'>
|
|
|
|
|
<el-select v-model='processForm.materialIssuance' placeholder='请选择领料方式'>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for='dict in mes_material_method'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:label='dict.label'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='委外提前期(秒)' prop='outsourcingLeadTime'>
|
|
|
|
|
<el-input-number v-model='processForm.outsourcingLeadTime' :min='0' :controls='false' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='准备时间(秒)' prop='setupTime'>
|
|
|
|
|
<el-input-number v-model='processForm.setupTime' :min='0' :controls='false' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='加工时间(秒)' prop='processingTime'>
|
|
|
|
|
<el-input-number v-model='processForm.processingTime' :min='0' :controls='false' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='拆卸时间(秒)' prop='teardownTime'>
|
|
|
|
|
<el-input-number v-model='processForm.teardownTime' :min='0' :controls='false' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='生产节拍(秒/件)' prop='productionTakt'>
|
|
|
|
|
<el-input-number v-model='processForm.productionTakt' :min='0' :controls='false' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='质检方式' prop='inspectionMethod'>
|
|
|
|
|
<el-select v-model='processForm.inspectionMethod' placeholder='请选择质检方式'>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for='dict in mes_inspection_method'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:label='dict.label'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='质量检验规则ID' prop='qualityRuleId'>
|
|
|
|
|
<el-input v-model='processForm.qualityRuleId' placeholder='请输入质量检验规则ID' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='关键工序' prop='isKeyOperation'>
|
|
|
|
|
<el-radio-group v-model='processForm.isKeyOperation'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_is_key_operation'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='下工序要求' prop='nextStepRequirement'>
|
|
|
|
|
<el-radio-group v-model='processForm.nextStepRequirement'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_next_step_requirement'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='最后工序' prop='isFinalStep'>
|
|
|
|
|
<el-radio-group v-model='processForm.isFinalStep'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_is_final_step'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='生成流转卡任务' prop='generatePrepareTask'>
|
|
|
|
|
<el-radio-group v-model='processForm.generatePrepareTask'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in generate_prepare_task'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='瓶颈工序' prop='bottleneckFlag'>
|
|
|
|
|
<el-radio-group v-model='processForm.bottleneckFlag'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_bottleneck_flag'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='瓶颈设置' prop='bottleneckSetting'>
|
|
|
|
|
<el-radio-group v-model='processForm.bottleneckSetting'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_bottleneck_setting'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='接续关系' prop='successorRelation'>
|
|
|
|
|
<el-radio-group v-model='processForm.successorRelation'>
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for='dict in mes_successor_relation'
|
|
|
|
|
:key='dict.value'
|
|
|
|
|
:value='dict.value'
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='偏置时间(秒)' prop='offsetTime'>
|
|
|
|
|
<el-input-number v-model='processForm.offsetTime' :min='0' :controls='false' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='技术附件' prop='techAttachments'>
|
|
|
|
|
<el-input v-model='processForm.techAttachments' placeholder='请输入技术附件' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='质检员' prop='inspectors'>
|
|
|
|
|
<el-input v-model='processForm.inspectors' placeholder='请输入质检员' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='备注' prop='remark'>
|
|
|
|
|
<el-input v-model='processForm.remark' placeholder='请输入备注' />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class='dialog-footer'>
|
|
|
|
|
<el-button type='primary' @click='submitProcessDialog'>确 定</el-button>
|
|
|
|
|
<el-button @click='cancelProcessDialog'>取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup name='BaseRoute' lang='ts'>
|
|
|
|
|
import { listBaseRoute, getBaseRoute, delBaseRoute, addBaseRoute, updateBaseRoute } from '@/api/mes/baseRoute';
|
|
|
|
|
import { BaseRouteVO, BaseRouteQuery, BaseRouteForm, ProdBaseRouteProcess, ProdBaseRouteMaterial } from '@/api/mes/baseRoute/types';
|
|
|
|
|
import {getProcessInfoList} from "@/api/mes/baseProcessInfo";
|
|
|
|
|
import { getMaterialList } from '@/api/wms/linkage';
|
|
|
|
|
import MaterialSelect from '@/views/mes/baseMaterialInfo/addMaterial.vue';
|
|
|
|
|
/*import type { ProdBaseRouteProcess } from '@/api/mes/baseRoute/types';*/
|
|
|
|
|
|
|
|
|
|
import { listBaseProcessInfo } from '@/api/mes/baseProcessInfo';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const { mes_route_active_flag, mes_process_production_type, mes_need_first_inspect, mes_route_type, mes_print_flow_card, active_flag } = toRefs<any>(proxy?.useDict('mes_route_active_flag', 'mes_process_production_type', 'mes_need_first_inspect', 'mes_route_type', 'mes_print_flow_card', 'active_flag'));
|
|
|
|
|
const { mes_route_active_flag, mes_process_production_type, mes_need_first_inspect, mes_route_type, mes_print_flow_card, active_flag, mes_outsourcing_flag, process_type, mes_need_feeding, mes_need_equipment_check, mes_material_method, mes_inspection_method, mes_is_key_operation, mes_next_step_requirement, mes_is_final_step, generate_prepare_task, mes_bottleneck_flag, mes_bottleneck_setting, mes_successor_relation } = toRefs<any>(proxy?.useDict(
|
|
|
|
|
'mes_route_active_flag',
|
|
|
|
|
'mes_process_production_type',
|
|
|
|
|
'mes_need_first_inspect',
|
|
|
|
|
'mes_route_type',
|
|
|
|
|
'mes_print_flow_card',
|
|
|
|
|
'active_flag',
|
|
|
|
|
'mes_outsourcing_flag',
|
|
|
|
|
'process_type',
|
|
|
|
|
'mes_need_feeding',
|
|
|
|
|
'mes_need_equipment_check',
|
|
|
|
|
'mes_material_method',
|
|
|
|
|
'mes_inspection_method',
|
|
|
|
|
'mes_is_key_operation',
|
|
|
|
|
'mes_next_step_requirement',
|
|
|
|
|
'mes_is_final_step',
|
|
|
|
|
'generate_prepare_task',
|
|
|
|
|
'mes_bottleneck_flag',
|
|
|
|
|
'mes_bottleneck_setting',
|
|
|
|
|
'mes_successor_relation'
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
const baseRouteList = ref<BaseRouteVO[]>([]);
|
|
|
|
|
const buttonLoading = ref(false);
|
|
|
|
@ -380,24 +647,17 @@ const total = ref(0);
|
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
|
const baseRouteFormRef = ref<ElFormInstance>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 在data部分添加以下变量
|
|
|
|
|
const routeProcessOpen = ref(false);
|
|
|
|
|
const submitShow = ref(true);
|
|
|
|
|
const tagShow = ref(false);
|
|
|
|
|
const routeProcessBoList = ref<any[]>([]);
|
|
|
|
|
const checkedProdBaseRouteProcess = ref<any[]>([]);
|
|
|
|
|
const processList = ref<any[]>([]);
|
|
|
|
|
|
|
|
|
|
// 关联物料相关
|
|
|
|
|
const materialOpen = ref(false);
|
|
|
|
|
const prodBaseRouteMaterialList = ref<ProdBaseRouteMaterial[]>([]);
|
|
|
|
|
const checkedRouteMaterial = ref<ProdBaseRouteMaterial[]>([]);
|
|
|
|
|
const materialList = ref<any[]>([]);
|
|
|
|
|
|
|
|
|
|
//控制维护工艺路线步骤对话框的显示与隐藏,默认为false隐藏
|
|
|
|
|
const ifOpen = ref(false); // 使用 ref 定义响应式变量
|
|
|
|
|
// 关联工艺步骤相关
|
|
|
|
|
const processOpen = ref(false);
|
|
|
|
|
const routeProcessList = ref<ProdBaseRouteProcess[]>([]);
|
|
|
|
|
const checkedRouteProcess = ref<ProdBaseRouteProcess[]>([]);
|
|
|
|
|
const processList = ref<any[]>([]);
|
|
|
|
|
|
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
|
|
|
visible: false,
|
|
|
|
@ -491,14 +751,15 @@ const cancel = () => {
|
|
|
|
|
reset();
|
|
|
|
|
dialog.visible = false;
|
|
|
|
|
materialOpen.value = false;
|
|
|
|
|
ifOpen.value = false;
|
|
|
|
|
processOpen.value = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 表单重置 */
|
|
|
|
|
const reset = () => {
|
|
|
|
|
form.value = { ...initFormData };
|
|
|
|
|
baseRouteFormRef.value?.resetFields();
|
|
|
|
|
routeProcessBoList.value = [];
|
|
|
|
|
prodBaseRouteMaterialList.value = [];
|
|
|
|
|
routeProcessList.value = [];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
@ -549,8 +810,8 @@ const submitForm = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buttonLoading.value = true;
|
|
|
|
|
form.value.routeProcessBoList = routeProcessBoList.value;
|
|
|
|
|
form.value.prodBaseRouteMaterialList = prodBaseRouteMaterialList.value;
|
|
|
|
|
form.value.routeProcessList = routeProcessList.value;
|
|
|
|
|
if (form.value.routeId) {
|
|
|
|
|
await updateBaseRoute(form.value).finally(() => buttonLoading.value = false);
|
|
|
|
|
} else {
|
|
|
|
@ -558,13 +819,10 @@ const submitForm = () => {
|
|
|
|
|
}
|
|
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
|
|
dialog.visible = false;
|
|
|
|
|
ifOpen.value = false;
|
|
|
|
|
materialOpen.value = false;
|
|
|
|
|
routeProcessBoList.value = [];
|
|
|
|
|
prodBaseRouteMaterialList.value = [];
|
|
|
|
|
form.value.routeProcessBoList = [];
|
|
|
|
|
processOpen.value = false;
|
|
|
|
|
routeProcessList.value = [];
|
|
|
|
|
form.value.prodBaseRouteMaterialList = [];
|
|
|
|
|
form.value.routeProcessVoList = [];
|
|
|
|
|
await getList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -586,105 +844,6 @@ const handleExport = () => {
|
|
|
|
|
}, `baseRoute_${new Date().getTime()}.xlsx`);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 在methods部分添加以下方法
|
|
|
|
|
/** 维护工艺路线步骤 */
|
|
|
|
|
const routeProcessUpdate = async (row: BaseRouteVO) => {
|
|
|
|
|
reset();
|
|
|
|
|
const _routeId = row?.routeId || ids.value[0];
|
|
|
|
|
submitShow.value = true;
|
|
|
|
|
|
|
|
|
|
// 打开维护工艺路线步骤对话框
|
|
|
|
|
ifOpen.value = true;
|
|
|
|
|
|
|
|
|
|
/* tagShow.value = false;*/
|
|
|
|
|
|
|
|
|
|
/* // 检查是否关联生产工单
|
|
|
|
|
const res = await listProductOrder({ dispatchId: _routeId });
|
|
|
|
|
if (res.rows.length > 0) {
|
|
|
|
|
submitShow.value = false;
|
|
|
|
|
tagShow.value = true;
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
// 获取数据时
|
|
|
|
|
const routeRes = await getBaseRoute(_routeId);
|
|
|
|
|
form.value = routeRes.data;
|
|
|
|
|
routeProcessBoList.value = routeRes.data.routeProcessVoList || [];
|
|
|
|
|
routeProcessOpen.value = true;
|
|
|
|
|
dialog.title = '维护工艺路线步骤';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 修改rowProdBaseRouteProcessIndex方法,返回类名字符串 */
|
|
|
|
|
const rowProdBaseRouteProcessIndex = ({ row, rowIndex }: {
|
|
|
|
|
row: ProdBaseRouteProcess;
|
|
|
|
|
rowIndex: number
|
|
|
|
|
}): string => {
|
|
|
|
|
// 如果当前行的processOrder属性不存在
|
|
|
|
|
if (!row.processOrder) {
|
|
|
|
|
// 设置当前行的index属性为行索引加1
|
|
|
|
|
row.index = rowIndex + 1;
|
|
|
|
|
// 设置当前行的processOrder属性为(行索引加1)乘以10
|
|
|
|
|
row.processOrder = (rowIndex + 1) * 10;
|
|
|
|
|
}
|
|
|
|
|
// 返回一个空字符串表示不添加额外类名
|
|
|
|
|
return '';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 工艺路线组成信息添加按钮操作 */
|
|
|
|
|
const handleAddProdBaseRouteProcess = () => {
|
|
|
|
|
// 找到当前 routeProcessBoList 中的最大 processOrder 值
|
|
|
|
|
const maxProcessOrder = routeProcessBoList.value.reduce((max, item) => {
|
|
|
|
|
return Math.max(max, item.processOrder || 0);
|
|
|
|
|
}, 0);
|
|
|
|
|
|
|
|
|
|
// 新增的 processOrder 值为 maxProcessOrder + 10
|
|
|
|
|
const newProcessOrder = maxProcessOrder + 10;
|
|
|
|
|
|
|
|
|
|
routeProcessBoList.value.push({
|
|
|
|
|
processId: '', // 可以设置一个默认值或自增ID
|
|
|
|
|
processOrder: newProcessOrder,
|
|
|
|
|
remark: '',
|
|
|
|
|
createBy: '',
|
|
|
|
|
createTime: '',
|
|
|
|
|
updateBy: '',
|
|
|
|
|
updateTime: ''
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 工艺路线组成信息删除按钮操作 */
|
|
|
|
|
const handleDeleteProdBaseRouteProcess = () => {
|
|
|
|
|
// 检查是否有选中的工艺路线组成信息数据,如果没有则显示错误提示
|
|
|
|
|
if (checkedProdBaseRouteProcess.value.length === 0) {
|
|
|
|
|
proxy?.$modal.msgError('请先选择要删除的工艺路线组成信息数据');
|
|
|
|
|
} else {
|
|
|
|
|
// 过滤掉已选中的工艺路线组成信息数据
|
|
|
|
|
routeProcessBoList.value = routeProcessBoList.value.filter(
|
|
|
|
|
item => !checkedProdBaseRouteProcess.value.includes(item.processId)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 重新排列 processOrder
|
|
|
|
|
routeProcessBoList.value.forEach((item, index) => {
|
|
|
|
|
item.processOrder = (index + 1) * 10;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 清空选中的项
|
|
|
|
|
checkedProdBaseRouteProcess.value = [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 复选框选中数据 */
|
|
|
|
|
const handleProdBaseRouteProcessSelectionChange = (selection: any[]) => {
|
|
|
|
|
// 将选中的项的 processId 映射到 checkedProdBaseRouteProcess.value 数组中
|
|
|
|
|
checkedProdBaseRouteProcess.value = selection.map(item => item.processId);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getProcessList = async () => {
|
|
|
|
|
const processRes = await getProcessInfoList(null);
|
|
|
|
|
processList.value = processRes.data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 维护工艺路线关联物料 */
|
|
|
|
|
const routeMaterialUpdate = async (row: BaseRouteVO) => {
|
|
|
|
|
reset();
|
|
|
|
@ -692,7 +851,6 @@ const routeMaterialUpdate = async (row: BaseRouteVO) => {
|
|
|
|
|
const routeRes = await getBaseRoute(_routeId);
|
|
|
|
|
form.value = routeRes.data;
|
|
|
|
|
prodBaseRouteMaterialList.value = routeRes.data.prodBaseRouteMaterialList || [];
|
|
|
|
|
submitShow.value = true;
|
|
|
|
|
materialOpen.value = true;
|
|
|
|
|
dialog.title = '维护工艺路线关联物料';
|
|
|
|
|
};
|
|
|
|
@ -729,11 +887,6 @@ const handleRouteMaterialSelectionChange = (selection: ProdBaseRouteMaterial[])
|
|
|
|
|
checkedRouteMaterial.value = selection;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getMaterialListOptions = async () => {
|
|
|
|
|
const res = await getMaterialList({});
|
|
|
|
|
materialList.value = res.data || [];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const materialSelectRef = ref();
|
|
|
|
|
const materialDialogOpen = ref(false);
|
|
|
|
|
const currentMaterialRowIndex = ref(-1);
|
|
|
|
@ -742,18 +895,170 @@ const openMaterialDialog = (rowIndex) => {
|
|
|
|
|
currentMaterialRowIndex.value = rowIndex;
|
|
|
|
|
materialDialogOpen.value = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleMaterialSelection = () => {
|
|
|
|
|
const selectedRow = materialSelectRef.value.tableRef.store.states.currentRow.value;
|
|
|
|
|
if (selectedRow && currentMaterialRowIndex.value !== -1) {
|
|
|
|
|
console.log(selectedRow);
|
|
|
|
|
prodBaseRouteMaterialList.value[currentMaterialRowIndex.value].materialId = selectedRow.materialId;
|
|
|
|
|
prodBaseRouteMaterialList.value[currentMaterialRowIndex.value].materialName = selectedRow.materialName;
|
|
|
|
|
}
|
|
|
|
|
materialDialogOpen.value = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 获取工序列表
|
|
|
|
|
const getProcessList = async () => {
|
|
|
|
|
const res = await listBaseProcessInfo(null);
|
|
|
|
|
processList.value = res.rows;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 打开关联工艺步骤对话框
|
|
|
|
|
const routeProcessUpdate = async (row: BaseRouteVO) => {
|
|
|
|
|
reset();
|
|
|
|
|
const _routeId = row?.routeId || ids.value[0];
|
|
|
|
|
const routeRes = await getBaseRoute(_routeId);
|
|
|
|
|
form.value = routeRes.data;
|
|
|
|
|
// 处理工艺步骤数据,将null值转换为默认值
|
|
|
|
|
routeProcessList.value = routeRes.data.routeProcessList || [];
|
|
|
|
|
processOpen.value = true;
|
|
|
|
|
dialog.title = '维护工艺路线关联工艺步骤';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 修改rowRouteProcessIndex方法
|
|
|
|
|
const rowRouteProcessIndex = ({ row, rowIndex }: { row: any; rowIndex: number }): string => {
|
|
|
|
|
row.index = rowIndex + 1;
|
|
|
|
|
return '';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 在script setup部分添加以下代码
|
|
|
|
|
const processDialog = reactive({
|
|
|
|
|
visible: false,
|
|
|
|
|
title: '',
|
|
|
|
|
isEdit: false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const processFormRef = ref<ElFormInstance>();
|
|
|
|
|
const processForm = ref<any>({
|
|
|
|
|
processId: '',
|
|
|
|
|
processOrder: 1,
|
|
|
|
|
outsourcingFlag: '0',
|
|
|
|
|
operationType: '1',
|
|
|
|
|
needFeeding: '0',
|
|
|
|
|
needEquipmentCheck: '0',
|
|
|
|
|
actualYieldRate: 100,
|
|
|
|
|
materialIssuance: '1',
|
|
|
|
|
outsourcingLeadTime: 0,
|
|
|
|
|
setupTime: 0,
|
|
|
|
|
processingTime: 0,
|
|
|
|
|
teardownTime: 0,
|
|
|
|
|
productionTakt: 0,
|
|
|
|
|
inspectionMethod: '1',
|
|
|
|
|
qualityRuleId: '',
|
|
|
|
|
isKeyOperation: '0',
|
|
|
|
|
nextStepRequirement: '0',
|
|
|
|
|
isFinalStep: '0',
|
|
|
|
|
generatePrepareTask: '0',
|
|
|
|
|
bottleneckFlag: '0',
|
|
|
|
|
bottleneckSetting: '0',
|
|
|
|
|
successorRelation: '0',
|
|
|
|
|
offsetTime: 0,
|
|
|
|
|
techAttachments: '',
|
|
|
|
|
inspectors: '',
|
|
|
|
|
remark: ''
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const processRules = {
|
|
|
|
|
processId: [
|
|
|
|
|
{ required: true, message: '请选择关联工序', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
processOrder: [
|
|
|
|
|
{ required: true, message: '请输入工艺路线顺序', trigger: 'blur' }
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 获取工序名称
|
|
|
|
|
const getProcessName = (processId: string) => {
|
|
|
|
|
const process = processList.value.find(item => item.processId === processId);
|
|
|
|
|
return process ? process.processName : '';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 添加工艺步骤
|
|
|
|
|
const handleAddRouteProcess = () => {
|
|
|
|
|
processDialog.isEdit = false;
|
|
|
|
|
processDialog.title = '添加工艺步骤';
|
|
|
|
|
processForm.value = {
|
|
|
|
|
processId: '',
|
|
|
|
|
processOrder: routeProcessList.value.length + 1,
|
|
|
|
|
outsourcingFlag: '0',
|
|
|
|
|
operationType: '1',
|
|
|
|
|
needFeeding: '0',
|
|
|
|
|
needEquipmentCheck: '0',
|
|
|
|
|
actualYieldRate: 100,
|
|
|
|
|
materialIssuance: '1',
|
|
|
|
|
outsourcingLeadTime: 0,
|
|
|
|
|
setupTime: 0,
|
|
|
|
|
processingTime: 0,
|
|
|
|
|
teardownTime: 0,
|
|
|
|
|
productionTakt: 0,
|
|
|
|
|
inspectionMethod: '1',
|
|
|
|
|
qualityRuleId: '',
|
|
|
|
|
isKeyOperation: '0',
|
|
|
|
|
nextStepRequirement: '0',
|
|
|
|
|
isFinalStep: '0',
|
|
|
|
|
generatePrepareTask: '0',
|
|
|
|
|
bottleneckFlag: '0',
|
|
|
|
|
bottleneckSetting: '0',
|
|
|
|
|
successorRelation: '0',
|
|
|
|
|
offsetTime: 0,
|
|
|
|
|
techAttachments: '',
|
|
|
|
|
inspectors: '',
|
|
|
|
|
remark: ''
|
|
|
|
|
};
|
|
|
|
|
processDialog.visible = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 修改工艺步骤
|
|
|
|
|
const handleEditRouteProcess = (row: any) => {
|
|
|
|
|
processDialog.isEdit = true;
|
|
|
|
|
processDialog.title = '修改工艺步骤';
|
|
|
|
|
processForm.value = { ...row };
|
|
|
|
|
processDialog.visible = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 删除工艺步骤
|
|
|
|
|
const handleDeleteRouteProcess = (row: any) => {
|
|
|
|
|
proxy?.$modal.confirm('是否确认删除该工艺步骤?').then(() => {
|
|
|
|
|
const index = routeProcessList.value.findIndex(item => item === row);
|
|
|
|
|
if (index !== -1) {
|
|
|
|
|
routeProcessList.value.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 提交工艺步骤弹窗
|
|
|
|
|
const submitProcessDialog = () => {
|
|
|
|
|
processFormRef.value?.validate((valid: boolean) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (processDialog.isEdit) {
|
|
|
|
|
const index = routeProcessList.value.findIndex(item => item === processForm.value);
|
|
|
|
|
if (index !== -1) {
|
|
|
|
|
routeProcessList.value[index] = { ...processForm.value };
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
routeProcessList.value.push({ ...processForm.value });
|
|
|
|
|
}
|
|
|
|
|
processDialog.visible = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 取消工艺步骤弹窗
|
|
|
|
|
const cancelProcessDialog = () => {
|
|
|
|
|
processDialog.visible = false;
|
|
|
|
|
processFormRef.value?.resetFields();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getProcessList();
|
|
|
|
|
getList();
|
|
|
|
|
getProcessList();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|