소스 검색

店铺筛选

xiaodai2017 1 년 전
부모
커밋
c507475a0d
27개의 변경된 파일995개의 추가작업 그리고 241개의 파일을 삭제
  1. 7 0
      src/apis/components/search-city.js
  2. 6 0
      src/apis/components/search-max-area.js
  3. 6 0
      src/apis/components/search-max-num.js
  4. 7 0
      src/apis/components/search-store-spec.js
  5. 7 0
      src/apis/components/search-type.js
  6. 4 2
      src/apis/service/operate/supplier/index.js
  7. 1 1
      src/apis/service/user/index.js
  8. 2 0
      src/components/globalComponents/search-city/index.js
  9. 118 0
      src/components/globalComponents/search-city/main.vue
  10. 0 0
      src/components/globalComponents/search-city/店铺所在市选择框
  11. 2 0
      src/components/globalComponents/search-max-area/index.js
  12. 119 0
      src/components/globalComponents/search-max-area/main.vue
  13. 0 0
      src/components/globalComponents/search-max-area/店铺会场最大面积选择框
  14. 2 0
      src/components/globalComponents/search-max-num/index.js
  15. 118 0
      src/components/globalComponents/search-max-num/main.vue
  16. 0 0
      src/components/globalComponents/search-max-num/店铺会场最大容纳人数选择框
  17. 2 0
      src/components/globalComponents/search-store-spec/index.js
  18. 119 0
      src/components/globalComponents/search-store-spec/main.vue
  19. 0 0
      src/components/globalComponents/search-store-spec/店铺场地特色选择框
  20. 2 0
      src/components/globalComponents/search-type/index.js
  21. 119 0
      src/components/globalComponents/search-type/main.vue
  22. 0 0
      src/components/globalComponents/search-type/店铺类型选择框
  23. 1 1
      src/views/login/forget-password.vue
  24. 88 53
      src/views/operate/shop/index.vue
  25. 94 51
      src/views/operate/supplier/components/serviceChargeModal.vue
  26. 89 47
      src/views/operate/supplier/components/toPublicModal.vue
  27. 82 86
      src/views/operate/supplier/index.vue

+ 7 - 0
src/apis/components/search-city.js

@@ -0,0 +1,7 @@
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 列表
+  list: (data, params) => http("admin/supplierStore/get_cites", data, "post", params),
+};
+   

+ 6 - 0
src/apis/components/search-max-area.js

@@ -0,0 +1,6 @@
+import http from "@/apis/axios";
+export default {
+  // 列表
+  list: (data, params) => http("admin/areaDict/index", data, "post", params),
+};
+   

+ 6 - 0
src/apis/components/search-max-num.js

@@ -0,0 +1,6 @@
+import http from "@/apis/axios";
+export default {
+  // 列表
+  list: (data, params) => http("admin/attendance/index", data, "post", params),
+};
+   

+ 7 - 0
src/apis/components/search-store-spec.js

@@ -0,0 +1,7 @@
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 列表
+  list: (data, params) => http("admin/storeSpec/index", data, "post", params),
+};
+   

+ 7 - 0
src/apis/components/search-type.js

@@ -0,0 +1,7 @@
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 列表
+  list: (data, params) => http("admin/storeType/index", data, "post", params),
+};
+   

+ 4 - 2
src/apis/service/operate/supplier/index.js

@@ -13,6 +13,8 @@ export default {
   // 修改状态
   status: (data, params) => http(api + 'supplerstatus', data, 'post', params),
   // 详情
-  detail: (data, params) => http(api + 'info', data, 'post', params)
-
+  detail: (data, params) => http(api + 'info', data, 'post', params),
+  // 详情
+  save: (data, params) => http(api + 'save', data, 'post', params),
+ 
 }

+ 1 - 1
src/apis/service/user/index.js

@@ -5,7 +5,7 @@ export default {
   // 获取验证码
   verfiy: (data, params) => http(`api/wechat/getCodebyMombile`, data, 'post', params),
   // 手机号验证码密码重置
-  resetpwd: (data, params) => http(`admin/user/passmobile`, data, 'post', params),
+  resetpwd: (data, params) => http(`admin/login/forgetPassword`, data, 'post', params),
   // 手机号更换
   resetmobile: (data, params) =>
     http(`Api/resetmobile`, data, 'post', params),

+ 2 - 0
src/components/globalComponents/search-city/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 118 - 0
src/components/globalComponents/search-city/main.vue

@@ -0,0 +1,118 @@
+<template>
+  <el-select
+    v-model="value"
+    multiple
+    filterable
+    remote
+    clearable
+    :multiple-limit="1"
+    reserve-keyword
+    :size="size || 'medium'"
+    style="width: 100%"
+    :placeholder="placeholder || ''"
+    :disabled="disabled"
+    :remote-method="remoteMethod"
+    :loading="selectLoading"
+    @change="selectChange"
+  >
+    <el-option
+      v-for="(item, index) in options"
+      :key="item.id + '' + index"
+      :label="item.name + ''"
+      :value="item.id + ''"
+    />
+  </el-select>
+</template>
+
+<script>
+import asyncRequest from "@/apis/components/search-city";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "SearchCity",
+  mixins: [resToken],
+  props: ["size", "value", "placeholder", "isDetail", "disabled", "type", "names"],
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小            非必填
+   * @param {Array}         value            : 选中值              必填
+   * @param {String}        placeholder      : 提示信息            非必填
+   * @param {Boolean}       isDetail         : 是否是详情逻辑       必填
+   * @param {Boolean}       disabled         : 是否禁用            必填
+   * @param {String}        names            : 选中值label         展示详情必填
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      options: [],
+      selectLoading: false,
+      searchName: "",
+      formValue: {
+        page: 1,
+        size: 100,
+        start: "",
+        end: "",
+        unit: "",
+        creater: "",
+      },
+    };
+  },
+  watch: {
+    names: function (val, old) {
+      // console.log(val, old, this.isDetail, "1");
+      this.searchName = val;
+      if (this.isDetail && this.searchName) {
+        this.remoteMethod(this.searchName);
+      }
+    },
+  },
+  mounted() {
+    console.log("11111");
+    this.options = [];
+    this.selectLoading = false;
+    this.remoteMethod("", true);
+  },
+  methods: {
+    async selectChange(e) {
+      if (e && e.length > 0) {
+        const index = this.options.findIndex((v) => v.id + "" === e[0] + "");
+        console.log(index);
+        if (index !== -1) {
+          const model = {
+            id: this.options[index].id + "",
+            code: this.options[index].id + "",
+            label: this.options[index].unit + "",
+          };
+          this.$emit("searchChange", model);
+        } else {
+          this.$emit("searchChange", {});
+        }
+      } else {
+        this.$emit("searchChange", {});
+      }
+    },
+    async remoteMethod(query, type) {
+      this.selectLoading = true;
+      if (query !== "" || (type && query === "")) {
+        this.options = [];
+        this.formValue.name = query;
+        const { code, data, message } = await asyncRequest.list(this.formValue);
+
+        if (code === 1) {
+          const { list } = data;
+          this.options = list;
+        } else {
+          this.options = [];
+        }
+      } else {
+        this.options = [];
+      }
+      this.selectLoading = false;
+    },
+  },
+};
+</script>
+
+<style></style>

