线体管理修改

yangwl
shaoyong 6 months ago
parent 355443c250
commit 4359431fb1

@ -33,7 +33,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标准效率(%)" prop="efficiency">
<el-form-item label="标准效率" prop="efficiency">
<el-input
v-model="queryParams.efficiency"
type="number"
@ -119,7 +119,7 @@
<el-table-column label="线体编码" align="center" prop="lineCode" />
<el-table-column label="线体名称" align="center" prop="lineName" />
<el-table-column label="标准用人" align="center" prop="useMan" />
<el-table-column label="标准效率(%)" align="center" prop="efficiency" />
<el-table-column label="标准效率" align="center" prop="efficiency" />
<el-table-column label="检验工具" align="center" prop="attr1" />
<el-table-column
label="操作"
@ -156,27 +156,41 @@
/>
<!-- 添加或修改线体管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="标准用人" prop="useMan">
<el-input v-model="form.useMan" type="number" placeholder="请输入标准用人" />
</el-form-item>
<el-form-item label="标准效率(%)" prop="efficiency">
<el-input v-model="form.efficiency" type="number" placeholder="请输入标准效率" />
</el-form-item>
<el-form-item label="检验工具" prop="attr1">
<el-input v-model="form.attr1" placeholder="请输入检验工具" />
</el-form-item>
<el-form-item
v-for="(item, index) in processItems"
:label="'第' + (index+1) +'道工艺'"
:key="item.key"
:prop="'processItems.'+index+'.value'"
:rules="{required: true, message: '请输入工艺', trigger: 'blur'}"
>
<el-input v-model="item.value" style="width: 70%;" placeholder="请输入工艺"></el-input>
<el-button @click.prevent="removeProcessItem(item)" style="margin-left:30px">删除</el-button>
</el-form-item>
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-row gutter="10">
<el-col :span="8">
<el-form-item label="标准用人" prop="useMan">
<el-input v-model="form.useMan" type="number" placeholder="请输入标准用人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="标准效率" prop="efficiency">
<el-input v-model="form.efficiency" type="number" placeholder="请输入标准效率" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检验工具" prop="attr1">
<el-input v-model="form.attr1" placeholder="请输入检验工具" />
</el-form-item>
</el-col>
</el-row>
<el-row gutter="10">
<el-col :span="24">
<el-form-item
v-for="(item, index) in processItems"
:label="'第' + (index+1) +'道工艺'"
:key="item.key"
:prop="'processItems.'+index+'.value'"
:rules="{required: true, message: '请输入工艺', trigger: 'blur'}"
>
<el-input v-model="item.value" style="width: 35%;" placeholder="请输入工艺"></el-input>
<label for="dis-people" style="padding: 0 10px;">人员分配</label>
<el-input id="dis-people" type="number" v-model="item.quality" style="width: 30%;" placeholder="请输入数量"></el-input>
<el-button @click.prevent="removeProcessItem(item)" style="margin-left:30px">删除</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -249,7 +263,8 @@ export default {
},
processItems:[{
value: '',
key: Date.now()
key: Date.now(),
quality: 0
}],
};
},
@ -290,6 +305,7 @@ export default {
factoryCode: null,
delFlag: null,
processList: [],
qualityList: [],
processItems: [{
value: '',
key: Date.now()
@ -330,10 +346,11 @@ export default {
getMesLine(id).then((response) => {
this.form = response.data;
if (response.data.processList !== null) {
this.processItems = response.data.processList.map(item => {
this.processItems = response.data.processList.map((item, index) => {
return {
value: item,
key: Date.now(),
quality: response.data.qualityList[index],
};
});
this.form.processItems = this.processItems;
@ -348,6 +365,7 @@ export default {
if (valid) {
if (this.form.id != null) {
this.form.processList = this.form.processItems.map(item => item.value);
this.form.qualityList = this.form.processItems.map(item => item.quality);
updateMesLine(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
@ -406,7 +424,8 @@ export default {
addProcessItem() {
this.processItems.push({
value: '',
key: Date.now()
key: Date.now(),
quanlity: ''
});
this.form.processItems = this.processItems;
},

Loading…
Cancel
Save