4/22 修改可以重复选入

20240109-yw
wangwei 1 year ago
parent 9b5de1f857
commit 2b20cf56e1

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-form :model="inputQuery" label-width="120px" :rules="rules"> <el-form :model="inputQuery" label-width="120px" :rules="rules" ref="inputQuery">
<el-card> <el-card>
<el-row> <el-row>
<div style="margin: 0px 60px 10px auto; height: 35px; float: right;"> <div style="margin: 0px 60px 10px auto; height: 35px; float: right;">
@ -8,7 +8,7 @@
<el-button <el-button
type="primary" type="primary"
ref="mainTable" ref="mainTable"
@click.native.stop="addSet()" @click.native.stop="addSet('inputQuery')"
:loading="loading" :loading="loading"
>保存 >保存
</el-button </el-button
@ -285,7 +285,7 @@ export default {
frequency: [ frequency: [
{required: true, message: '请输入周期', trigger: 'blur'}, {required: true, message: '请输入周期', trigger: 'blur'},
], ],
} },
} }
}, },
methods: { methods: {
@ -388,7 +388,7 @@ export default {
} }
saveSet(this.inputQuery,"add").then((response) => { saveSet(this.inputQuery,"add").then((response) => {
if(response.code == 20000){ if(response.code == 20000){
this.$message.error("添加成功"); this.$message.success("添加成功");
this.inputQuery.id = response.data.id; this.inputQuery.id = response.data.id;
this.relationId = this.inputQuery.id; this.relationId = this.inputQuery.id;
this.productVisible = true; this.productVisible = true;
@ -421,42 +421,48 @@ export default {
this.fromOptions = []; this.fromOptions = [];
}); });
}, },
addSet(){ addSet(inputQuery){
if (this.actDateRange !== null) { this.$refs[inputQuery].validate((valid) => {
this.inputQuery.startDate = this.actDateRange[0]+" 00:00:00"; if (valid) {
this.inputQuery.endDate = this.actDateRange[1]+" 23:59:59"; if (this.actDateRange !== null) {
} else { this.inputQuery.startDate = this.actDateRange[0]+" 00:00:00";
this.inputQuery.startDate = null; this.inputQuery.endDate = this.actDateRange[1]+" 23:59:59";
this.inputQuery.endDate = null; } else {
} this.inputQuery.startDate = null;
this.inputQuery.endDate = null;
if(!this.inputQuery.id){
saveSet(this.inputQuery,"add").then((response) => {
if(response.code == 20000){
this.inputQuery.id = response.data.id;
this.closeDialog()
}else{
this.$message.error(response.message);
} }
if(!this.inputQuery.id){
saveSet(this.inputQuery,"add").then((response) => {
if(response.code == 20000){
this.inputQuery.id = response.data.id;
this.closeDialog()
}else{
this.$message.error(response.message);
}
}) })
.catch(() => { .catch(() => {
this.$message.error("添加失败"); this.$message.error("添加失败");
}); });
}else{
saveSet(this.inputQuery,"edit").then((response) => {
if(response.code == 20000){
this.closeDialog()
}else{ }else{
this.$message.error(response.message); saveSet(this.inputQuery,"edit").then((response) => {
} if(response.code == 20000){
this.closeDialog()
}else{
this.$message.error(response.message);
}
}) })
.catch((e) => { .catch((e) => {
console.log(e) console.log(e)
this.$message.error("修改失败"); this.$message.error("修改失败");
}); });
} }
} else {
console.log('error submit!!');
return false;
}
});
}, },
executeFuc(row,type,clickFuc,value){ executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value); return executeFuc(this,row,type,clickFuc,value);

@ -176,9 +176,9 @@ export default {
this.showSearch = !this.showSearch; this.showSearch = !this.showSearch;
}, },
checkSelectable(row) { // checkSelectable(row) {
return !row.check; // return !row.check;
}, // },
diDetail(row) { diDetail(row) {
this.diDetails = row; this.diDetails = row;
@ -220,10 +220,12 @@ export default {
this.combineQuery.products.push(obj); this.combineQuery.products.push(obj);
}); });
} }
if (selected != null) {
this.$message.warning("产品:" + selected.cpmctymc + "已被选入"); // if (selected != null) {
return; // this.$message.warning("" + selected.cpmctymc + "");
} // return;
// }
this.combineLoading = true; this.combineLoading = true;
this.combine(); this.combine();
}, },

Loading…
Cancel
Save