Commit 944c38a1 by 杨树贤

新增页面关闭逻辑

parent 8bf96bad
...@@ -60,5 +60,45 @@ ...@@ -60,5 +60,45 @@
} }
}); });
form.on('submit(cancelAddSupplier)', function (data) {
admin.closeThisTabs();
});
form.on('submit(addSupplier)', function (data) {
let url = '/api/supplier/AddSupplier';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
layer.msg(res.err_msg, {icon: 6});
admin.closeThisTabs();
} else {
layer.msg(res.err_msg, {icon: 5});
//todo
}
}
return false;
});
form.on('submit(addAndApplySupplier)', function (data) {
layer.confirm('确定直接申请审核吗?确定后会直接进入审核中的状态,无法进行二次修改', function (index) {
//还要判断
let url = '/api/supplier/AddSupplier?direct_apply=1';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
layer.msg(res.err_msg, {icon: 6});
admin.closeThisTabs();
} else {
layer.msg(res.err_msg, {icon: 5});
}
}
});
return false;
});
}); });
</script> </script>
\ No newline at end of file
...@@ -174,46 +174,5 @@ ...@@ -174,46 +174,5 @@
data: regionData, data: regionData,
selected: provinceCity selected: provinceCity
}); });
form.on('submit(cancelAddSupplier)', function (data) {
admin.closeThisDialog();
});
form.on('submit(addSupplier)', function (data) {
let url = '/api/supplier/AddSupplier';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
} else {
parent.layer.msg(res.err_msg, {icon: 5});
//todo
}
}
return false;
});
form.on('submit(addAndApplySupplier)', function (data) {
layer.confirm('确定直接申请审核吗?确定后会直接进入审核中的状态,无法进行二次修改', function (index) {
//还要判断
let url = '/api/supplier/AddSupplier?direct_apply=1';
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
} else {
parent.layer.msg(res.err_msg, {icon: 5});
}
}
});
return false;
});
}); });
</script> </script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment