cz il y a 1 an
Parent
commit
769e20331e
2 fichiers modifiés avec 64 ajouts et 3 suppressions
  1. 32 1
      src/views/customer/highseas/index.vue
  2. 32 2
      src/views/customer/privatesea/index.vue

+ 32 - 1
src/views/customer/highseas/index.vue

@@ -838,7 +838,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 140,
+        width: 180,
         align: "center",
         fixed: "right",
       },
@@ -857,6 +857,17 @@ const config = computed(() => {
           },
           {
             attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              update(row);
+            },
+          },
+          {
+            attrs: {
               label: "认领客户",
               type: "primary",
               text: true,
@@ -946,6 +957,7 @@ const formConfig = computed(() => {
       itemWidth: 100,
       data: userList.value,
       clearable: true,
+      disabled: modalType.value == "edit",
     },
     {
       type: "select",
@@ -1575,6 +1587,25 @@ const changeSearchTag = (val) => {
   addSearchTag.value = "";
 };
 
+const update = (row) => {
+  modalType.value = "edit";
+  loadingOperation.value = true;
+  proxy.post("/customer/detail", { id: row.id }).then((res) => {
+    if (res.tag) {
+      res.tags = res.tag.split(",");
+    } else {
+      res.tags = [];
+    }
+    formData.data = res;
+    getCityData(formData.data.countryId, "20");
+    if (formData.data.provinceId) {
+      getCityData(formData.data.provinceId, "30");
+    }
+    loadingOperation.value = false;
+    dialogVisible.value = true;
+  });
+};
+
 const table = ref(null);
 onMounted(() => {
   watch(

+ 32 - 2
src/views/customer/privatesea/index.vue

@@ -839,7 +839,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 140,
+        width: 180,
         align: "center",
         fixed: "right",
       },
@@ -858,6 +858,17 @@ const config = computed(() => {
           },
           {
             attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              update(row);
+            },
+          },
+          {
+            attrs: {
               label: "退回公海",
               type: "primary",
               text: true,
@@ -946,7 +957,7 @@ const formConfig = computed(() => {
       prop: "userId",
       itemWidth: 100,
       data: userList.value,
-      disabled: true,
+      disabled: modalType.value == "edit",
     },
     {
       type: "select",
@@ -1578,6 +1589,25 @@ const changeSearchTag = (val) => {
   addSearchTag.value = "";
 };
 
+const update = (row) => {
+  modalType.value = "edit";
+  loadingOperation.value = true;
+  proxy.post("/customer/detail", { id: row.id }).then((res) => {
+    if (res.tag) {
+      res.tags = res.tag.split(",");
+    } else {
+      res.tags = [];
+    }
+    formData.data = res;
+    getCityData(formData.data.countryId, "20");
+    if (formData.data.provinceId) {
+      getCityData(formData.data.provinceId, "30");
+    }
+    loadingOperation.value = false;
+    dialogVisible.value = true;
+  });
+};
+
 const table = ref(null);
 onMounted(() => {
   watch(