+ 0 - 0
src/components/globalComponents/search-city/店铺所在市选择框


+ 2 - 0
src/components/globalComponents/search-max-area/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 119 - 0
src/components/globalComponents/search-max-area/main.vue

@@ -0,0 +1,119 @@
+<template>
+  <el-select
+    v-model="value"
+    multiple
+    filterable
+    remote
+    clearable
+    :multiple-limit="1"
+    reserve-keyword
+    :size="size || 'medium'"
+    style="width: 100%"
+    :placeholder="placeholder || ''"
+    :disabled="disabled"
+    :remote-method="remoteMethod"
+    :loading="selectLoading"
+    @change="selectChange"
+  >
+    <el-option
+      v-for="(item, index) in options"
+      :key="item.id + '' + index"
+      :label="item.min + '㎡'"
+      :value="item.id + ''"
+      :disabled="item.status + '' === '0'"
+    />
+  </el-select>
+</template>
+
+<script>
+import asyncRequest from "@/apis/components/search-max-area";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "SearchMaxArea",
+  mixins: [resToken],
+  props: ["size", "value", "placeholder", "isDetail", "disabled", "type", "names"],
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小            非必填
+   * @param {Array}         value            : 选中值              必填
+   * @param {String}        placeholder      : 提示信息            非必填
+   * @param {Boolean}       isDetail         : 是否是详情逻辑       必填
+   * @param {Boolean}       disabled         : 是否禁用            必填
+   * @param {String}        names            : 选中值label         展示详情必填
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      options: [],
+      selectLoading: false,
+      searchName: "",
+      formValue: {
+        page: 1,
+        size: 100,
+        start: "",
+        end: "",
+        unit: "",
+        creater: "",
+      },
+    };
+  },
+  watch: {
+    names: function (val, old) {
+      // console.log(val, old, this.isDetail, "1");
+      this.searchName = val;
+      if (this.isDetail && this.searchName) {
+        this.remoteMethod(this.searchName);
+      }
+    },
+  },
+  mounted() {
+    console.log("11111");
+    this.options = [];
+    this.selectLoading = false;
+    this.remoteMethod("", true);
+  },
+  methods: {
+    async selectChange(e) {
+      if (e && e.length > 0) {
+        const index = this.options.findIndex((v) => v.id + "" === e[0] + "");
+        console.log(index);
+        if (index !== -1) {
+          const model = {
+            id: this.options[index].id + "",
+            code: this.options[index].id + "",
+            label: this.options[index].unit + "",
+          };
+          this.$emit("searchChange", model);
+        } else {
+          this.$emit("searchChange", {});
+        }
+      } else {
+        this.$emit("searchChange", {});
+      }
+    },
+    async remoteMethod(query, type) {
+      this.selectLoading = true;
+      if (query !== "" || (type && query === "")) {
+        this.options = [];
+        this.formValue.name = query;
+        const { code, data, message } = await asyncRequest.list(this.formValue);
+
+        if (code === 1) {
+          const { list } = data;
+          this.options = list;
+        } else {
+          this.options = [];
+        }
+      } else {
+        this.options = [];
+      }
+      this.selectLoading = false;
+    },
+  },
+};
+</script>
+
+<style></style>

+ 0 - 0
src/components/globalComponents/search-max-area/店铺会场最大面积选择框


+ 2 - 0
src/components/globalComponents/search-max-num/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 118 - 0
src/components/globalComponents/search-max-num/main.vue

