|
|
@@ -245,26 +245,34 @@ let ruleFormRef = ref(null);
|
|
|
async function addAgency() {
|
|
|
ruleFormRef.value.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- let res = await api.addAgency({
|
|
|
+ let { data } = await api.addAgency({
|
|
|
...ruleForm.value,
|
|
|
loginAccountId: loginAccountId.value,
|
|
|
});
|
|
|
- console.log(res);
|
|
|
- let status = res.data.status == 0;
|
|
|
- ElNotification({
|
|
|
- title: status ? "成功" : "失败",
|
|
|
- duration: 1500,
|
|
|
- message: res.data.msg,
|
|
|
- type: status ? "success" : "error",
|
|
|
- });
|
|
|
- resetForm();
|
|
|
- getAgencyList();
|
|
|
+
|
|
|
+ if (data.status === 0) {
|
|
|
+ ElNotification({
|
|
|
+ title: "成功",
|
|
|
+ duration: 1500,
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ resetForm();
|
|
|
+ getAgencyList();
|
|
|
+ } else {
|
|
|
+ ElNotification({
|
|
|
+ title: "失败",
|
|
|
+ duration: 1500,
|
|
|
+ message: data.msg,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function resetForm() {
|
|
|
visable.value = false;
|
|
|
- form.value.resetFields();
|
|
|
+ ruleFormRef.value.resetFields();
|
|
|
}
|
|
|
|
|
|
function closeModal() {
|