Browse Source

客户置顶功能

lxf 1 year ago
parent
commit
307da96fb9

+ 27 - 0
src/views/customer/file/index.vue

@@ -15,6 +15,14 @@
           },
         ]"
         @get-list="getList">
+        <template #isTop="{ item }">
+          <div>
+            <el-icon style="color: red; cursor: pointer; font-size: 22px; transform: translateY(5px)" @click="deleteTop(item)" v-if="item.isTop === 1">
+              <Flag />
+            </el-icon>
+            <el-icon style="color: #b5b5b5; cursor: pointer; font-size: 22px; transform: translateY(5px)" @click="addTop(item)" v-else><Flag /></el-icon>
+          </div>
+        </template>
         <template #address="{ item }">
           <span>{{ item.countryName }}</span>
           <span v-if="item.provinceName"> ,{{ item.provinceName }}</span>
@@ -342,6 +350,15 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "",
+        slot: "isTop",
+        fixed: "left",
+        width: 60,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
         label: "客户名称",
         prop: "name",
         slot: "name",
@@ -1031,6 +1048,16 @@ const submitPerson = () => {
     }
   });
 };
+const deleteTop = (item) => {
+  proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
+    item.isTop = 0;
+  });
+};
+const addTop = (item) => {
+  proxy.post("/customerTop/add", { customerId: item.id }).then(() => {
+    item.isTop = 1;
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 27 - 0
src/views/customer/highseas/index.vue

@@ -15,6 +15,14 @@
           },
         ]"
         @get-list="getList">
+        <template #isTop="{ item }">
+          <div>
+            <el-icon style="color: red; cursor: pointer; font-size: 22px; transform: translateY(5px)" @click="deleteTop(item)" v-if="item.isTop === 1">
+              <Flag />
+            </el-icon>
+            <el-icon style="color: #b5b5b5; cursor: pointer; font-size: 22px; transform: translateY(5px)" @click="addTop(item)" v-else><Flag /></el-icon>
+          </div>
+        </template>
         <template #address="{ item }">
           <span>{{ item.countryName }}</span>
           <span v-if="item.provinceName"> ,{{ item.provinceName }}</span>
@@ -342,6 +350,15 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "",
+        slot: "isTop",
+        fixed: "left",
+        width: 60,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
         label: "客户名称",
         prop: "name",
         slot: "name",
@@ -1006,6 +1023,16 @@ const submitPerson = () => {
     }
   });
 };
+const deleteTop = (item) => {
+  proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
+    item.isTop = 0;
+  });
+};
+const addTop = (item) => {
+  proxy.post("/customerTop/add", { customerId: item.id }).then(() => {
+    item.isTop = 1;
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 27 - 0
src/views/customer/privatesea/index.vue

@@ -15,6 +15,14 @@
           },
         ]"
         @get-list="getList">
+        <template #isTop="{ item }">
+          <div>
+            <el-icon style="color: red; cursor: pointer; font-size: 22px; transform: translateY(5px)" @click="deleteTop(item)" v-if="item.isTop === 1">
+              <Flag />
+            </el-icon>
+            <el-icon style="color: #b5b5b5; cursor: pointer; font-size: 22px; transform: translateY(5px)" @click="addTop(item)" v-else><Flag /></el-icon>
+          </div>
+        </template>
         <template #address="{ item }">
           <span>{{ item.countryName }}</span>
           <span v-if="item.provinceName"> ,{{ item.provinceName }}</span>
@@ -333,6 +341,15 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "",
+        slot: "isTop",
+        fixed: "left",
+        width: 60,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
         label: "客户名称",
         prop: "name",
         slot: "name",
@@ -940,6 +957,16 @@ const submitPerson = () => {
     }
   });
 };
+const deleteTop = (item) => {
+  proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
+    item.isTop = 0;
+  });
+};
+const addTop = (item) => {
+  proxy.post("/customerTop/add", { customerId: item.id }).then(() => {
+    item.isTop = 1;
+  });
+};
 </script>
 
 <style lang="scss" scoped>