|
@@ -306,15 +306,30 @@
|
|
|
},
|
|
|
submitForm() {
|
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
|
+ let type = {
|
|
|
+ Type: this.dictionary.dictionaryType,
|
|
|
+ GroupId: this.dictionary.groupId,
|
|
|
+ ProjectId: this.dictionary.projectId,
|
|
|
+ }
|
|
|
if (valid) {
|
|
|
- console.log(this.ruleForm);
|
|
|
if (this.$route.params.ProdID) {//修改
|
|
|
- prodTypeUpdate([{ProdID:this.$route.params.ProdID, ...this.ruleForm}], res => {
|
|
|
+ let params = {
|
|
|
+ Content: [{ProdID: this.$route.params.ProdID, ...this.ruleForm}]
|
|
|
+ }
|
|
|
+ prodTypeUpdate(params, res => {
|
|
|
this.$message.success('修改成功!')
|
|
|
this.$router.go(-1)
|
|
|
})
|
|
|
} else {//添加
|
|
|
- prodTypeCreate([this.ruleForm], res => {
|
|
|
+ let param = Object.assign(this.ruleForm, {
|
|
|
+ Type: this.dictionary.dictionaryType,
|
|
|
+ GroupId: this.dictionary.groupId,
|
|
|
+ ProjectId: this.dictionary.projectId,
|
|
|
+ })
|
|
|
+ let params = {
|
|
|
+ Content: [param]
|
|
|
+ }
|
|
|
+ prodTypeCreate(params, res => {
|
|
|
this.$message.success('创建成功!')
|
|
|
this.$router.push('/product')
|
|
|
})
|
|
@@ -325,6 +340,29 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ resetForm() {
|
|
|
+ this.$refs.ruleForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let param = Object.assign(this.ruleForm, {
|
|
|
+ Type: this.dictionary.dictionaryType,
|
|
|
+ GroupId: this.dictionary.groupId,
|
|
|
+ ProjectId: this.dictionary.projectId,
|
|
|
+ })
|
|
|
+ let params = {
|
|
|
+ Content: [param]
|
|
|
+ }
|
|
|
+ prodTypeCreate(params, res => {
|
|
|
+ this.$message.success('创建成功!')
|
|
|
+ this.ruleForm.ProdParam = {}
|
|
|
+ this.ruleForm.ProdFile = {}
|
|
|
+ this.ruleForm.Model = ''
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
changeItem(files, code) {
|
|
|
this.ruleForm.ProdFile[code] = files
|
|
|
}
|