@@ -0,0 +1,118 @@
+<template>
+  <el-select
+    v-model="value"
+    multiple
+    filterable
+    remote
+    clearable
+    :multiple-limit="1"
+    reserve-keyword
+    :size="size || 'medium'"
+    style="width: 100%"
+    :placeholder="placeholder || ''"
+    :disabled="disabled"
+    :remote-method="remoteMethod"
+    :loading="selectLoading"
+    @change="selectChange"
+  >
+    <el-option
+      v-for="(item, index) in options"
+      :key="item.id + '' + index"
+      :label="item.min + '人'"
+      :value="item.id + ''"
+      :disabled="item.status + '' === '0'"
+    />
+  </el-select>
+</template>
+
+<script>
+import asyncRequest from "@/apis/components/search-max-num";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "SearchMaxNum",
+  mixins: [resToken],
+  props: ["size", "value", "placeholder", "isDetail", "disabled", "type", "names"],
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小            非必填
+   * @param {Array}         value            : 选中值              必填
+   * @param {String}        placeholder      : 提示信息            非必填
+   * @param {Boolean}       isDetail         : 是否是详情逻辑       必填
+   * @param {Boolean}       disabled         : 是否禁用            必填
+   * @param {String}        names            : 选中值label         展示详情必填
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      options: [],
+      selectLoading: false,
+      searchName: "",
+      formValue: {
+        page: 1,
+        size: 100,
+        start: "",
+        end: "",
+        unit: "",
+        creater: "",
+      },
+    };
+  },
+  watch: {
+    names: function (val, old) {
+      // console.log(val, old, this.isDetail, "1");
+      this.searchName = val;
+      if (this.isDetail && this.searchName) {
+        this.remoteMethod(this.searchName);
+      }
+    },
+  },
+  mounted() {
+    this.options = [];
+    this.selectLoading = false;
+    this.remoteMethod("", true);
+  },
+  methods: {
+    async selectChange(e) {
+      if (e && e.length > 0) {
+        const index = this.options.findIndex((v) => v.id + "" === e[0] + "");
+        console.log(index);
+        if (index !== -1) {
+          const model = {
+            id: this.options[index].id + "",
+            code: this.options[index].id + "",
+            label: this.options[index].unit + "",
+          };
+          this.$emit("searchChange", model);
+        } else {
+          this.$emit("searchChange", {});
+        }
+      } else {
+        this.$emit("searchChange", {});
+      }
+    },
+    async remoteMethod(query, type) {
+      this.selectLoading = true;
+      if (query !== "" || (type && query === "")) {
+        this.options = [];
+        this.formValue.name = query;
+        const { code, data, message } = await asyncRequest.list(this.formValue);
+
+        if (code === 1) {
+          const { list } = data;
+          this.options = list;
+        } else {
+          this.options = [];
+        }
+      } else {
+        this.options = [];
+      }
+      this.selectLoading = false;
+    },
+  },
+};
+</script>
+
+<style></style>

+ 0 - 0
src/components/globalComponents/search-max-num/店铺会场最大容纳人数选择框


+ 2 - 0
src/components/globalComponents/search-store-spec/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 119 - 0
src/components/globalComponents/search-store-spec/main.vue

@@ -0,0 +1,119 @@
+<template>
+  <el-select
+    v-model="value"
+    multiple
+    filterable
+    remote
+    clearable
+    :multiple-limit="1"
+    reserve-keyword
+    :size="size || 'medium'"
+    style="width: 100%"
+    :placeholder="placeholder || ''"
+    :disabled="disabled"
+    :remote-method="remoteMethod"
+    :loading="selectLoading"
+    @change="selectChange"
+  >
+    <el-option
+      v-for="(item, index) in options"
+      :key="item.id + '' + index"
+      :label="item.name + ''"
+      :value="item.id + ''"
+      :disabled="item.status + '' === '0'"
+    />
+  </el-select>
+</template>
+
+<script>
+import asyncRequest from "@/apis/components/search-store-spec";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "SearchStoreSpec",
+  mixins: [resToken],
+  props: ["size", "value", "placeholder", "isDetail", "disabled", "type", "names"],
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小            非必填
+   * @param {Array}         value            : 选中值              必填
+   * @param {String}        placeholder      : 提示信息            非必填
+   * @param {Boolean}       isDetail         : 是否是详情逻辑       必填
+   * @param {Boolean}       disabled         : 是否禁用            必填
+   * @param {String}        names            : 选中值label         展示详情必填
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      options: [],
+      selectLoading: false,
+      searchName: "",
+      formValue: {
+        page: 1,
+        size: 100,
+        start: "",
+        end: "",
+        unit: "",
+        creater: "",
+      },
+    };
+  },
+  watch: {
+    names: function (val, old) {
+      // console.log(val, old, this.isDetail, "1");
+      this.searchName = val;
+      if (this.isDetail && this.searchName) {
+        this.remoteMethod(this.searchName);
+      }
+    },
+  },
+  mounted() {
+    console.log("11111");
+    this.options = [];
+    this.selectLoading = false;
+    this.remoteMethod("", true);
+  },
+  methods: {
+    async selectChange(e) {
+      if (e && e.length > 0) {
+        const index = this.options.findIndex((v) => v.id + "" === e[0] + "");
+        console.log(index);
+        if (index !== -1) {
+          const model = {
+            id: this.options[index].id + "",
+            code: this.options[index].id + "",
+            label: this.options[index].unit + "",
+          };
+          this.$emit("searchChange", model);
+        } else {
+          this.$emit("searchChange", {});
+        }
+      } else {
+        this.$emit("searchChange", {});
+      }
+    },
+    async remoteMethod(query, type) {
+      this.selectLoading = true;
+      if (query !== "" || (type && query === "")) {
+        this.options = [];
+        this.formValue.name = query;
+        const { code, data, message } = await asyncRequest.list(this.formValue);
+
+        if (code === 1) {
+          const { list } = data;
+          this.options = list;
+        } else {
+          this.options = [];
+        }
+      } else {
+        this.options = [];
+      }
+      this.selectLoading = false;
+    },
+  },
+};
+</script>
+
+<style></style>

