瀏覽代碼

公海,私海

lxf 1 年之前
父節點
當前提交
98b48f7c34
共有 4 個文件被更改,包括 199 次插入0 次删除
  1. 2 0
      src/lang/cn.js
  2. 10 0
      src/router/routerLXF.js
  3. 94 0
      src/views/customer/highseas/index.vue
  4. 93 0
      src/views/customer/privatesea/index.vue

+ 2 - 0
src/lang/cn.js

@@ -1165,5 +1165,7 @@ export const lang = {
 		contentTwoMsg: '请输入跟进内容',
 		selectDate:'选择日期',
 		selectTime:'选择时间',
+		highseasName: '公海客户',
+		privateseaName: '私海客户',
 	}
 }

+ 10 - 0
src/router/routerLXF.js

@@ -105,6 +105,16 @@ export function routesLXF() {
       name: "添加跟进记录",
       component: () => import("../views/customer/file/addRecords.vue"),
     },
+    {
+      path: "highseas",
+      name: "公海客户",
+      component: () => import("../views/customer/highseas/index.vue"),
+    },
+    {
+      path: "privatesea",
+      name: "私海客户",
+      component: () => import("../views/customer/privatesea/index.vue"),
+    },
   ];
   return routesLXF;
 }

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

@@ -0,0 +1,94 @@
+<template>
+  <van-nav-bar :title="$t('customerFile.highseasName')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+    <template #right>{{ $t("common.add") }}</template>
+  </van-nav-bar>
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
+  <van-pull-refresh v-model="loading" @refresh="onRefresh">
+    <div class="list">
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="getList" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
+      </van-list>
+    </div>
+  </van-pull-refresh>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import commonList from "@/components/common-list.vue";
+
+const proxy = getCurrentInstance().proxy;
+const onClickLeft = () => proxy.$router.push("/main/working");
+const onClickRight = () => {
+  proxy.$router.push({
+    path: "customerFileAdd",
+    query: {
+      type: "add",
+    },
+  });
+};
+const req = ref({
+  pageNum: 1,
+  keyword: null,
+  type: 0
+});
+const finished = ref(false);
+const onRefresh = () => {
+  req.value.pageNum = 1;
+  finished.value = false;
+  getList("refresh");
+};
+const loading = ref(false);
+const listData = ref([]);
+const getList = (type) => {
+  loading.value = true;
+  proxy
+    .post("/customer/page", req.value)
+    .then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        res.data.rows = res.data.rows.map((item) => {
+          return {
+            ...item,
+            cityText: item.countryName + "," + item.provinceName + "," + item.cityName,
+          };
+        });
+      }
+      listData.value = type === "refresh" ? res.data.rows : listData.value.concat(res.data.rows);
+      if (req.value.pageNum * 10 >= res.data.total) {
+        finished.value = true;
+      }
+      req.value.pageNum++;
+      loading.value = false;
+    })
+    .catch(() => {
+      loading.value = false;
+    });
+};
+const toDtl = (row) => {
+  proxy.$router.push({
+    path: "customerFileDetail",
+    query: {
+      id: row.id,
+      type: "detail",
+    },
+  });
+};
+const listConfig = ref([
+  {
+    label: proxy.t("customerFile.customerName"),
+    prop: "name",
+  },
+  {
+    label: proxy.t("customerFile.cityText"),
+    prop: "cityText",
+  },
+  {
+    label: proxy.t("customerFile.customerStatus"),
+    prop: "statusVal",
+  },
+]);
+</script>
+
+<style lang="scss" scoped>
+.list {
+  min-height: 70vh;
+}
+</style>

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

@@ -0,0 +1,93 @@
+<template>
+  <van-nav-bar :title="$t('customerFile.privateseaName')" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
+    <template #right>{{ $t("common.add") }}</template>
+  </van-nav-bar>
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
+  <van-pull-refresh v-model="loading" @refresh="onRefresh">
+    <div class="list">
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="getList" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
+      </van-list>
+    </div>
+  </van-pull-refresh>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import commonList from "@/components/common-list.vue";
+
+const proxy = getCurrentInstance().proxy;
+const onClickLeft = () => proxy.$router.push("/main/working");
+const onClickRight = () => {
+  proxy.$router.push({
+    path: "customerFileAdd",
+    query: {
+      type: "add",
+    },
+  });
+};
+const req = ref({
+  pageNum: 1,
+  keyword: null,
+});
+const finished = ref(false);
+const onRefresh = () => {
+  req.value.pageNum = 1;
+  finished.value = false;
+  getList("refresh");
+};
+const loading = ref(false);
+const listData = ref([]);
+const getList = (type) => {
+  loading.value = true;
+  proxy
+    .post("/customer/privateSeaPage", req.value)
+    .then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        res.data.rows = res.data.rows.map((item) => {
+          return {
+            ...item,
+            cityText: item.countryName + "," + item.provinceName + "," + item.cityName,
+          };
+        });
+      }
+      listData.value = type === "refresh" ? res.data.rows : listData.value.concat(res.data.rows);
+      if (req.value.pageNum * 10 >= res.data.total) {
+        finished.value = true;
+      }
+      req.value.pageNum++;
+      loading.value = false;
+    })
+    .catch(() => {
+      loading.value = false;
+    });
+};
+const toDtl = (row) => {
+  proxy.$router.push({
+    path: "customerFileDetail",
+    query: {
+      id: row.id,
+      type: "detail",
+    },
+  });
+};
+const listConfig = ref([
+  {
+    label: proxy.t("customerFile.customerName"),
+    prop: "name",
+  },
+  {
+    label: proxy.t("customerFile.cityText"),
+    prop: "cityText",
+  },
+  {
+    label: proxy.t("customerFile.customerStatus"),
+    prop: "statusVal",
+  },
+]);
+</script>
+
+<style lang="scss" scoped>
+.list {
+  min-height: 70vh;
+}
+</style>