|
@@ -109,7 +109,7 @@
|
|
|
import producetask from '@/api/technology/production';
|
|
import producetask from '@/api/technology/production';
|
|
|
import parameter from '@/api/technology/parameter';
|
|
import parameter from '@/api/technology/parameter';
|
|
|
import Paramrter from './parameter';
|
|
import Paramrter from './parameter';
|
|
|
-
|
|
|
|
|
|
|
+ import { deepClone } from '@/components/FormGenerator/utils/index';
|
|
|
export default {
|
|
export default {
|
|
|
components: { Paramrter },
|
|
components: { Paramrter },
|
|
|
props: {
|
|
props: {
|
|
@@ -153,21 +153,21 @@
|
|
|
slot: 'maxValue',
|
|
slot: 'maxValue',
|
|
|
label: '参数上限',
|
|
label: '参数上限',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
|
|
+ // showOverflowTooltip: true
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'minValue',
|
|
prop: 'minValue',
|
|
|
slot: 'minValue',
|
|
slot: 'minValue',
|
|
|
label: '参数下限',
|
|
label: '参数下限',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
|
|
+ // showOverflowTooltip: true
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'defaultValue',
|
|
prop: 'defaultValue',
|
|
|
slot: 'defaultValue',
|
|
slot: 'defaultValue',
|
|
|
label: '默认值',
|
|
label: '默认值',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
|
|
+ // showOverflowTooltip: true
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'notNull',
|
|
prop: 'notNull',
|
|
@@ -196,7 +196,7 @@
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
addParamrter() {
|
|
addParamrter() {
|
|
|
- let arr = this.$refs.Paramrter.selection;
|
|
|
|
|
|
|
+ let arr = deepClone(this.$refs.Paramrter.selection)
|
|
|
arr.forEach((element) => {
|
|
arr.forEach((element) => {
|
|
|
this.$set(element, 'paramId', element.id);
|
|
this.$set(element, 'paramId', element.id);
|
|
|
this.$set(element, 'paramName', element.name);
|
|
this.$set(element, 'paramName', element.name);
|
|
@@ -208,7 +208,7 @@
|
|
|
this.closeAdd();
|
|
this.closeAdd();
|
|
|
},
|
|
},
|
|
|
showAddLog() {
|
|
showAddLog() {
|
|
|
- this.tableData = this.$refs.table.getData();
|
|
|
|
|
|
|
+ this.tableData = this.$refs.table.getData()
|
|
|
this.addDialog = true;
|
|
this.addDialog = true;
|
|
|
},
|
|
},
|
|
|
/*关闭选择参数*/
|
|
/*关闭选择参数*/
|
|
@@ -252,18 +252,49 @@
|
|
|
this.$set(it, 'taskId', this.data.id);
|
|
this.$set(it, 'taskId', this.data.id);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- producetask
|
|
|
|
|
- .paramSave({
|
|
|
|
|
- removeList: this.removeList,
|
|
|
|
|
- saveList: arr
|
|
|
|
|
- })
|
|
|
|
|
- .then((msg) => {
|
|
|
|
|
- if(msg){
|
|
|
|
|
- this.$message.success(msg);
|
|
|
|
|
- this.updateVisible(false);
|
|
|
|
|
|
|
+ if(!arr.length){
|
|
|
|
|
+ return this.$message.warning('参数不能为空')
|
|
|
|
|
+ }
|
|
|
|
|
+ let canSave = true
|
|
|
|
|
+ for(var i=0;i<arr.length;i++){
|
|
|
|
|
+ const defaultValue = arr[i].defaultValue
|
|
|
|
|
+ const maxValue = arr[i].maxValue
|
|
|
|
|
+ const minValue = arr[i].minValue
|
|
|
|
|
+ if(defaultValue!=''&maxValue!=''){
|
|
|
|
|
+ if(defaultValue>maxValue||defaultValue==maxValue){
|
|
|
|
|
+ this.$message.warning('默认值应小于参数上限')
|
|
|
|
|
+ canSave = false
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(defaultValue!=''&minValue!=''){
|
|
|
|
|
+ if(defaultValue<minValue||defaultValue==minValue){
|
|
|
|
|
+ this.$message.warning('默认值应大于参数下限')
|
|
|
|
|
+ canSave = false
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(maxValue!=''&minValue!=''){
|
|
|
|
|
+ if(maxValue<minValue||maxValue==minValue){
|
|
|
|
|
+ this.$message.warning('参数上限应大于参数下限')
|
|
|
|
|
+ canSave = false
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(canSave){
|
|
|
|
|
+ producetask
|
|
|
|
|
+ .paramSave({
|
|
|
|
|
+ removeList: this.removeList,
|
|
|
|
|
+ saveList: arr
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((msg) => {
|
|
|
|
|
+ if(msg){
|
|
|
|
|
+ this.$message.success(msg);
|
|
|
|
|
+ this.updateVisible(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
// this.$refs.form.validate((valid) => {
|
|
// this.$refs.form.validate((valid) => {
|
|
|
// if (!valid) {
|
|
// if (!valid) {
|
|
|
// return false;
|
|
// return false;
|