+ 0 - 0
src/components/globalComponents/search-store-spec/店铺场地特色选择框


+ 2 - 0
src/components/globalComponents/search-type/index.js

@@ -0,0 +1,2 @@
+import Main from './main.vue'
+export default Main

+ 119 - 0
src/components/globalComponents/search-type/main.vue

@@ -0,0 +1,119 @@
+<template>
+  <el-select
+    v-model="value"
+    multiple
+    filterable
+    remote
+    clearable
+    :multiple-limit="1"
+    reserve-keyword
+    :size="size || 'medium'"
+    style="width: 100%"
+    :placeholder="placeholder || ''"
+    :disabled="disabled"
+    :remote-method="remoteMethod"
+    :loading="selectLoading"
+    @change="selectChange"
+  >
+    <el-option
+      v-for="(item, index) in options"
+      :key="item.id + '' + index"
+      :label="item.name + ''"
+      :value="item.id + ''"
+      :disabled="item.status + '' === '0'"
+    />
+  </el-select>
+</template>
+
+<script>
+import asyncRequest from "@/apis/components/search-type";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "SearchType",
+  mixins: [resToken],
+  props: ["size", "value", "placeholder", "isDetail", "disabled", "type", "names"],
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小            非必填
+   * @param {Array}         value            : 选中值              必填
+   * @param {String}        placeholder      : 提示信息            非必填
+   * @param {Boolean}       isDetail         : 是否是详情逻辑       必填
+   * @param {Boolean}       disabled         : 是否禁用            必填
+   * @param {String}        names            : 选中值label         展示详情必填
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      options: [],
+      selectLoading: false,
+      searchName: "",
+      formValue: {
+        page: 1,
+        size: 100,
+        start: "",
+        end: "",
+        unit: "",
+        creater: "",
+      },
+    };
+  },
+  watch: {
+    names: function (val, old) {
+      // console.log(val, old, this.isDetail, "1");
+      this.searchName = val;
+      if (this.isDetail && this.searchName) {
+        this.remoteMethod(this.searchName);
+      }
+    },
+  },
+  mounted() {
+    console.log("11111");
+    this.options = [];
+    this.selectLoading = false;
+    this.remoteMethod("", true);
+  },
+  methods: {
+    async selectChange(e) {
+      if (e && e.length > 0) {
+        const index = this.options.findIndex((v) => v.id + "" === e[0] + "");
+        console.log(index);
+        if (index !== -1) {
+          const model = {
+            id: this.options[index].id + "",
+            code: this.options[index].id + "",
+            label: this.options[index].unit + "",
+          };
+          this.$emit("searchChange", model);
+        } else {
+          this.$emit("searchChange", {});
+        }
+      } else {
+        this.$emit("searchChange", {});
+      }
+    },
+    async remoteMethod(query, type) {
+      this.selectLoading = true;
+      if (query !== "" || (type && query === "")) {
+        this.options = [];
+        this.formValue.name = query;
+        const { code, data, message } = await asyncRequest.list(this.formValue);
+
+        if (code === 1) {
+          const { list } = data;
+          this.options = list;
+        } else {
+          this.options = [];
+        }
+      } else {
+        this.options = [];
+      }
+      this.selectLoading = false;
+    },
+  },
+};
+</script>
+
+<style></style>

+ 0 - 0
src/components/globalComponents/search-type/店铺类型选择框


+ 1 - 1
src/views/login/forget-password.vue

