1520 lines
36 KiB
Vue
1520 lines
36 KiB
Vue
<template>
|
|
<el-dialog
|
|
:title="titleMap[mode]"
|
|
v-model="visible"
|
|
width="1000px"
|
|
:size="1000"
|
|
destroy-on-close
|
|
@closed="$emit('closed')"
|
|
>
|
|
<!-- 混料工序 -->
|
|
<el-form
|
|
v-if="activeType == '8车间'"
|
|
ref="dialogForm"
|
|
:model="form"
|
|
:rules="rules"
|
|
label-width="80px"
|
|
>
|
|
<el-row>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="工艺路线" v-if="mode == 'add'">
|
|
<el-select
|
|
v-model="currentRoute"
|
|
value-key="id"
|
|
placeholder="工艺路线"
|
|
clearable
|
|
filterable
|
|
style="width: 100%"
|
|
@change="routeChange"
|
|
>
|
|
<el-option
|
|
v-for="item in routeOptions"
|
|
:key="item.id"
|
|
:label="item.label"
|
|
:value="item"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="工艺路线" v-if="mode == 'edit'">
|
|
<span
|
|
>{{ form.material_in_name }}->{{
|
|
form.material_out_name
|
|
}}</span
|
|
>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="班次" prop="shift">
|
|
<el-select
|
|
v-model="form.shift"
|
|
placeholder="班次"
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in shiftOptions"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="批次号" width="100">
|
|
<el-input
|
|
v-model="form.batch"
|
|
tyle="width:100%"
|
|
placeholder="批次号"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="数量(桶数)" width="100">
|
|
<el-input-number
|
|
v-model="form.count_real"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="请输入数量"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="每桶(kg)" width="100">
|
|
<el-input-number
|
|
v-model="form.count_real_eweight"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.01"
|
|
:precision="2"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="请输入重量"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="配料人">
|
|
<el-select
|
|
v-model="form.handle_users"
|
|
placeholder="配料人"
|
|
clearable
|
|
multiple
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in userList"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="操作日期" prop="handle_date">
|
|
<el-date-picker
|
|
v-model="form.handle_date"
|
|
type="date"
|
|
placeholder="操作日期"
|
|
format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"
|
|
style="width: 100%"
|
|
/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="备注">
|
|
<el-input
|
|
v-model="form.note"
|
|
tyle="width:100%"
|
|
placeholder="备注"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<!-- 退火 -->
|
|
<el-form
|
|
v-if="activeType == '退火'"
|
|
ref="dialogForm"
|
|
:model="form"
|
|
:rules="rules"
|
|
label-width="120px"
|
|
>
|
|
<el-row>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="工艺路线" v-if="mode == 'add'">
|
|
<el-select
|
|
v-model="currentRoute"
|
|
value-key="id"
|
|
placeholder="工艺路线"
|
|
filterable
|
|
clearable
|
|
style="width: 100%"
|
|
@change="routeChange"
|
|
>
|
|
<el-option
|
|
v-for="item in routeOptions"
|
|
:key="item.id"
|
|
:label="item.label"
|
|
:value="item"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="工艺路线" v-if="mode == 'edit'">
|
|
<span
|
|
>{{ form.material_in_name }}->{{
|
|
form.material_out_name
|
|
}}</span
|
|
>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="批次号" prop="material_in">
|
|
<el-select
|
|
v-model="form.batch"
|
|
placeholder="批次号"
|
|
filterable
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in wMaterialOptions"
|
|
:key="item.batch"
|
|
:label="item.batch"
|
|
:value="item.batch"
|
|
>
|
|
<div
|
|
style="
|
|
display: flex;
|
|
justify-content: space-between;
|
|
"
|
|
>
|
|
<span>{{ item.batch }}</span>
|
|
<span style="color: #aaaaaa">{{
|
|
item.count
|
|
}}</span>
|
|
</div>
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="班次" prop="shift">
|
|
<el-select
|
|
v-model="form.shift"
|
|
placeholder="班次"
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in shiftOptions"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="合格数">
|
|
<el-input-number
|
|
v-model="form.count_ok"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="请输入合格数"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="不合格数">
|
|
<el-input-number
|
|
v-model="form.count_notok"
|
|
controls-position="right"
|
|
style="width: 100%"
|
|
placeholder="不合格数"
|
|
disabled
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="退火时间" prop="material">
|
|
<el-date-picker
|
|
v-model="form.handle_date"
|
|
type="date"
|
|
placeholder="退火时间"
|
|
format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"
|
|
style="width: 100%"
|
|
/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div class="formTitle">不合格原因及数量:</div>
|
|
<el-row>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="箱中破">
|
|
<el-input-number
|
|
v-model="form.count_n_xzp"
|
|
controls-position="right"
|
|
style="width: 100%"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
placeholder="箱中破"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="退火后碎">
|
|
<el-input-number
|
|
v-model="form.count_n_thhs"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="退火后碎"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="划伤">
|
|
<el-input-number
|
|
v-model="form.count_n_hs"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="划伤"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="结石">
|
|
<el-input-number
|
|
v-model="form.count_n_js"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="结石"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="气线">
|
|
<el-input-number
|
|
v-model="form.count_n_qx"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="气线"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="其他">
|
|
<el-input-number
|
|
v-model="form.count_n_qt"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="其他"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="备注">
|
|
<el-input
|
|
v-model="form.note"
|
|
tyle="width:100%"
|
|
placeholder="备注"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<!-- 七车间 -->
|
|
<el-form
|
|
v-if="activeType == '7车间'"
|
|
ref="dialogForm"
|
|
:model="form"
|
|
:rules="rules"
|
|
label-width="120px"
|
|
>
|
|
<el-row>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="产品名称">
|
|
<el-select
|
|
v-model="form.material_out"
|
|
placeholder="产品名称"
|
|
disabled
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in materialOptions"
|
|
:key="item.id"
|
|
:label="item.full_name"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="批次号">
|
|
<el-input
|
|
v-model="form.batch"
|
|
tyle="width:100%"
|
|
placeholder="批次号"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="炉号">
|
|
<el-select
|
|
v-model="form.equipment"
|
|
placeholder="炉号"
|
|
clearable
|
|
style="width: 100%"
|
|
@change="equipmenChange"
|
|
>
|
|
<el-option
|
|
v-for="item in equipmentOptions1"
|
|
:key="item.id"
|
|
:label="item.full_name"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="第几锅">
|
|
<el-input-number
|
|
v-model="form.index"
|
|
controls-position="right"
|
|
:min="1"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="第几锅"
|
|
@change="indexChange"
|
|
>
|
|
</el-input-number>
|
|
<!-- <el-select v-model="form.index" placeholder="第几锅" clearable style="width:100%">
|
|
<el-option v-for="item in 8" :key="item" :label="item" :value="item"></el-option>
|
|
</el-select> -->
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="应出量">
|
|
<el-input-number
|
|
v-model="form.count_real"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="生产量"
|
|
@change="countChange"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="合格量">
|
|
<el-input-number
|
|
v-model="form.count_ok"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="合格量"
|
|
@change="countChange"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<!-- <el-col :md="12" :sm="24">
|
|
<el-form-item label="合格率">
|
|
<el-input
|
|
v-model="form.rate"
|
|
style="width: 100%"
|
|
disabled
|
|
placeholder="合格率"
|
|
>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="退火炉号">
|
|
<el-select
|
|
v-model="form.equipment_2"
|
|
placeholder="退火炉号"
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in equipmentOptions2"
|
|
:key="item.id"
|
|
:label="item.full_name"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item prop="type" label="成型人">
|
|
<el-select
|
|
v-model="form.handle_user"
|
|
placeholder="成型人"
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in userList"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item prop="type" label="切料人">
|
|
<el-select
|
|
v-model="form.handle_user_2"
|
|
placeholder="切料人"
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in userList"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div class="formTitle">不合格原因及数量:</div>
|
|
<el-row>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="炸纹">
|
|
<el-input-number
|
|
v-model="form.count_n_zw"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="炸纹"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="炸头">
|
|
<el-input-number
|
|
v-model="form.count_n_zt"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="炸头"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="条纹">
|
|
<el-input-number
|
|
v-model="form.count_n_tw"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="条纹"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="气泡">
|
|
<el-input-number
|
|
v-model="form.count_n_qp"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="气泡"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="扁">
|
|
<el-input-number
|
|
v-model="form.count_n_b"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="扁"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="杂质">
|
|
<el-input-number
|
|
v-model="form.count_n_zz"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="杂质"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="其他">
|
|
<el-input-number
|
|
v-model="form.count_n_qt"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="0.1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="其他"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="合计">
|
|
<el-input-number
|
|
:step="0.1"
|
|
v-model="form.count_notok"
|
|
controls-position="right"
|
|
style="width: 100%"
|
|
placeholder="合计"
|
|
disabled
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="备注">
|
|
<el-input
|
|
v-model="form.note"
|
|
placeholder="备注"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<!-- 十车间 -->
|
|
<el-form
|
|
v-if="activeType == '10车间'"
|
|
ref="dialogForm"
|
|
:model="form"
|
|
:rules="rules"
|
|
label-width="80px"
|
|
>
|
|
<el-row>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="产品名称" prop="material">
|
|
<el-select
|
|
v-model="form.material_out"
|
|
placeholder="产品名称"
|
|
disabled
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in materialOptions"
|
|
:key="item.id"
|
|
:label="item.full_name"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="班次" prop="material">
|
|
<el-select
|
|
v-model="form.shift"
|
|
placeholder="班次"
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in shiftOptions"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="出管总数">
|
|
<el-input-number
|
|
v-model="form.count_real"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="出管总数"
|
|
@change="countChange"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="合格总数">
|
|
<el-input-number
|
|
v-model="form.count_ok"
|
|
controls-position="right"
|
|
style="width: 100%"
|
|
placeholder="合计"
|
|
:disabled="brothersList.length > 0"
|
|
@change="countChange"
|
|
></el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="合格率">
|
|
<el-input
|
|
v-model="form.rate"
|
|
style="width: 100%"
|
|
disabled
|
|
placeholder="合格率"
|
|
>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item prop="type" label="成型人">
|
|
<el-select
|
|
v-model="form.handle_user"
|
|
placeholder="成型人"
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in userList"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item prop="type" label="带班人">
|
|
<el-select
|
|
v-model="form.handle_leader"
|
|
placeholder="带班人"
|
|
clearable
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in userList"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="碎料">
|
|
<el-input-number
|
|
v-model="form.count_break"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="碎料"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="批次号">
|
|
<el-input
|
|
v-model="form.batch"
|
|
tyle="width:100%"
|
|
placeholder="批次号"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div v-if="brothersList.length > 0" class="formTitle">
|
|
关联产品计数:
|
|
</div>
|
|
<div v-if="brothersList.length > 0">
|
|
<el-row v-for="item in mlogb" :key="item">
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="生产任务">
|
|
<el-select
|
|
v-model="item.material_out"
|
|
placeholder="产品名称"
|
|
disabled
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="item in materialOptions"
|
|
:key="item.id"
|
|
:label="item.full_name"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="合格数">
|
|
<el-input-number
|
|
v-model="item.count_ok"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="合格数"
|
|
@change="countOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</div>
|
|
|
|
<div class="formTitle">不合格原因及数量:</div>
|
|
<el-row>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="椭圆/弯曲">
|
|
<el-input-number
|
|
v-model="form.count_n_wq"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="椭圆/弯曲"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="条纹">
|
|
<el-input-number
|
|
v-model="form.count_n_tw"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="条纹"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="断裂">
|
|
<el-input-number
|
|
v-model="form.count_n_dl"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="断裂"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="偏壁">
|
|
<el-input-number
|
|
v-model="form.count_n_pb"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="偏壁"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="大小头">
|
|
<el-input-number
|
|
v-model="form.count_n_dxt"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="大小头"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="结石">
|
|
<el-input-number
|
|
v-model="form.count_n_js"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="结石"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="气线">
|
|
<el-input-number
|
|
v-model="form.count_n_qx"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="气线"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="其他">
|
|
<el-input-number
|
|
v-model="form.count_n_qt"
|
|
controls-position="right"
|
|
:min="0"
|
|
:step="1"
|
|
:step-strictly="true"
|
|
style="width: 100%"
|
|
placeholder="其他"
|
|
@change="countNotOkSun"
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="合计">
|
|
<el-input-number
|
|
v-model="form.count_notok"
|
|
controls-position="right"
|
|
style="width: 100%"
|
|
placeholder="合计"
|
|
disabled
|
|
>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="12" :sm="24">
|
|
<el-form-item label="备注">
|
|
<el-input
|
|
v-model="form.note"
|
|
placeholder="备注"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<el-footer>
|
|
<el-button type="primary" v-loading="isSaveing" @click="submit"
|
|
>确定</el-button
|
|
>
|
|
<el-button @click="visible = false">取消</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
emits: ["success", "closed"],
|
|
props: {
|
|
mgroupShiftRule: { type: String, default: "" },
|
|
mgroup: { type: String, default: "" },
|
|
mtask: { type: String, default: "" },
|
|
mgroupId: { type: String, default: "" },
|
|
activeType: { type: String, default: "" },
|
|
material_out: { type: String, default: "" },
|
|
material_model: { type: String, default: "" },
|
|
brothersList: { type: Array, default: () => [] },
|
|
mtaskDate: { type: String, default: "" },
|
|
belongdept: { type: String, default: "" },
|
|
},
|
|
data() {
|
|
return {
|
|
currentRoute: "",
|
|
yseorno: ["是", "否"],
|
|
loading: false,
|
|
mode: "add",
|
|
titleMap: {
|
|
add: "新增记录",
|
|
edit: "编辑记录",
|
|
show: "查看记录",
|
|
},
|
|
handle_user: [],
|
|
form: {
|
|
shift: "",
|
|
batch: "",
|
|
count_ok: 0,
|
|
count_real: 0,
|
|
count_n_zw: 0,
|
|
count_n_tw: 0,
|
|
count_n_qp: 0,
|
|
count_n_wq:0,
|
|
count_n_zt: 0,
|
|
count_n_b: 0,
|
|
count_n_dl: 0,
|
|
count_n_pb: 0,
|
|
count_n_dxt: 0,
|
|
count_n_js: 0,
|
|
count_n_qx: 0,
|
|
count_n_zz:0,
|
|
count_n_qt: 0,
|
|
count_n_hs: 0,
|
|
count_n_xzp: 0,
|
|
count_n_ysq: 0,
|
|
count_n_thhs: 0,
|
|
count_break: 0,
|
|
count_notok: 0,
|
|
mlogb: [],
|
|
work_start_time: "",
|
|
},
|
|
mlogb: [],
|
|
userList: [],
|
|
cateOptions: [],
|
|
mgroupOptions: [],
|
|
materialOptions: [],
|
|
equipmentOptions1: [],
|
|
equipmentOptions2: [],
|
|
wMaterialOptions: [],
|
|
shiftOptions: [],
|
|
routeOptions: [],
|
|
visible: false,
|
|
isSaveing: false,
|
|
setFiltersVisible: false,
|
|
handle_name: "",
|
|
leader_name: "",
|
|
count_n_all: null,
|
|
equipment_number: "",
|
|
rules: {},
|
|
};
|
|
},
|
|
mounted() {
|
|
let date = new Date();
|
|
let year = date.getFullYear();
|
|
let month = date.getMonth() + 1;
|
|
let day = date.getDate();
|
|
month = month < 10 ? "0" + month : month;
|
|
day = day < 10 ? "0" + day : day;
|
|
let handle_date = year + "-" + month + "-" + day;
|
|
let dateNow = "" + year + month + day;
|
|
this.dateNow = dateNow;
|
|
this.form.material_out = this.material_out;
|
|
this.form.material_in = this.material_in;
|
|
this.form.mtask = this.mtask;
|
|
this.form.mgroup = this.mgroup;
|
|
this.form.handle_date = handle_date;
|
|
let batchDate = "";
|
|
console.log(this.mtaskDate);
|
|
if (this.mtaskDate !== "") {
|
|
batchDate = this.mtaskDate.split("-").join("");
|
|
console.log(batchDate);
|
|
} else {
|
|
batchDate = dateNow;
|
|
}
|
|
if (this.activeType == "10车间" || this.activeType == "7车间") {
|
|
this.form.batch = this.material_model + "-" + batchDate;
|
|
}
|
|
// this.getMaterial();
|
|
this.getUserList();
|
|
this.getEquipment();
|
|
this.getShiftOptions();
|
|
this.getRouteOptions();
|
|
this.getWorkShopMaterial();
|
|
this.mlogb = this.brothersList;
|
|
if (this.activeType == "10车间") {
|
|
this.getMaterial(0);
|
|
} else {
|
|
this.getMaterial(this.mgroup);
|
|
}
|
|
},
|
|
methods: {
|
|
routeChange(item) {
|
|
this.form.material_out = item.material_out;
|
|
this.form.material_in = item.material_in;
|
|
this.form.mgroup = item.mgroup;
|
|
this.getWorkShopMaterial();
|
|
},
|
|
getRouteOptions() {
|
|
let mgroup__name = "";
|
|
if (this.activeType == "8车间") {
|
|
mgroup__name = "混料";
|
|
} else if (this.activeType == "退火") {
|
|
mgroup__name = "管料退火";
|
|
} else {
|
|
return;
|
|
}
|
|
this.$API.mtm.route.list
|
|
.req({ page: 0, mgroup__name: mgroup__name })
|
|
.then((res) => {
|
|
for (var i = 0; i < res.length; i++) {
|
|
if (res[i].material_in == null) {
|
|
res[i].material_in_name = "";
|
|
}
|
|
if (res[i].material_out == null) {
|
|
res[i].material_out_name = "";
|
|
}
|
|
res[i].label =
|
|
res[i].material_in_name +
|
|
"->" +
|
|
res[i].material_out_name;
|
|
}
|
|
this.routeOptions = res;
|
|
});
|
|
},
|
|
getShiftOptions() {
|
|
let that = this;
|
|
let req_dict = { page: 0 };
|
|
if (
|
|
this.mgroupShiftRule != null &&
|
|
this.mgroupShiftRule != undefined
|
|
) {
|
|
req_dict.rule = this.mgroupShiftRule;
|
|
}
|
|
this.$API.mtm.shift.list.req(req_dict).then((res) => {
|
|
that.shiftOptions = res;
|
|
let list = res.filter(
|
|
(item) => item.name.indexOf("长白班") > -1
|
|
);
|
|
if (that.activeType !== "10车间" && list.length > 0) {
|
|
that.form.shift = list[0].id;
|
|
}
|
|
});
|
|
},
|
|
equipmenChange(val) {
|
|
let that = this;
|
|
that.equipmentOptions1.forEach((item) => {
|
|
if (item.id == val) {
|
|
let number = item.number;
|
|
that.equipment_number = number.substring(number.length - 1);
|
|
let index = that.form.index;
|
|
if (index == undefined || index == "" || index == null) {
|
|
index = "";
|
|
}
|
|
that.form.batch =
|
|
that.material_model +
|
|
"-" +
|
|
that.equipment_number +
|
|
"-" +
|
|
that.dateNow +
|
|
"-" +
|
|
index;
|
|
}
|
|
});
|
|
},
|
|
indexChange(val) {
|
|
this.form.batch =
|
|
this.material_model +
|
|
"-" +
|
|
this.equipment_number +
|
|
"-" +
|
|
this.dateNow +
|
|
"-" +
|
|
val;
|
|
},
|
|
getUserList() {
|
|
let that = this;
|
|
let deptName = "";
|
|
if (this.activeType == "退火") {
|
|
deptName = "8车间";
|
|
} else {
|
|
deptName = this.activeType;
|
|
}
|
|
this.$API.system.user.list
|
|
.req({ belong_dept__name: deptName, page: 0 })
|
|
.then((res) => {
|
|
that.userList = res;
|
|
});
|
|
},
|
|
//获取集合列表
|
|
getMgroupList() {
|
|
let that = this;
|
|
let activeDeptName = "";
|
|
if (this.activeType == "退火") {
|
|
activeDeptName = "8车间";
|
|
} else {
|
|
activeDeptName = this.activeType;
|
|
}
|
|
this.$API.mtm.mgroup.list
|
|
.req({ page: 0, belong_dept__name: activeDeptName })
|
|
.then((res) => {
|
|
that.mgroupOptions = res;
|
|
});
|
|
},
|
|
//获取设备列表
|
|
getEquipment() {
|
|
this.$API.em.equipment.cquery
|
|
.req({
|
|
page: 0,
|
|
querys: [
|
|
[
|
|
{
|
|
field: "name",
|
|
compare: "contains",
|
|
value: "单坩埚熔化炉",
|
|
},
|
|
],
|
|
],
|
|
})
|
|
.then((res) => {
|
|
this.equipmentOptions1 = res;
|
|
});
|
|
this.$API.em.equipment.cquery
|
|
.req({
|
|
page: 0,
|
|
querys: [
|
|
[
|
|
{
|
|
field: "name",
|
|
compare: "contains",
|
|
value: "电阻炉",
|
|
},
|
|
],
|
|
[
|
|
{
|
|
field: "name",
|
|
compare: "contains",
|
|
value: "升降式退火炉",
|
|
},
|
|
],
|
|
],
|
|
})
|
|
.then((res) => {
|
|
this.equipmentOptions2 = res;
|
|
});
|
|
},
|
|
getMaterial(mgroupId) {
|
|
if (mgroupId != 0) {
|
|
this.$API.mtm.route.list
|
|
.req({ page: 0, mgroup: mgroupId })
|
|
.then((res) => {
|
|
let mOptions = [];
|
|
for (var i = 0; i < res.length; i++) {
|
|
mOptions.push({
|
|
id: res[i].material_out,
|
|
name: res[i].material_out_name,
|
|
full_name: res[i].material_out_name,
|
|
material_in: res[i].material_in,
|
|
});
|
|
}
|
|
this.materialOptions = mOptions;
|
|
});
|
|
} else {
|
|
let obj = {};
|
|
obj.page = 0;
|
|
obj.is_hidden = false;
|
|
obj.type__in = "10,20,30";
|
|
this.$API.mtm.material.list.req(obj).then((res) => {
|
|
this.materialOptions = res;
|
|
});
|
|
}
|
|
},
|
|
getWorkShopMaterial() {
|
|
let that = this;
|
|
if (this.form.material_in) {
|
|
this.$API.wpm.wmaterial.list
|
|
.req({
|
|
material: this.form.material_in,
|
|
page: 0,
|
|
count__gte: 1,
|
|
belong_dept: that.belongdept,
|
|
})
|
|
.then((res) => {
|
|
that.wMaterialOptions = res;
|
|
});
|
|
}
|
|
},
|
|
//显示
|
|
open(mode = "add") {
|
|
this.mode = mode;
|
|
this.visible = true;
|
|
if(this.mode == "add"){
|
|
let date = new Date();
|
|
this.form.work_start_time = this.$TOOL.dateFormat1(date);
|
|
}
|
|
return this;
|
|
},
|
|
countNotOkSun() {
|
|
if (this.activeType == "7车间") {
|
|
this.form.count_notok =
|
|
this.form.count_n_zw +
|
|
this.form.count_n_tw +
|
|
this.form.count_n_qp +
|
|
this.form.count_n_zt +
|
|
this.form.count_n_b +
|
|
this.form.count_n_zz +
|
|
this.form.count_n_qt;
|
|
} else if (this.activeType == "10车间") {
|
|
this.form.count_notok =
|
|
this.form.count_n_wq +
|
|
this.form.count_n_tw +
|
|
this.form.count_n_dl +
|
|
this.form.count_n_pb +
|
|
this.form.count_n_dxt +
|
|
this.form.count_n_js +
|
|
this.form.count_n_qx;
|
|
} else if (this.activeType == "退火") {
|
|
this.form.count_notok =
|
|
this.form.count_n_xzp +
|
|
this.form.count_n_thhs +
|
|
this.form.count_n_hs +
|
|
this.form.count_n_js +
|
|
this.form.count_n_qx +
|
|
this.form.count_n_qt;
|
|
this.form.count_real =
|
|
this.form.count_ok + this.form.count_notok;
|
|
this.form.count_use = this.form.count_real;
|
|
}
|
|
},
|
|
countOkSun() {
|
|
if (this.mlogb.length > 0) {
|
|
let ok_number = 0;
|
|
this.mlogb.forEach((item) => {
|
|
ok_number += item.count_ok;
|
|
});
|
|
this.form.count_ok = ok_number;
|
|
}
|
|
|
|
this.countChange();
|
|
},
|
|
//提交
|
|
submit() {
|
|
this.$refs.dialogForm.validate(async (valid) => {
|
|
if (valid) {
|
|
this.isSaveing = true;
|
|
if (this.activeType == "8车间") {
|
|
this.form.count_ok = this.form.count_real;
|
|
}
|
|
if (this.activeType == "7车间") {
|
|
this.form.mtask = this.mtask;
|
|
this.form.count_notok =
|
|
this.form.count_n_zw +
|
|
this.form.count_n_tw +
|
|
this.form.count_n_qp +
|
|
this.form.count_n_zt +
|
|
this.form.count_n_b +
|
|
this.form.count_n_zz +
|
|
this.form.count_n_qt;
|
|
} else if (this.activeType == "10车间") {
|
|
this.form.mtask = this.mtask;
|
|
this.form.count_notok =
|
|
this.form.count_n_wq +
|
|
this.form.count_n_tw +
|
|
this.form.count_n_dl +
|
|
this.form.count_n_pb +
|
|
this.form.count_n_dxt +
|
|
this.form.count_n_js +
|
|
this.form.count_n_qx;
|
|
if (this.mlogb.length > 0) {
|
|
let ok_number = 0;
|
|
this.mlogb.forEach((item) => {
|
|
ok_number += item.count_ok;
|
|
});
|
|
this.form.count_ok = ok_number;
|
|
}
|
|
} else if (this.activeType == "退火") {
|
|
// this.form.mgroup = "3428194648706011136";
|
|
this.form.count_notok =
|
|
this.form.count_n_xzp +
|
|
this.form.count_n_thhs +
|
|
this.form.count_n_hs +
|
|
this.form.count_n_js +
|
|
this.form.count_n_qx +
|
|
this.form.count_n_qt;
|
|
this.form.count_real =
|
|
this.form.count_ok + this.form.count_notok;
|
|
this.form.count_use = this.form.count_real;
|
|
}
|
|
if (this.activeType == "10车间") {
|
|
let mlogb = this.mlogb;
|
|
let newArr = [];
|
|
mlogb.forEach((item) => {
|
|
if (
|
|
item.count_ok !== null &&
|
|
item.count_ok !== ""
|
|
) {
|
|
newArr.push(item);
|
|
}
|
|
});
|
|
this.form.mlogb = newArr;
|
|
}
|
|
console.log(this.form.mlogb);
|
|
let sun = this.form.count_ok + this.form.count_notok;
|
|
if (
|
|
(this.activeType == "7车间" ||
|
|
this.activeType == "10车间") &&
|
|
sun != this.form.count_real
|
|
) {
|
|
this.isSaveing = false;
|
|
this.$message.error(
|
|
"合格总数与不合格总数与生产量/出管总数不对等"
|
|
);
|
|
} else {
|
|
if (this.mode == "add") {
|
|
this.$API.wpm.mlog.create
|
|
.req(this.form)
|
|
.then((res) => {
|
|
this.isSaveing = false;
|
|
this.$emit("success", this.form, this.mode);
|
|
this.visible = false;
|
|
this.$message.success("操作成功");
|
|
})
|
|
.catch((err) => {
|
|
//可以处理校验错误
|
|
this.isSaveing = false;
|
|
return err;
|
|
});
|
|
} else if (this.mode == "edit") {
|
|
this.$API.wpm.mlog.update
|
|
.req(this.form.id, this.form)
|
|
.then((res) => {
|
|
this.isSaveing = false;
|
|
this.$emit("success", this.form, this.mode);
|
|
this.visible = false;
|
|
this.$message.success("操作成功");
|
|
})
|
|
.catch((err) => {
|
|
//可以处理校验错误
|
|
this.isSaveing = false;
|
|
return err;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
});
|
|
},
|
|
//表单注入数据
|
|
setData(data) {
|
|
Object.assign(this.form, data);
|
|
// if (this.activeType == "8车间") {
|
|
// if (this.form.handle_user.indexOf(",") > -1) {
|
|
// this.handle_user = this.form.handle_user.split(",");
|
|
// } else {
|
|
// this.handle_user = [this.form.handle_user];
|
|
// }
|
|
// } else {
|
|
this.form.rate =
|
|
(this.form.count_ok / this.form.count_real) * 100 + "%";
|
|
// }
|
|
},
|
|
//设置过滤项
|
|
setFilters(filters) {
|
|
this.selectionFilters = filters;
|
|
this.setFiltersVisible = true;
|
|
},
|
|
//
|
|
countChange() {
|
|
if (
|
|
this.form.count_real !== null &&
|
|
this.form.count_real !== "" &&
|
|
this.form.count_real !== 0
|
|
) {
|
|
if (
|
|
this.form.count_ok !== null &&
|
|
this.form.count_ok !== "" &&
|
|
this.form.count_ok !== 0
|
|
) {
|
|
this.form.rate =
|
|
(this.form.count_ok / this.form.count_real) * 100 + "%";
|
|
} else {
|
|
this.form.rate = null;
|
|
}
|
|
} else {
|
|
this.form.rate = null;
|
|
}
|
|
},
|
|
//选择
|
|
materialInChange(val) {
|
|
for (let i = 0; i < this.materialOptions.length; i++) {
|
|
if (this.materialOptions[i].id == val) {
|
|
this.form.material_out = data[0].material_out;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
.formTitle {
|
|
margin-bottom: 10px;
|
|
font-weight: 600;
|
|
}
|
|
</style>
|