mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-11 06:07:24 +08:00
优化投诉建议编辑不刷新bug
This commit is contained in:
parent
416179de8b
commit
78cdb2ba7e
@ -1,4 +1,4 @@
|
|||||||
(function (vc, vm) {
|
(function(vc, vm) {
|
||||||
vc.extends({
|
vc.extends({
|
||||||
data: {
|
data: {
|
||||||
editComplaintInfo: {
|
editComplaintInfo: {
|
||||||
@ -9,10 +9,9 @@
|
|||||||
context: ''
|
context: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_initMethod: function () {
|
_initMethod: function() {},
|
||||||
},
|
_initEvent: function() {
|
||||||
_initEvent: function () {
|
vc.on('editComplaint', 'openEditComplaintModal', function(_params) {
|
||||||
vc.on('editComplaint', 'openEditComplaintModal', function (_params) {
|
|
||||||
vc.component.refreshEditComplaintInfo();
|
vc.component.refreshEditComplaintInfo();
|
||||||
$('#editComplaintModel').modal('show');
|
$('#editComplaintModel').modal('show');
|
||||||
vc.copyObject(_params, vc.component.editComplaintInfo);
|
vc.copyObject(_params, vc.component.editComplaintInfo);
|
||||||
@ -20,12 +19,11 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
editComplaintValidate: function () {
|
editComplaintValidate: function() {
|
||||||
return vc.validate.validate({
|
return vc.validate.validate({
|
||||||
editComplaintInfo: vc.component.editComplaintInfo
|
editComplaintInfo: vc.component.editComplaintInfo
|
||||||
}, {
|
}, {
|
||||||
'editComplaintInfo.typeCd': [
|
'editComplaintInfo.typeCd': [{
|
||||||
{
|
|
||||||
limit: "required",
|
limit: "required",
|
||||||
param: "",
|
param: "",
|
||||||
errInfo: "投诉类型不能为空"
|
errInfo: "投诉类型不能为空"
|
||||||
@ -36,8 +34,7 @@
|
|||||||
errInfo: "投诉类型格式错误"
|
errInfo: "投诉类型格式错误"
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'editComplaintInfo.complaintName': [
|
'editComplaintInfo.complaintName': [{
|
||||||
{
|
|
||||||
limit: "required",
|
limit: "required",
|
||||||
param: "",
|
param: "",
|
||||||
errInfo: "投诉人不能为空"
|
errInfo: "投诉人不能为空"
|
||||||
@ -48,8 +45,7 @@
|
|||||||
errInfo: "投诉人不能大于200位"
|
errInfo: "投诉人不能大于200位"
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'editComplaintInfo.tel': [
|
'editComplaintInfo.tel': [{
|
||||||
{
|
|
||||||
limit: "required",
|
limit: "required",
|
||||||
param: "",
|
param: "",
|
||||||
errInfo: "投诉电话不能为空"
|
errInfo: "投诉电话不能为空"
|
||||||
@ -60,8 +56,7 @@
|
|||||||
errInfo: "投诉电话格式错误"
|
errInfo: "投诉电话格式错误"
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'editComplaintInfo.context': [
|
'editComplaintInfo.context': [{
|
||||||
{
|
|
||||||
limit: "required",
|
limit: "required",
|
||||||
param: "",
|
param: "",
|
||||||
errInfo: "投诉内容不能为空"
|
errInfo: "投诉内容不能为空"
|
||||||
@ -72,16 +67,14 @@
|
|||||||
errInfo: "投诉状态超过4000位"
|
errInfo: "投诉状态超过4000位"
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'editComplaintInfo.complaintId': [
|
'editComplaintInfo.complaintId': [{
|
||||||
{
|
limit: "required",
|
||||||
limit: "required",
|
param: "",
|
||||||
param: "",
|
errInfo: "投诉ID不能为空"
|
||||||
errInfo: "投诉ID不能为空"
|
}]
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editComplaint: function () {
|
editComplaint: function() {
|
||||||
if (!vc.component.editComplaintValidate()) {
|
if (!vc.component.editComplaintValidate()) {
|
||||||
vc.toast(vc.validate.errInfo);
|
vc.toast(vc.validate.errInfo);
|
||||||
return;
|
return;
|
||||||
@ -89,26 +82,26 @@
|
|||||||
vc.http.post(
|
vc.http.post(
|
||||||
'editComplaint',
|
'editComplaint',
|
||||||
'update',
|
'update',
|
||||||
JSON.stringify(vc.component.editComplaintInfo),
|
JSON.stringify(vc.component.editComplaintInfo), {
|
||||||
{
|
|
||||||
emulateJSON: true
|
emulateJSON: true
|
||||||
},
|
},
|
||||||
function (json, res) {
|
function(json, res) {
|
||||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
//关闭model
|
//关闭model
|
||||||
$('#editComplaintModel').modal('hide');
|
$('#editComplaintModel').modal('hide');
|
||||||
vc.emit('complaintManage', 'listComplaint', {});
|
vc.emit('complaintManage', 'listComplaint', {});
|
||||||
|
vc.emit('myAuditComplaints', 'list', {});
|
||||||
vc.toast("修改成功");
|
vc.toast("修改成功");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errInfo, error) {
|
function(errInfo, error) {
|
||||||
console.log('请求失败处理');
|
console.log('请求失败处理');
|
||||||
vc.toast(errInfo);
|
vc.toast(errInfo);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
refreshEditComplaintInfo: function () {
|
refreshEditComplaintInfo: function() {
|
||||||
vc.component.editComplaintInfo = {
|
vc.component.editComplaintInfo = {
|
||||||
complaintId: '',
|
complaintId: '',
|
||||||
typeCd: '',
|
typeCd: '',
|
||||||
@ -119,4 +112,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})(window.vc, window.vc.component);
|
})(window.vc, window.vc.component);
|
||||||
Loading…
Reference in New Issue
Block a user