feat: 完成工艺与质量页面国际化

This commit is contained in:
zhangshun
2026-05-28 17:24:38 +08:00
parent f7a4641a6f
commit e7251c6ed8
7 changed files with 653 additions and 271 deletions

View File

@@ -2,8 +2,8 @@
<div class="app-container">
<el-card class="topCard">
<div class="topDiv">
<span style="margin-left: 10px">工位号</span>
<el-select v-model="stationNumberValue" clearable placeholder="请选择工位号" size="small" style="width: 250px" @change="searchOrder">
<span style="margin-left: 10px">{{ $t('materialVerificationMaintenance.stationNumberLabel') }}</span>
<el-select v-model="stationNumberValue" clearable :placeholder="$t('materialVerificationMaintenance.selectStationNumber')" size="small" style="width: 250px" @change="searchOrder">
<el-option
v-for="item in stationNumber"
:key="item.value"
@@ -11,8 +11,8 @@
:value="item.value"
size="mini"/>
</el-select>
<span style="margin-left: 10px">产品型号</span>
<el-select v-model="engineTypeValue" placeholder="请选择产品型号" size="small" style="width: 150px" @change="searchOrder">
<span style="margin-left: 10px">{{ $t('materialVerificationMaintenance.productModelLabel') }}</span>
<el-select v-model="engineTypeValue" :placeholder="$t('materialVerificationMaintenance.selectProductModel')" size="small" style="width: 150px" @change="searchOrder">
<el-option
v-for="item in engineType"
:key="item.value"
@@ -40,11 +40,11 @@
<!-- :value="item.value"-->
<!-- size="mini"/>-->
<!-- </el-select>-->
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchOrder()">查询物料</el-button>
<el-button type="primary" size="small" icon="el-icon-circle-plus" @click="creatOrder('form')">创建物料</el-button>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchOrder()">{{ $t('materialVerificationMaintenance.searchMaterial') }}</el-button>
<el-button type="primary" size="small" icon="el-icon-circle-plus" @click="creatOrder('form')">{{ $t('materialVerificationMaintenance.createMaterial') }}</el-button>
<!-- <el-button type="success" size="small" plain icon="el-icon-document-copy" @click="copyOrder('form4')">复制物料</el-button>-->
<!-- <el-button type="info" plain size="small" icon="el-icon-upload2" @click="importOrder('form')">物料导入</el-button>-->
<el-button type="warning" plain size="small" icon="el-icon-download" @click="exportExcel()">物料导出</el-button>
<el-button type="warning" plain size="small" icon="el-icon-download" @click="exportExcel()">{{ $t('materialVerificationMaintenance.exportMaterial') }}</el-button>
</div>
<el-table
v-loading="loading"
@@ -52,7 +52,7 @@
:data="tableData"
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
:cell-class-name="tableRowClassName"
element-loading-text="数据加载中"
:element-loading-text="$t('materialVerificationMaintenance.loadingData')"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.2)"
class="main"
@@ -62,13 +62,13 @@
border
size="mini"
@selection-change="handleSelectionChange">
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column type="index" width="60" :label="$t('materialVerificationMaintenance.sequence')" align="center"/>
<!-- <el-table-column align="center" label="物料号">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.物料号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="工位号" width="100px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.stationNumber')" width="100px">
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
@@ -78,7 +78,7 @@
<!-- {{ scope.row.版本号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="物料号" width="150px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.materialNumber')" width="150px">
<template slot-scope="scope">
{{ scope.row.物料号 }}
</template>
@@ -88,19 +88,19 @@
<!-- {{ scope.row.零件图号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="零件名称" min-width="120px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.partName')" min-width="120px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料数量" width="100px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.materialQuantity')" width="100px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="是否验证" width="100px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.isVerification')" width="100px">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否验证) === 1" size="mini" type="success"></el-tag>
<el-tag v-if="Number(scope.row.是否验证) === 1" size="mini" type="success">{{ $t('materialVerificationMaintenance.yes') }}</el-tag>
<span v-else>&nbsp;</span>
</template>
</el-table-column>
@@ -110,12 +110,12 @@
<!-- <span v-else>&nbsp;</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="匹配规则" width="150px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.matchRule')" width="150px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="匹配长度" width="100px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.matchLength')" width="120px">
<template slot-scope="scope">
<span v-if="Number(scope.row.是否验证) === 1">{{ scope.row.条码长度 }}</span>
<span v-else>&nbsp;</span>
@@ -133,29 +133,29 @@
<!-- <span v-if="Number(scope.row.是否主物料) === 0"></span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="操作" width="150">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.operation')" width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleEdit(scope.row)">修改</el-button>
@click="handleEdit(scope.row)">{{ $t('materialVerificationMaintenance.edit') }}</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
style="color:#ff0000;"
@click="deleteOrder(scope.row)">删除</el-button>
@click="deleteOrder(scope.row)">{{ $t('materialVerificationMaintenance.delete') }}</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="创建物料" center style="min-height: 200px;" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="80px">
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="$t('materialVerificationMaintenance.createMaterial')" center style="min-height: 200px;" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">
<el-select v-model="form.stationNumberValue" size="small" placeholder="请选择工位号">
<el-form-item :label="$t('materialVerificationMaintenance.stationNumber')" prop="stationNumberValue" style="display: inline-block">
<el-select v-model="form.stationNumberValue" size="small" :placeholder="$t('materialVerificationMaintenance.selectStationNumber')">
<el-option
v-for="item in stationNumber"
:key="item.value"
@@ -165,8 +165,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品型号" prop="engineTypeValue" style="display: inline-block">
<el-select v-model="form.engineTypeValue" size="small" placeholder="请选择产品型号">
<el-form-item :label="$t('materialVerificationMaintenance.productModel')" prop="engineTypeValue" style="display: inline-block">
<el-select v-model="form.engineTypeValue" size="small" :placeholder="$t('materialVerificationMaintenance.selectProductModel')">
<el-option
v-for="item in engineType1"
:key="item.value"
@@ -178,38 +178,38 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="物料号" prop="orderNumber" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.materialNumber')" prop="orderNumber" style="display: inline-block">
<el-input
v-model="form.orderNumber"
clearable
size="small"
placeholder="请输入物料号"/>
:placeholder="$t('materialVerificationMaintenance.enterMaterialNumber')"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料名称" prop="partName" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.materialName')" prop="partName" style="display: inline-block">
<el-input
v-model="form.partName"
clearable
size="small"
placeholder="物料名称"/>
:placeholder="$t('materialVerificationMaintenance.materialName')"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="数量" prop="number" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.quantity')" prop="number" style="display: inline-block">
<el-input-number
v-model="form.number"
:min="1"
:step="1"
size="small"
placeholder="请输入数量"/>
:placeholder="$t('materialVerificationMaintenance.enterQuantity')"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否验证" prop="verificationValue" style="display: inline-block">
<el-select v-model="form.verificationValue" size="small" placeholder="请选择产品型号" @change="changeIsVerification">
<el-form-item :label="$t('materialVerificationMaintenance.isVerification')" prop="verificationValue" style="display: inline-block">
<el-select v-model="form.verificationValue" size="small" :placeholder="$t('materialVerificationMaintenance.selectVerification')" @change="changeIsVerification">
<el-option
v-for="item in verification"
:key="item.value"
@@ -245,26 +245,26 @@
<!-- </el-col>-->
<!-- </el-row>-->
<el-row v-if="form.verificationValue === 1" style="margin: 10px 0">
<el-divider>验证规则设定</el-divider>
<el-divider>{{ $t('materialVerificationMaintenance.verificationRuleSetting') }}</el-divider>
</el-row>
<el-row v-if="form.verificationValue === 1">
<el-col :span="10">
<el-form-item label="规则" prop="verificationCode" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.rule')" prop="verificationCode" style="display: inline-block">
<el-input
v-model="form.verificationCode"
clearable
size="small"
placeholder="请输入匹配规则"/>
:placeholder="$t('materialVerificationMaintenance.enterMatchRule')"/>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="长度" prop="verificationLength" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.length')" prop="verificationLength" style="display: inline-block">
<el-input-number
v-model="form.verificationLength"
:min="1"
:step="1"
size="small"
placeholder="请输入匹配长度"/>
:placeholder="$t('materialVerificationMaintenance.enterMatchLength')"/>
</el-form-item>
</el-col>
<!-- <el-col :span="7">
@@ -280,12 +280,12 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff('form')">取消</el-button>
<el-button type="primary" size="small" @click="submitAdd('form')">确定</el-button>
<el-button size="small" @click="callOff('form')">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" size="small" @click="submitAdd('form')">{{ $t('common.confirm') }}</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="编辑物料" center style="min-height: 200px;" width="800px">
<el-form ref="form" :model="form1" :rules="rules1" label-position="right" label-width="80px">
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" :title="$t('materialVerificationMaintenance.editMaterial')" center style="min-height: 200px;" width="800px">
<el-form ref="form" :model="form1" :rules="rules1" label-position="right" label-width="120px">
<!-- <el-row>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="工位号" prop="stationNumberValue" style="display: inline-block">-->
@@ -308,49 +308,49 @@
<!-- </el-row>-->
<el-row>
<el-col :span="12">
<el-form-item label="物料号" prop="orderNumber" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.materialNumber')" prop="orderNumber" style="display: inline-block">
<el-input
v-model="form1.orderNumber"
readonly
size="small"
placeholder="请输入物料号"/>
:placeholder="$t('materialVerificationMaintenance.enterMaterialNumber')"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="版本号" prop="version" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.version')" prop="version" style="display: inline-block">
<el-input
v-model="form1.version"
readonly
size="small"
placeholder="请选择版本号"/>
:placeholder="$t('materialVerificationMaintenance.selectVersion')"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="物料名称" prop="partName" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.materialName')" prop="partName" style="display: inline-block">
<el-input
v-model="form1.partName"
clearable
size="small"
placeholder="物料名称"/>
:placeholder="$t('materialVerificationMaintenance.materialName')"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="number" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.quantity')" prop="number" style="display: inline-block">
<el-input-number
v-model="form1.number"
:min="1"
:step="1"
size="small"
placeholder="请输入数量"/>
:placeholder="$t('materialVerificationMaintenance.enterQuantity')"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否验证" prop="verificationValue" style="display: inline-block">
<el-select v-model="form1.verificationValue" size="small" placeholder="请选择产品型号">
<el-form-item :label="$t('materialVerificationMaintenance.isVerification')" prop="verificationValue" style="display: inline-block">
<el-select v-model="form1.verificationValue" size="small" :placeholder="$t('materialVerificationMaintenance.selectVerification')">
<el-option
v-for="item in verification"
:key="item.value"
@@ -372,26 +372,26 @@
</el-col>
</el-row>
<el-row v-if="form1.verificationValue === 1" style="margin: 10px 0">
<el-divider>验证规则设定</el-divider>
<el-divider>{{ $t('materialVerificationMaintenance.verificationRuleSetting') }}</el-divider>
</el-row>
<el-row v-if="form1.verificationValue === 1">
<el-col :span="10">
<el-form-item label="规则" prop="verificationCode" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.rule')" prop="verificationCode" style="display: inline-block">
<el-input
v-model="form1.verificationCode"
clearable
size="small"
placeholder="请输入匹配规则"/>
:placeholder="$t('materialVerificationMaintenance.enterMatchRule')"/>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="长度" prop="verificationLength" style="display: inline-block">
<el-form-item :label="$t('materialVerificationMaintenance.length')" prop="verificationLength" style="display: inline-block">
<el-input-number
v-model="form1.verificationLength"
:min="1"
:step="1"
size="small"
placeholder="请输入匹配长度"/>
:placeholder="$t('materialVerificationMaintenance.enterMatchLength')"/>
</el-form-item>
</el-col>
<!-- <el-col :span="7">
@@ -407,11 +407,11 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff1('form')">取消</el-button>
<el-button type="primary" size="small" @click="submitAdd1('form')">确定</el-button>
<el-button size="small" @click="callOff1('form')">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" size="small" @click="submitAdd1('form')">{{ $t('common.confirm') }}</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible3" title="物料导入" center style="min-height: 200px" width="1000px">
<el-dialog :visible.sync="dialogFormVisible3" :title="$t('materialVerificationMaintenance.materialImport')" center style="min-height: 200px" width="1000px">
<div class="app-container">
<upload-excel-component :on-success="handleSuccess" :before-upload="beforeUpload" />
<div style="margin-top: 5px">
@@ -420,50 +420,50 @@
ref="multipleTable"
:data="tableDataListAll"
:header-cell-style="{ background: '#F5F5F5', fontSize: '16px' }"
element-loading-text="数据加载中"
:element-loading-text="$t('materialVerificationMaintenance.loadingData')"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.2)"
height="300px"
style="width: 100%"
border
>
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column align="center" label="工位号" width="80px">
<el-table-column type="index" width="60" :label="$t('materialVerificationMaintenance.sequence')" align="center"/>
<el-table-column align="center" :label="$t('materialVerificationMaintenance.stationNumber')" width="80px">
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column align="center" label="产品型号" width="80px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.productModel')" width="80px">
<template slot-scope="scope">
{{ scope.row.产品型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料号" width="120px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.materialNumber')" width="120px">
<template slot-scope="scope">
{{ scope.row.物料号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称" min-width="120px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.partName')" min-width="120px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料数量" width="80px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.materialQuantity')" width="80px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="是否验证" width="80px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.isVerification')" width="80px">
<template slot-scope="scope">
{{ scope.row.是否验证 }}
</template>
</el-table-column>
<el-table-column align="center" label="匹配规则" width="120px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.matchRule')" width="120px">
<template slot-scope="scope">
{{ scope.row.匹配规则 }}
</template>
</el-table-column>
<el-table-column align="center" label="匹配长度" width="80px">
<el-table-column align="center" :label="$t('materialVerificationMaintenance.matchLength')" width="80px">
<template slot-scope="scope">
{{ scope.row.条码长度 }}
</template>
@@ -476,16 +476,16 @@
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="materialAddAllCancel()">取消</el-button>
<el-button type="primary" icon="el-icon-upload" size="small" @click="materialAddAllSubmit()">确认导入</el-button>
<el-button size="small" @click="materialAddAllCancel()">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" icon="el-icon-upload" size="small" @click="materialAddAllSubmit()">{{ $t('materialVerificationMaintenance.confirmImport') }}</el-button>
</div>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible4" title="数据复制" center style="min-height: 200px" width="400px">
<el-dialog :visible.sync="dialogFormVisible4" :title="$t('materialVerificationMaintenance.dataCopy')" center style="min-height: 200px" width="400px">
<el-form ref="form1" :model="form4" :rules="rules4" label-position="right" label-width="110px">
<el-form-item label="产品型号" prop="engineTypeValue" style="display: inline-block">
<el-select v-model="form4.engineTypeValue" placeholder="请选择产品型号" size="small">
<el-form-item :label="$t('materialVerificationMaintenance.productModel')" prop="engineTypeValue" style="display: inline-block">
<el-select v-model="form4.engineTypeValue" :placeholder="$t('materialVerificationMaintenance.selectProductModel')" size="small">
<el-option
v-for="item in engineType"
:key="item.value"
@@ -496,8 +496,8 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff4()">取消</el-button>
<el-button type="primary" size="small" @click="submitAdd4()">确定</el-button>
<el-button size="small" @click="callOff4()">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" size="small" @click="submitAdd4()">{{ $t('common.confirm') }}</el-button>
</div>
</el-dialog>
</div>
@@ -538,24 +538,8 @@ export default {
OKWarehouse: [],
NGWarehouseValue: '',
NGWarehouse: [],
verification: [
{
label: '否',
value: 0
}, {
label: '是',
value: 1
}
],
mainMaterial: [
{
label: '否',
value: 0
}, {
label: '是',
value: 1
}
],
verification: [],
mainMaterial: [],
form: { // 创建订单
partName: '',
stationNumberValue: '',
@@ -572,21 +556,7 @@ export default {
mainMaterialValue: 0,
batchValue: 0
},
rules: { // 创建订单验证
partName: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'change' }],
orderNumber: [{ required: true, message: '请输入物料号', trigger: 'blur' }],
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }],
// partDrawing: [{ required: true, message: '请输入零件图号', trigger: 'blur' }],
number: [{ required: true, message: '请输入数量', trigger: 'blur' }],
// manufactor: [{ required: true, message: '请输入生产厂家', trigger: 'blur' }],
verificationValue: [{ required: true, message: '请选择是否验证', trigger: 'change' }],
version: [{ required: true, message: '请选择物料版本', trigger: 'change' }],
verificationLength: [{ required: true, message: '请输入验证长度', trigger: 'blur' }],
verificationOrder: [{ required: true, message: '请输入验证顺序', trigger: 'blur' }],
verificationCode: [{ required: true, message: '请输入验证规则', trigger: 'blur' }]
// mainMaterialValue: [{ required: true, message: '请选择是否主物料', trigger: 'change' }]
},
rules: {},
form1: { // 修改订单
partName: '',
stationNumberValue: '',
@@ -604,19 +574,7 @@ export default {
batchValue: 0,
ID: ''
},
rules1: { // 修改订单验证
partName: [{ required: true, message: '请输入零件名称', trigger: 'blur' }],
// orderNumber: [{ required: true, message: '请输入物料号', trigger: 'blur' }],
// partDrawing: [{ required: true, message: '请输入零件图号', trigger: 'blur' }],
number: [{ required: true, message: '请输入数量', trigger: 'blur' }],
// manufactor: [{ required: true, message: '请输入生产厂家', trigger: 'blur' }],
verificationValue: [{ required: true, message: '请选择是否验证', trigger: 'change' }],
verificationLength: [{ required: true, message: '请输入验证长度', trigger: 'blur' }],
verificationOrder: [{ required: true, message: '请输入验证顺序', trigger: 'blur' }],
verificationCode: [{ required: true, message: '请输入验证规则', trigger: 'blur' }]
// stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'change' }]
// mainMaterialValue: [{ required: true, message: '请选择是否主物料', trigger: 'change' }]
},
rules1: {},
form2: { // 订单下发
planQuantity: '',
orderNumber: '',
@@ -627,9 +585,7 @@ export default {
form4: {
engineTypeValue: ''
},
rules4: { // 订单下发验证
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }]
},
rules4: {},
// planTime: [new Date(new Date().getTime() - 3600 * 1000 * 24 * 3000), new Date(new Date().getTime())],
planTime: [],
tableDataListAll: [],
@@ -648,8 +604,12 @@ export default {
}
},
watch: {
'$i18n.locale'() {
this.initI18nState()
}
},
created() {
this.initI18nState()
this.getStationNumber()
this.getEndStation()
this.getVersion()
@@ -658,6 +618,49 @@ export default {
}, 1000)
},
methods: {
initI18nState() {
this.verification = [
{
label: this.$t('materialVerificationMaintenance.no'),
value: 0
}, {
label: this.$t('materialVerificationMaintenance.yes'),
value: 1
}
]
this.mainMaterial = [
{
label: this.$t('materialVerificationMaintenance.no'),
value: 0
}, {
label: this.$t('materialVerificationMaintenance.yes'),
value: 1
}
]
this.rules = {
partName: [{ required: true, message: this.$t('materialVerificationMaintenance.enterMaterialNameRequired'), trigger: 'blur' }],
stationNumberValue: [{ required: true, message: this.$t('materialVerificationMaintenance.selectStationNumberRequired'), trigger: 'change' }],
orderNumber: [{ required: true, message: this.$t('materialVerificationMaintenance.enterMaterialNumberRequired'), trigger: 'blur' }],
engineTypeValue: [{ required: true, message: this.$t('materialVerificationMaintenance.selectEngineTypeRequired'), trigger: 'blur' }],
number: [{ required: true, message: this.$t('materialVerificationMaintenance.enterQuantityRequired'), trigger: 'blur' }],
verificationValue: [{ required: true, message: this.$t('materialVerificationMaintenance.selectVerificationRequired'), trigger: 'change' }],
version: [{ required: true, message: this.$t('materialVerificationMaintenance.selectMaterialVersionRequired'), trigger: 'change' }],
verificationLength: [{ required: true, message: this.$t('materialVerificationMaintenance.enterVerificationLengthRequired'), trigger: 'blur' }],
verificationOrder: [{ required: true, message: this.$t('materialVerificationMaintenance.enterVerificationOrderRequired'), trigger: 'blur' }],
verificationCode: [{ required: true, message: this.$t('materialVerificationMaintenance.enterVerificationRuleRequired'), trigger: 'blur' }]
}
this.rules1 = {
partName: [{ required: true, message: this.$t('materialVerificationMaintenance.enterPartNameRequired'), trigger: 'blur' }],
number: [{ required: true, message: this.$t('materialVerificationMaintenance.enterQuantityRequired'), trigger: 'blur' }],
verificationValue: [{ required: true, message: this.$t('materialVerificationMaintenance.selectVerificationRequired'), trigger: 'change' }],
verificationLength: [{ required: true, message: this.$t('materialVerificationMaintenance.enterVerificationLengthRequired'), trigger: 'blur' }],
verificationOrder: [{ required: true, message: this.$t('materialVerificationMaintenance.enterVerificationOrderRequired'), trigger: 'blur' }],
verificationCode: [{ required: true, message: this.$t('materialVerificationMaintenance.enterVerificationRuleRequired'), trigger: 'blur' }]
}
this.rules4 = {
engineTypeValue: [{ required: true, message: this.$t('materialVerificationMaintenance.selectEngineTypeRequired'), trigger: 'blur' }]
}
},
removeAll() {
this.worksheet = []
this.itemFile = []
@@ -803,12 +806,12 @@ export default {
this.ExecDatabase(Data).then(response => {
if (response.data[0]['result'] === '1') {
this.$message({
message: '物料增加成功!',
message: this.$t('materialVerificationMaintenance.materialAddSuccess'),
type: 'success'
})
this.searchOrder()
} else {
this.$message.error('物料增加失败!')
this.$message.error(this.$t('materialVerificationMaintenance.materialAddFailed'))
}
})
} else {
@@ -829,7 +832,7 @@ export default {
this.dialogFormVisible4 = true
} else {
this.$message({
message: '暂无可复制的数据!',
message: this.$t('materialVerificationMaintenance.noDataToCopy'),
type: 'error'
})
}
@@ -852,7 +855,7 @@ export default {
await this.submitAdd5(stationNumberValue, orderNumber, partName, partDrawing, manufactor, verificationValue, mainMaterialValue, number, batchValue)
}
this.$message({
message: '增加成功',
message: this.$t('materialVerificationMaintenance.addSuccess'),
type: 'success'
})
this.dialogFormVisible4 = false
@@ -888,9 +891,9 @@ export default {
},
// 删除订单
deleteOrder(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('materialVerificationMaintenance.confirmDelete'), this.$t('materialVerificationMaintenance.prompt'), {
confirmButtonText: this.$t('common.confirm'),
cancelButtonText: this.$t('common.cancel'),
type: 'warning'
}).then(() => {
var param = []
@@ -898,16 +901,16 @@ export default {
var Data = this.CreateData('12', '电子看板_装配零件_SPC_删除', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.$message.success(this.$t('materialVerificationMaintenance.deleteSuccess'))
this.searchOrder()
} else {
this.$message.error('删除失败')
this.$message.error(this.$t('materialVerificationMaintenance.deleteFailed'))
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
message: this.$t('materialVerificationMaintenance.deleteCanceled')
})
})
},
@@ -957,12 +960,12 @@ export default {
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message({
message: '修改成功',
message: this.$t('materialVerificationMaintenance.editSuccess'),
type: 'success'
})
this.searchOrder()
} else {
this.$message.error('修改失败!')
this.$message.error(this.$t('materialVerificationMaintenance.editFailed'))
}
})
this.dialogFormVisible1 = false
@@ -985,7 +988,7 @@ export default {
},
handleAdd() {
if (this.tableData.length === 0) {
this.$message.error('内容为空')
this.$message.error(this.$t('materialVerificationMaintenance.contentEmpty'))
} else {
var param = []
var Data = this.CreateData('11', '确认导入物料字典_新增', param)
@@ -996,7 +999,7 @@ export default {
this.notes = response.data[i].导入结果 + '、 ' + this.notes
}
this.$message({
message: '物料字典信息更新成功',
message: this.$t('materialVerificationMaintenance.materialDictionaryUpdated'),
type: 'warning'
})
this.isShow = true
@@ -1004,7 +1007,7 @@ export default {
} else {
this.tableData = []
this.$message({
message: '物料字典信息更新成功',
message: this.$t('materialVerificationMaintenance.materialDictionaryUpdated'),
type: 'success'
})
}
@@ -1077,10 +1080,10 @@ export default {
!manufactor && !engineTypeValue && !verificationValue && !mainMaterialValue && !isPreservation && !orderNumber) {
break
} else if (!orderNumber) { // 名称不能为空
this.$notify.error(`物料号不能为空`)
this.$notify.error(this.$t('materialVerificationMaintenance.materialNumberRequired'))
break
} else if (Number(partDrawing) <= 0) { // 数量不能为0
this.$notify.error(`零件图号不能为空`)
this.$notify.error(this.$t('materialVerificationMaintenance.partDrawingRequired'))
break
} else {
if (orderNumber) {
@@ -1100,21 +1103,21 @@ export default {
} else {
this.loading = false
this.disabled = false
this.$notify.error(`请确认导入文件是否正确`)
this.$notify.error(this.$t('materialVerificationMaintenance.confirmImportFile'))
return
}
}
}
this.itemFile.splice(j, 1)
this.worksheet.splice(j, 1)
this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败物料个数为${this.err},请检查文件是否正确`)
this.err === 0 ? this.$message.success(this.$t('materialVerificationMaintenance.importCompleted')) : this.$message.error(this.$t('materialVerificationMaintenance.importFailedCount', { count: this.err }))
}
this.loading = false
this.searchOrder()
} catch (e) {
this.err++
this.loading = false
this.$notify.error(`导入数据错误,请检查导入文件是否正确`)
this.$notify.error(this.$t('materialVerificationMaintenance.importDataErrorFile'))
console.log(`导入数据错误${e}`)
}
},
@@ -1149,13 +1152,13 @@ export default {
const response = await this.ExecDatabase(Data)
const res = response.data
if (res[0].result === '0') {
this.$notify.error(`${orderNumber}导入失败`)
this.$notify.error(this.$t('materialVerificationMaintenance.importFailedSuffix', { value: orderNumber }))
} else {
this.$notify.error(`${orderNumber}导入成功`)
this.$notify.error(this.$t('materialVerificationMaintenance.importSuccessSuffix', { value: orderNumber }))
}
} catch (e) {
this.err++
this.$message.error(`导入数据错误`)
this.$message.error(this.$t('materialVerificationMaintenance.importDataError'))
console.log(`导入数据错误${e}`)
}
},
@@ -1167,7 +1170,7 @@ export default {
var Data = this.CreateData('2001', '电子看板_装配零件_总物料表_导出新', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
this.$message.warning(this.$t('materialVerificationMaintenance.noData'))
}
},
beforeUpload(file) {
@@ -1193,21 +1196,21 @@ export default {
},
materialAddAllSubmit() {
if (this.tableDataListAll.length === 0) {
this.$message.error('内容为空')
this.$message.error(this.$t('materialVerificationMaintenance.contentEmpty'))
} else {
var param = []
var Data = this.CreateData('12', '电子看板_装配零件_物料BOM_导入临时表_确认导入', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0]['result'] === '1') {
this.$message.success('导入成功!')
this.$message.success(this.$t('materialVerificationMaintenance.importSuccess'))
this.dialogFormVisible3 = false
this.searchOrder()
} else {
this.$message.error('导入失败!')
this.$message.error(this.$t('materialVerificationMaintenance.importFailed'))
}
} else {
this.$message.error('导入失败!')
this.$message.error(this.$t('materialVerificationMaintenance.importFailed'))
}
})
}