修改bug
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-09 14:49:16
|
||||
* @LastEditTime: 2023-11-23 09:20:12
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -53,7 +53,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="drawer-body__footer">
|
||||
<div v-if="isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
设备物料明细
|
||||
设备参数
|
||||
</small-title>
|
||||
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
@@ -100,7 +100,8 @@ import {
|
||||
updateProcessEquValueBom,
|
||||
getEquipmentList,
|
||||
processEquValueBomDetPage,
|
||||
deleteProcessEquValueBomDet
|
||||
deleteProcessEquValueBomDet,
|
||||
getValueCode
|
||||
} from '@/api/extend/processEquValueBom';
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
@@ -208,7 +209,6 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
getCode(val) {
|
||||
@@ -234,6 +234,9 @@ export default {
|
||||
// console.log(response);
|
||||
this.equipmentList = res.data
|
||||
})
|
||||
getValueCode().then(res => {
|
||||
this.dataForm.code = res.data
|
||||
})
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
@@ -277,8 +280,9 @@ export default {
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
init(id, isdetail) {
|
||||
this.getDict()
|
||||
this.initData()
|
||||
console.log(isdetail);
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-08 15:30:27
|
||||
* @LastEditTime: 2023-11-09 14:44:49
|
||||
* @LastEditTime: 2023-11-23 14:26:54
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -18,19 +18,19 @@
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="参数名称" prop="paramId">
|
||||
<el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData">
|
||||
<el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData" multiple >
|
||||
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="参数编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="请输入参数编码" clearable />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="标准最小值" prop="standardMinValue">
|
||||
<!-- <el-form-item label="标准最小值" prop="standardMinValue">
|
||||
<el-input v-model="dataForm.standardMinValue" placeholder="请输入标准最小值" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准最大值" prop="standardMaxValue">
|
||||
<el-input v-model="dataForm.standardMaxValue" placeholder="请输入标准最大值" clearable />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="工艺最小值" prop="minValue">
|
||||
<el-input v-model="dataForm.minValue" placeholder="请输入工艺最小值" clearable />
|
||||
</el-form-item>
|
||||
@@ -55,7 +55,7 @@
|
||||
<script>
|
||||
import {
|
||||
getProcessEquValueBomDet,
|
||||
createProcessEquValueBomDet,
|
||||
createProcessEquValueBomDetList,
|
||||
updateProcessEquValueBomDet,
|
||||
getValueList
|
||||
} from '@/api/extend/processEquValueBom';
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
bomId: undefined,
|
||||
paramId:undefined,
|
||||
paramId:[],
|
||||
minValue:undefined,
|
||||
maxValue: undefined,
|
||||
defaultValue: undefined,
|
||||
@@ -117,6 +117,10 @@ export default {
|
||||
id: this.dataForm.id
|
||||
}).then((res) => {
|
||||
this.dataForm = res.data;
|
||||
const arr = []
|
||||
arr.push(res.data.paramId)
|
||||
this.dataForm.paramId = arr
|
||||
console.log(this.dataForm.paramId);
|
||||
// this.dataForm.materialId = materialId;
|
||||
// this.dataForm.value = value;
|
||||
});
|
||||
@@ -137,22 +141,41 @@ export default {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
if (this.dataForm.id) {
|
||||
const dataObj = {
|
||||
paramId: this.dataForm.paramId.toString(),
|
||||
bomId: this.dataForm.bomId,
|
||||
minValue: this.dataForm.minValue,
|
||||
maxValue: this.dataForm.maxValue,
|
||||
defaultValue: this.dataForm.defaultValue,
|
||||
standardMinValue: this.dataForm.standardMinValue,
|
||||
standardMaxValue: this.dataForm.standardMaxValue,
|
||||
remark: this.dataForm.remark,
|
||||
id: this.dataForm.id
|
||||
}
|
||||
updateProcessEquValueBomDet({
|
||||
...this.dataForm,
|
||||
productId: this.productId,
|
||||
...dataObj,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
const dataArr = this.dataForm.paramId.map(ele => {
|
||||
return {
|
||||
paramId: ele,
|
||||
bomId: this.dataForm.bomId,
|
||||
minValue: this.dataForm.minValue,
|
||||
maxValue: this.dataForm.maxValue,
|
||||
defaultValue: this.dataForm.defaultValue,
|
||||
standardMinValue: this.dataForm.standardMinValue,
|
||||
standardMaxValue: this.dataForm.standardMaxValue,
|
||||
remark: this.dataForm.remark
|
||||
}
|
||||
});
|
||||
// 添加的提交
|
||||
createProcessEquValueBomDet({
|
||||
...this.dataForm,
|
||||
productId: this.productId,
|
||||
}).then((response) => {
|
||||
createProcessEquValueBomDetList(dataArr).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
|
||||
Reference in New Issue
Block a user