@@ -306,7 +306,7 @@ export default {
           if (!this.loading) {
             this.loading = true
             const model = {
-              username: this.loginFormX.username,
+              // username: this.loginFormX.username,
               mobile: this.loginFormX.mobile,
               code: this.loginFormX.code,
               password: this.loginFormY.newPassword

+ 88 - 53
src/views/operate/shop/index.vue

@@ -23,17 +23,7 @@
       <template #table-header="{}">
         <div style="width: 100%">
           <el-row style="padding: 0 0 10px 80px">
-            <el-col :span="6" style="width: 303px">
-              <period-date-picker
-                :type="1"
-                :width="'135px'"
-                :size="searchSize"
-                :start="parmValue.createStart"
-                :end="parmValue.createEnd"
-                @timeReturned="handleTime"
-              />
-            </el-col>
-            <el-col :span="4" style="width: 160px">
+            <el-col :span="4" style="width: 100px">
               <el-select
                 v-model="parmValue.status"
                 filterable
@@ -55,6 +45,51 @@
                 />
               </el-select>
             </el-col>
+            <el-col :span="4" style="width: 160px;padding:0 0 0 10px">
+              <search-city
+                :value="parmValue.store_city"
+                :size="'mini'"
+                :isDetail="false"
+                :names="''"
+                :disabled="false"
+                :placeholder="'店铺所在城市'"
+                @searchChange="searchChange($event,'store_city')"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 160px;padding:0 0 0 10px">
+              <search-type
+                :value="parmValue.type_id"
+                :size="'mini'"
+                :isDetail="false"
+                :names="''"
+                :disabled="false"
+                :placeholder="'店铺类型'"
+                @searchChange="searchChange($event,'type_id')"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 160px;padding:0 0 0 10px">
+              <search-max-area
+                :value="parmValue.area_id"
+                :size="'mini'"
+                :isDetail="false"
+                :names="''"
+                :disabled="false"
+                :placeholder="'会场面积'"
+                @searchChange="searchChange($event,'area_id')"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 160px;padding:0 0 0 10px">
+              <search-max-num
+                :value="parmValue.attendance_id"
+                :size="'mini'"
+                :isDetail="false"
+                :names="''"
+                :disabled="false"
+                :placeholder="'容纳人数'"
+                @searchChange="searchChange($event,'attendance_id')"
+              />
+            </el-col>
+            
             <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
               <el-button type="primary" :size="searchSize" @click="searchList">
                 刷新
@@ -67,10 +102,21 @@
             </el-col>
           </el-row>
           <el-row>
+            <el-col :span="4" style="width: 160px;">
+              <search-store-spec
+                :value="parmValue.store_spec_id"
+                :size="'mini'"
+                :isDetail="false"
+                :names="''"
+                :disabled="false"
+                :placeholder="'场地特色'"
+                @searchChange="searchChange($event,'store_spec_id')"
+              />
+            </el-col>
             <el-col :span="4" style="width: 333px">
               <el-input
                 :size="searchSize"
-                v-model="parmValue.supplierName"
+                v-model="parmValue.store_name"
                 :maxlength="40"
                 clearable
                 @blur="
@@ -83,22 +129,10 @@
                   parmValue.page = 1;
                   searchList();
                 "
-                placeholder="供应商名称"
-              ></el-input>
-            </el-col>
-            <el-col :span="4" style="width: 120px; padding: 0 0 0 10px">
-              <el-input
-                :size="searchSize"
-                v-model="parmValue.creator"
-                :maxlength="40"
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-                placeholder="创建人"
+                placeholder="店铺名称"
               ></el-input>
             </el-col>
+
             <el-col
               :span="3"
               class="fr"
@@ -245,7 +279,7 @@ import addEdit from "./addEdit";
   createStart //创建开始时间
   createEnd   //创建结束时间
   status //当前状态
-  supplierName  //供应商名称
+  store_name  //供应商名称
   creator //创建人 
 */
 
@@ -278,11 +312,13 @@ export default {
       parmValue: {
         page: 1, // 页码
         size: 15, // 每页显示条数
-        createStart: "", //创建开始时间
-        createEnd: "", //创建结束时间
+        store_city: [], //市级id
+        store_name: "", //店铺名称
         status: "", //当前状态
-        supplierName: "", //供应商名称
-        creator: "", //创建人
+        type_id: [],
+        area_id: [],
+        attendance_id: [],
+        store_spec_id: [],
       },
 
       // 表格 - 数据
@@ -304,7 +340,6 @@ export default {
     };
   },
   mounted() {
-
     this.searchList();
   },
   methods: {
@@ -318,11 +353,13 @@ export default {
       this.parmValue = {
         page: 1, // 页码
         size: 15, // 每页显示条数
-        createStart: "", //创建开始时间
-        createEnd: "", //创建结束时间
+        store_city: [], //市级id
+        store_name: "", //店铺名称
         status: "", //当前状态
-        supplierName: "", //供应商名称
-        creator: "", //创建人
+        type_id: [],
+        area_id: [],
+        attendance_id: [],
+        store_spec_id: [],
       };
       this.searchList();
     },
@@ -337,19 +374,16 @@ export default {
       this.isDetail = isDetail;
       this.sitem = sitem;
     },
-    // 时间
-    async handleTime(e) {
-      this.parmValue.createStart = e.startTime || "";
-      this.parmValue.createEnd = e.endTime || "";
-      if (
-        (this.parmValue.createStart !== "" && this.parmValue.createEnd !== "") ||
-        (this.parmValue.createEnd === "" && this.parmValue.createEnd === "")
-      ) {
-        this.pageInfo.curr = 1;
-        this.parmValue.page = 1;
-        await this.searchList();
-      }
+    
+    async searchChange(e,key) {
+      const { code } = e;
+      this.parmValue[key] = code ? [code] : [];
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      await this.searchList();
     },
+  
+    
     gotoEdit(row, type) {
       const { status } = row;
       if (type === "005" && status + "" === "1") {
@@ -417,17 +451,18 @@ export default {
     },
     // 刷新表格
     async searchList() {
-      if (
-        (this.parmValue.createStart !== "" && this.parmValue.createEnd === "") ||
-        (this.parmValue.createStart == "" && this.parmValue.createEnd !== "")
-      ) {
-        this.$message.warning("开始时间和结束时间不能为空");
+      if (this.loading) {
         return;
       }
       this.loading = true;
       const model = {
         ...this.parmValue,
         limit: this.parmValue.size,
+        store_city:this.parmValue.store_city.toString(),
+        type_id:this.parmValue.type_id.toString(),
+        attendance_id:this.parmValue.attendance_id.toString(),
+        store_spec_id:this.parmValue.store_spec_id.toString(),
+        area_id: this.parmValue.area_id.toString()
       };
       const { code, data, msg } = await asyncRequest.list(model);
       let scode = parseInt(code + "");

+ 94 - 51
src/views/operate/supplier/components/serviceChargeModal.vue

@@ -1,19 +1,26 @@
 <template>
-  <el-dialog :visible="visible" width="400px" @close="handleClose" center :close-on-click-modal="false" title="设置服务费比例">
+  <el-dialog
+    :visible="visible"
+    width="400px"
+    @close="handleClose"
+    center
+    :close-on-click-modal="false"
+    title="设置服务费比例"
+  >
     <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px">
-      <el-form-item label="服务费比例" prop="serviceRate">
+      <el-form-item label="服务费比例" prop="service_tax">
         <digital-input
-            :values="ruleForm.serviceRate"
-            :placeholder="'服务费比例'"
-            :min="0"
-            :max="100"
-            :position="'right'"
-            size="default"
-            :precision="2"
-            :controls="false"
-            :append="'%'"
-            @reschange="rate_change($event)"
-          />
+          :values="ruleForm.service_tax"
+          :placeholder="'服务费比例'"
+          :min="0"
+          :max="100"
+          :position="'right'"
+          size="default"
+          :precision="0"
+          :controls="false"
+          :append="'%'"
+          @reschange="rate_change($event)"
+        />
       </el-form-item>
 
       <el-form-item class="flex-end">
@@ -24,55 +31,91 @@
 </template>
 
 <script>
+import asyncRequest from "@/apis/service/operate/supplier";
 export default {
-  props:['visible'],
-  computed:{
-    _visible:{
-      get(){
-        return this.visible
+  props: ["visible", "row"],
+  computed: {
+    _visible: {
+      get() {
+        return this.visible;
       },
-      set(newVal){
-        this.$emit("update:visible", newVal)
-      }
-    }
+      set(newVal) {
+        this.$emit("update:visible", newVal);
+      },
+    },
   },
-  data(){
+  data() {
     return {
-      ruleForm:{
-        serviceRate:"",
+      ruleForm: {
+        service_tax: "",
       },
-      rules:{
-        serviceRate:[
+      rules: {
+        service_tax: [
           {
-            required:true,
-            trigger:'change',
-            message:'请输入服务费比例'
-          }
-        ]
+            required: true,
+            trigger: "change",
+            message: "请输入服务费比例",
+          },
+        ],
+      },
+    };
+  },
+  watch: {
+    _visible: function (val) {
+      if (val) {
+        this.resetForm();
       }
-    }
+    },
+  
   },
-  methods:{
-    handleClose(){
-      this._visible = false
+  methods: {
+    handleClose() {
+      this._visible = false;
       this.ruleForm = {
-        serviceRate:""
-      }
+        service_tax: "",
+      };
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { service_tax } = this.row;
+          this.ruleForm = {
+            service_tax: service_tax || "0",
+          
+          };
+        }
+      });
     },
     rate_change(e) {
-      this.ruleForm.serviceRate = e + "";
-      this.$refs.ruleForm.validateField("serviceRate");
+      this.ruleForm.service_tax = e + "";
+      this.$refs.ruleForm.validateField("service_tax");
     },
-    async onSubmit(){
-      try{
-        await this.$refs.ruleForm.validate()
-
-        this.handleClose()
-        this.$emit('refresh')
-      }catch(e){
-        console.log(e)
+    async onSubmit() {
+      try {
+        await this.$refs.ruleForm.validate();
+        const model = {
+          ...this.ruleForm,
+          id: this.row.id,
+          public_bank: this.row.public_bank,
+          public_bankNo: this.row.public_bankNo,
+        };
+        const { code } = await asyncRequest.save(model);
+        this.loading = false;
+        if (code === 1) {
+          this.$notify.success({
+            title: "设置成功!",
+            message: "",
+          });
+          this.handleClose();
+          this.$emit("refresh");
+        }
+      } catch (e) {
+        console.log(e);
       }
-    }
-  }
-}
+    },
+  },
+};
 </script>

+ 89 - 47
src/views/operate/supplier/components/toPublicModal.vue

@@ -1,12 +1,19 @@
 <template>
-  <el-dialog :visible="visible" width="500px" @close="handleClose" center :close-on-click-modal="false" title="供应商对公付款设置">
+  <el-dialog
+    :visible="visible"
+    width="500px"
+    @close="handleClose"
+    center
+    :close-on-click-modal="false"
+    title="供应商对公付款设置"
+  >
     <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px">
-      <el-form-item label="银行名称" prop="bankName">
-        <el-input placeholder="银行名称" />
+      <el-form-item label="银行名称" prop="public_bank">
+        <el-input v-model="ruleForm.public_bank" placeholder="银行名称" />
       </el-form-item>
 
-      <el-form-item label="银行卡号" prop="bankNumber">
-        <el-input placeholder="银行卡号" />
+      <el-form-item label="银行卡号" prop="public_bankNo">
+        <el-input v-model="ruleForm.public_bankNo" placeholder="银行卡号" />
       </el-form-item>
 
       <el-form-item class="flex-end">
@@ -17,60 +24,95 @@
 </template>
 
 <script>
+import asyncRequest from "@/apis/service/operate/supplier";
 export default {
-  props:['visible'],
-  computed:{
-    _visible:{
-      get(){
-        return this.visible
+  props: ["visible", "row"],
+  computed: {
+    _visible: {
+      get() {
+        return this.visible;
       },
-      set(newVal){
-        this.$emit("update:visible", newVal)
+      set(newVal) {
+        this.$emit("update:visible", newVal);
+      },
+    },
+  },
+  watch: {
+    _visible: function (val) {
+      if (val) {
+        this.resetForm();
       }
-    }
+    },
   },
-  data(){
+  data() {
     return {
-      ruleForm:{
-        bankName:"",
-        bankNumber:""
+      ruleForm: {
+        public_bank: "",
+        public_bankNo: "",
       },
-      rules:{
-        bankName:[
+      rules: {
+        public_bank: [
           {
-            required:true,
-            trigger:'change',
-            message:'请输入银行名称'
-          }
+            required: true,
+            trigger: "change",
+            message: "请输入银行名称",
+          },
         ],
-        bankNumber:[
+        public_bankNo: [
           {
-            required:true,
-            trigger:'change',
-            message:'请输入银行卡号'
-          }
-        ]
-      }
-    }
+            required: true,
+            trigger: "change",
+            message: "请输入银行卡号",
+          },
+        ],
+      },
+    };
   },
-  methods:{
-    handleClose(){
-      this._visible = false
+  methods: {
+    handleClose() {
+      this._visible = false;
       this.ruleForm = {
-        bankName:"",
-        bankNumber:""
-      }
+        public_bank: "",
+        public_bankNo: "",
+      };
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { public_bank, public_bankNo } = this.row;
+          this.ruleForm = {
+            public_bank: public_bank || "",
+            public_bankNo: public_bankNo || "",
+          };
+        }
+      });
     },
-    async onSubmit(){
-      try{
-        await this.$refs.ruleForm.validate()
+    async onSubmit() {
+      try {
+        await this.$refs.ruleForm.validate();
 
-        this.handleClose()
-        this.$emit('refresh')
-      }catch(e){
-        console.log(e)
+        const model = {
+          ...this.ruleForm,
+          id: this.row.id,
+          service_tax: this.row.service_tax,
+        };
+        const { code } = await asyncRequest.save(model);
+        this.loading = false;
+        if (code === 1) {
+          this.$notify.success({
+            title: "设置成功!",
+            message: "",
+          });
+          this.handleClose();
+          this.$emit("refresh");
+        }
+      } catch (e) {
+        console.log(e);
       }
-    }
-  }
-}
+    },
+  },
+};
 </script>

+ 82 - 86
src/views/operate/supplier/index.vue

@@ -68,7 +68,7 @@
             </el-col>
           </el-row>
           <el-row>
-            <el-col :span="4" style="width: 333px;">
+            <el-col :span="4" style="width: 333px">
               <el-input
                 :size="searchSize"
                 v-model="parmValue.name"
@@ -103,23 +103,30 @@
               </el-button>
             </el-col>
           </el-row>
-        </div></template>
+        </div></template
+      >
 
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
           :type="scope.row.status == '0' ? 'warning' : ''"
           v-text="
-          (statusList.find((item) => Number(item.code) == Number(scope.row.status)) || {}).name ||
-            '--'
+            (
+              statusList.find((item) => Number(item.code) == Number(scope.row.status)) ||
+              {}
+            ).name || '--'
           "
         ></el-tag>
       </template>
 
       <template #supplier_type="{ scope }">
-        <el-tag size="mini">{{ natureOfSupplierList.find(item => item.value === String(scope.row.supplier_type)).label }}</el-tag>
+        <el-tag size="mini">{{
+          natureOfSupplierList.find(
+            (item) => item.value === String(scope.row.supplier_type)
+          ).label
+        }}</el-tag>
       </template>
-      
+
       <template #ocr_status="{ scope }">
         <el-tag
           :size="tablebtnSize"
@@ -152,11 +159,7 @@
       </template>
 
       <template #operation="{ scope }">
-        <el-tooltip
-          effect="dark"
-          content="详情"
-          placement="top"
-        >
+        <el-tooltip effect="dark" content="详情" placement="top">
           <i
             class="el-icon-view tb-icon"
             @click="getRouter('supplierDetail', scope.row.id)"
@@ -186,48 +189,30 @@
           ></i>
         </el-tooltip> -->
         <el-tooltip
-         v-if="powers.some((i) => i == '005')"
+          v-if="powers.some((i) => i == '005')"
           effect="dark"
           content="修改"
           placement="top"
         >
-          <i
-            class="el-icon-edit tb-icon"
-            @click="gotoEdit(scope.row, '005')"
-          ></i>
+          <i class="el-icon-edit tb-icon" @click="gotoEdit(scope.row, '005')"></i>
         </el-tooltip>
 
-        <el-tooltip
-          effect="dark"
-          content="设置行业信息"
-          placement="top"
-        >
+        <!-- <el-tooltip effect="dark" content="设置行业信息" placement="top">
           <i
             class="el-icon-office-building tb-icon"
-            @click="onOpenModal('industry',scope.row)"
+            @click="onOpenModal('industry', scope.row)"
           ></i>
-        </el-tooltip>
+        </el-tooltip> -->
 
-        <el-tooltip
-          effect="dark"
-          content="对公收款设置"
-          placement="top"
-        >
+        <el-tooltip effect="dark" content="对公收款设置" placement="top">
           <i
             class="el-icon-school tb-icon"
-            @click="onOpenModal('toPublic',scope.row)"
+            @click="onOpenModal('toPublic', scope.row)"
           ></i>
         </el-tooltip>
 
-        <el-tooltip
-          effect="dark"
-          content="设置服务毛利"
-          placement="top"
-        >
-          <i
-            class="el-icon-coin tb-icon"
-          @click="onOpenModal('service',scope.row)"
-          ></i>
+        <el-tooltip effect="dark" content="设置服务毛利" placement="top">
+          <i class="el-icon-coin tb-icon" @click="onOpenModal('service', scope.row)"></i>
         </el-tooltip>
         <!-- <el-tooltip
           v-if="powers.some((i) => i == '006')"
@@ -241,8 +226,20 @@
     </ex-table>
 
     <industry-modal :visible.sync="modalVisible.industry" />
-    <service-charge-modal :visible.sync="modalVisible.service" />
-    <to-public-modal :visible.sync="modalVisible.toPublic" />
+    <service-charge-modal
+      :visible.sync="modalVisible.service"
+      :row="currentRow"
+      @refresh="
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
+    />
+    <to-public-modal :visible.sync="modalVisible.toPublic" :row="currentRow"  @refresh="
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "/>
     <supplier-level-modal :visible.sync="modalVisible.level" />
   </div>
 </template>
@@ -254,12 +251,12 @@ import mixinPage from "@/mixins/elPaginationHandle";
 import { mapGetters } from "vuex";
 import resToken from "@/mixins/resToken";
 
-import IndustryModal from "./components/industryModal.vue"
-import ServiceChargeModal from "./components/serviceChargeModal.vue"
-import ToPublicModal from "./components/toPublicModal.vue"
-import SupplierLevelModal from "./components/supplierLevelModal.vue"
+import IndustryModal from "./components/industryModal.vue";
+import ServiceChargeModal from "./components/serviceChargeModal.vue";
+import ToPublicModal from "./components/toPublicModal.vue";
+import SupplierLevelModal from "./components/supplierLevelModal.vue";
 
-import { supplierLevelList } from "./columns"
+import { supplierLevelList } from "./columns";
 
 /**
  * @props
@@ -269,12 +266,12 @@ import { supplierLevelList } from "./columns"
  * name // 供应商名称
  * creator // 创建人
  * level // 供应商等级
-*/
+ */
 
 export default {
   name: "supplier",
   mixins: [mixinPage, resToken],
-  components:{IndustryModal, ServiceChargeModal, ToPublicModal, SupplierLevelModal},
+  components: { IndustryModal, ServiceChargeModal, ToPublicModal, SupplierLevelModal },
   computed: {
     //组件SIZE设置
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
@@ -288,7 +285,7 @@ export default {
   data() {
     return {
       supplierLevelList,
-      currentRow:{},
+      currentRow: {},
       statusList,
       roleLevel: roleLevel,
       loading: true,
@@ -300,26 +297,26 @@ export default {
         { id: "1", label: "已升级" },
         { id: "0", label: "未升级" },
       ],
-      selected:[],
-      modalVisible:{
-        industry:false,
-        toPublic:false,
-        service:false,
-        level:false
+      selected: [],
+      modalVisible: {
+        industry: false,
+        toPublic: false,
+        service: false,
+        level: false,
       },
-      natureOfSupplierList:[
-        {value:'1',label:'公务公司'},
-        {value:'2',label:'服务商'},
+      natureOfSupplierList: [
+        { value: "1", label: "公务公司" },
+        { value: "2", label: "服务商" },
       ],
       parmValue: {
         page: 1, // 页码
         size: 15, // 每页显示条数
-        start:"", // 创建开始时间
-        end:"", // 创建结束时间
-        status:"", // 状态
-        name:"", // 供应商名称
-        creator:"", // 创建人
-        level: "" // 供应商等级
+        start: "", // 创建开始时间
+        end: "", // 创建结束时间
+        status: "", // 状态
+        name: "", // 供应商名称
+        creator: "", // 创建人
+        level: "", // 供应商等级
       },
       ocr_status: [
         { id: "0", label: "未上传" },
@@ -343,8 +340,8 @@ export default {
       // 表格 - 列参数
       columns: [
         {
-          type:'selection',
-          width:'40px'
+          type: "selection",
+          width: "40px",
         },
         {
           prop: "code",
@@ -360,12 +357,12 @@ export default {
           prop: "supplier_type",
           label: "供应商类型",
           minWidth: "200",
-          _slot_:'supplier_type'
+          _slot_: "supplier_type",
         },
         {
           prop: "ocr_status",
           label: "营业执照识别状态",
-          _slot_:"ocr_status",
+          _slot_: "ocr_status",
           minWidth: "200",
         },
         {
@@ -410,9 +407,9 @@ export default {
     this.searchList();
   },
   methods: {
-    onOpenModal(modalName,rowData){
-      this.modalVisible[modalName] = true
-      this.currentRow = rowData
+    onOpenModal(modalName, rowData) {
+      this.modalVisible[modalName] = true;
+      this.currentRow = rowData;
     },
     getRouter(toRouter, queryId) {
       if (toRouter && queryId) {
@@ -443,12 +440,12 @@ export default {
       this.parmValue = {
         page: 1, // 页码
         size: 15, // 每页显示条数
-        start:"", // 创建开始时间
-        end:"", // 创建结束时间
-        status:"", // 状态
-        name:"", // 供应商名称
-        creator:"", // 创建人
-        level: "" // 供应商等级
+        start: "", // 创建开始时间
+        end: "", // 创建结束时间
+        status: "", // 状态
+        name: "", // 供应商名称
+        creator: "", // 创建人
+        level: "", // 供应商等级
       };
       this.searchList();
     },
@@ -471,8 +468,8 @@ export default {
         await this.searchList();
       }
     },
-    handleSelection({list}){
-      this.selected = list
+    handleSelection({ list }) {
+      this.selected = list;
     },
     gotoEdit(row, type) {
       // const { status } = row;
@@ -505,13 +502,12 @@ export default {
           const res = await asyncRequest.status(model);
           this.loading = false;
           if (res && res.code === 1) {
-            
             this.$notify.success({
               title: "状态修改成功!",
               message: "",
             });
             await this.searchList();
-          } 
+          }
         })
         .catch(() => {
           console.log("取消");
@@ -534,19 +530,19 @@ export default {
               message: "",
             });
             this.searchList();
-          } 
+          }
         })
         .catch(() => {
           console.log("取消");
         });
     },
-    handleSetSupplierLevel(){
-      if(this.selected.length === 0){
-        this.$message.warning('至少选择一个供应商')
-        return 
+    handleSetSupplierLevel() {
+      if (this.selected.length === 0) {
+        this.$message.warning("至少选择一个供应商");
+        return;
       }
 
-      this.modalVisible.level = true
+      this.modalVisible.level = true;
     },
     // 刷新表格
     async searchList() {