|
|
@ -229,7 +229,7 @@
|
|
|
|
}).then(callback);
|
|
|
|
}).then(callback);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
jsonRequest({
|
|
|
|
return jsonRequest({
|
|
|
|
url: '/ajax/' + this.mModule + "/" + this.mTarget + "/" + this.mMethod,
|
|
|
|
url: '/ajax/' + this.mModule + "/" + this.mTarget + "/" + this.mMethod,
|
|
|
|
data: JSON.stringify(data)
|
|
|
|
data: JSON.stringify(data)
|
|
|
|
}).then(callback);
|
|
|
|
}).then(callback);
|
|
|
@ -307,7 +307,7 @@
|
|
|
|
this.select = select;
|
|
|
|
this.select = select;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onTemplate: function () {
|
|
|
|
onTemplate: function () {
|
|
|
|
new Ajax(this.module, this.target, "template").post(function (response) {
|
|
|
|
new Ajax(this.module, this.target).method("template").post({}, function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -315,7 +315,7 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onImport: function (item) {
|
|
|
|
onImport: function (item) {
|
|
|
|
utils.selectFile(function (files) {
|
|
|
|
utils.selectFile(function (files) {
|
|
|
|
new Ajax(this.module, this.target, "imports", files[0]).post(function (response) {
|
|
|
|
new Ajax(this.module, this.target).method("imports").post(files[0], function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -323,7 +323,7 @@
|
|
|
|
}.bind(this))
|
|
|
|
}.bind(this))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onExport: function () {
|
|
|
|
onExport: function () {
|
|
|
|
new Ajax(this.module, this.target, "exports", this.vm).post(function (response) {
|
|
|
|
new Ajax(this.module, this.target).method("exports").post(this.vm, function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -333,7 +333,7 @@
|
|
|
|
this.$refs['form'].validate(function (valid) {
|
|
|
|
this.$refs['form'].validate(function (valid) {
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
if (this.form.id) {
|
|
|
|
if (this.form.id) {
|
|
|
|
new Ajax(this.module, this.target, "update", this.form).post(function (response) {
|
|
|
|
new Ajax(this.module, this.target).update(this.form, function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -343,7 +343,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}.bind(this))
|
|
|
|
}.bind(this))
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
new Ajax(this.module, this.target, "create", this.form).post(function (response) {
|
|
|
|
new Ajax(this.module, this.target).create(this.form, function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -359,7 +359,7 @@
|
|
|
|
}.bind(this));
|
|
|
|
}.bind(this));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onFind: function () {
|
|
|
|
onFind: function () {
|
|
|
|
new Ajax(this.module, this.target, "find", this.vm).post(function (response) {
|
|
|
|
new Ajax(this.module, this.target).find(this.vm, function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -374,7 +374,7 @@
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
type: 'warning'
|
|
|
|
type: 'warning'
|
|
|
|
}).then(function () {
|
|
|
|
}).then(function () {
|
|
|
|
new Ajax(this.module, this.target, "delete", {id: item.id}).post(function (response) {
|
|
|
|
new Ajax(this.module, this.target).delete({id: item.id}, function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -397,7 +397,7 @@
|
|
|
|
}).then(function () {
|
|
|
|
}).then(function () {
|
|
|
|
for (var i = 0; i < this.select.length; i++) {
|
|
|
|
for (var i = 0; i < this.select.length; i++) {
|
|
|
|
(function (obj) {
|
|
|
|
(function (obj) {
|
|
|
|
new Ajax(this.module, this.target, "delete", {id: obj.id}).post(function (response) {
|
|
|
|
new Ajax(this.module, this.target).delete({id: obj.id}, function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
nav.e(response.errors[0].message);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -698,7 +698,9 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created: function () {
|
|
|
|
created: function () {
|
|
|
|
if (this.dictName) {
|
|
|
|
if (this.dictName) {
|
|
|
|
new Ajax("system", "dict", "load").data({dictName: this.dictName}).post(function (response) {
|
|
|
|
new Ajax("system", "dict").method("load").post({
|
|
|
|
|
|
|
|
dictName: this.dictName
|
|
|
|
|
|
|
|
},function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
console.error(response.errors[0].message)
|
|
|
|
console.error(response.errors[0].message)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -750,7 +752,9 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created: function () {
|
|
|
|
created: function () {
|
|
|
|
new Ajax("system", "dept", "tree").data({dictName: this.dictName}).post(function (response) {
|
|
|
|
new Ajax("system", "dept").method("tree").post({
|
|
|
|
|
|
|
|
dictName: this.dictName
|
|
|
|
|
|
|
|
},function (response) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
if (response.errors.length > 0) {
|
|
|
|
console.error(response.errors[0].message)
|
|
|
|
console.error(response.errors[0].message)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|