Explorar el Código

Merge branch 'master'

xiaodai2017 hace 1 año
padre
commit
b356f0bda6
Se han modificado 36 ficheros con 1117 adiciones y 478 borrados
  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. 2 2
      src/apis/service/operate/account/index.js
  7. 4 2
      src/apis/service/operate/supplier/index.js
  8. 3 3
      src/apis/service/user/index.js
  9. 2 0
      src/components/globalComponents/search-city/index.js
  10. 118 0
      src/components/globalComponents/search-city/main.vue
  11. 0 0
      src/components/globalComponents/search-city/店铺所在市选择框
  12. 2 0
      src/components/globalComponents/search-max-area/index.js
  13. 119 0
      src/components/globalComponents/search-max-area/main.vue
  14. 0 0
      src/components/globalComponents/search-max-area/店铺会场最大面积选择框
  15. 2 0
      src/components/globalComponents/search-max-num/index.js
  16. 118 0
      src/components/globalComponents/search-max-num/main.vue
  17. 0 0
      src/components/globalComponents/search-max-num/店铺会场最大容纳人数选择框
  18. 2 0
      src/components/globalComponents/search-store-spec/index.js
  19. 119 0
      src/components/globalComponents/search-store-spec/main.vue
  20. 0 0
      src/components/globalComponents/search-store-spec/店铺场地特色选择框
  21. 2 0
      src/components/globalComponents/search-type/index.js
  22. 119 0
      src/components/globalComponents/search-type/main.vue
  23. 0 0
      src/components/globalComponents/search-type/店铺类型选择框
  24. 27 20
      src/components/globalComponents/send-verification-code/main.vue
  25. 1 1
      src/main.js
  26. 1 1
      src/router/index.js
  27. 17 15
      src/views/login/forget-password.vue
  28. 5 5
      src/views/login/index.vue
  29. 55 157
      src/views/operate/account/addEdit.vue
  30. 2 2
      src/views/operate/account/components/setRoleModal.vue
  31. 10 32
      src/views/operate/account/index.vue
  32. 1 1
      src/views/operate/account/resetPassword.vue
  33. 88 53
      src/views/operate/shop/index.vue
  34. 94 51
      src/views/operate/supplier/components/serviceChargeModal.vue
  35. 89 47
      src/views/operate/supplier/components/toPublicModal.vue
  36. 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),
+};
+   

+ 2 - 2
src/apis/service/operate/account/index.js

@@ -16,7 +16,7 @@ export default {
   // 删除
   delete: (data, params) => http(api + 'userCompanyBasicDelete', data, 'post', params),
   // 修改密码
-  setpwd: (data, params) => http(api + 'userCompanyBasicPassword', data, 'post', params),
+  setpwd: (data, params) => http('admin/user/edit', data, 'post', params),
   // 修改状态
   status: (data, params) => http(api + 'userCompanyBasicStatus', data, 'post', params),
 
@@ -24,7 +24,7 @@ export default {
   setRole: (data,params) => http(api + "setrole", data, "post", params),
 
   // 注册
-  register: (data, params) => http(loginAPI + 'register', data, 'post', params),
+  register: (data, params) => http('api/wechat/loginByMobile', data, 'post', params),
   //获取不分页角色列表
   roleQuery : (data,params) => http(roleAPI + "query", 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),
+ 
 }

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

@@ -3,9 +3,9 @@ import https from '@/apis/axios'
 
 export default {
   // 获取验证码
-  verfiy: (data, params) => http(`admin/verify_code`, data, 'post', params),
-  // 密码重置
-  resetpwd: (data, params) => http(`admin/user/passmobile`, data, 'post', params),
+  verfiy: (data, params) => http(`api/wechat/getCodebyMombile`, 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/店铺类型选择框


+ 27 - 20
src/components/globalComponents/send-verification-code/main.vue

@@ -11,10 +11,11 @@
 
 <script>
 import { isMobile } from "@/utils/validate";
-import asyncRequest from "@/apis/service/user/index";
+import asyncRequest from "@/apis/service/user";
+
 import resToken from "@/mixins/resToken";
 export default {
-  name:"sendVerificationCode",
+  name: "sendVerificationCode",
   props: {
     mobile: {
       type: String,
@@ -34,24 +35,30 @@ export default {
     getCode() {
       if (this.mobile !== "" && isMobile(this.mobile)) {
         if (this.num === 60) {
-          asyncRequest.verfiy({ mobile: this.mobile }).then(async (res) => {
-            if (res && res.code === 0) {
-              this.timer = setInterval(() => {
-                if (this.num !== 0) {
-                  this.title = `${this.num}s后可重发`;
-                  this.num--;
-                } else {
-                  clearInterval(this.timer);
-                  this.num = 60;
-                  this.title = "获取验证码";
-                }
-              }, 1000);
-            } else if (res && res.code >= 100 && res.code <= 104) {
-              await this.logout();
-            } else {
-              this.$message.warning(res.message);
-            }
-          });
+          asyncRequest
+            .verfiy({ mobile: this.mobile })
+            .then(async ({ code, msg }) => {
+              if (code === 1) {
+                this.timer = setInterval(() => {
+                  if (this.num !== 0) {
+                    this.title = `${this.num}s后可重发`;
+                    this.num--;
+                  } else {
+                    clearInterval(this.timer);
+                    this.num = 60;
+                    this.title = "获取验证码";
+                  }
+                }, 1000);
+              } else if (code === 1001) {
+                this.$message.warning("验证码发送失败!");
+              } else if (code === 1002) {
+                this.$message.warning("验证码未过期,请2分钟后重试!");
+              } else if (code === 1003) {
+                this.$message.warning("验证码发送失败!!");
+              } else {
+                this.$message.warning(msg);
+              }
+            });
         }
       } else {
         this.$emit("mobileErr", false);

+ 1 - 1
src/main.js

@@ -82,7 +82,7 @@ Vue.config.productionTip = false
 Vue.use(ElementUI)
 
 router.beforeEach((to, from, next) => {
-  if (to.path === '/login' || from.path === '/accept') {
+  if (to.path === '/login' ||to.path === '/forget-password' || from.path === '/accept') {
     next()
   } else if (getToken() === null || getToken() === undefined || getToken() === '') {
     removeMenu()

+ 1 - 1
src/router/index.js

@@ -8,7 +8,7 @@ const routes = [
   // 登录页
   {
     path: '/login',
-    component: () => import('@/views/login/index1'),
+    component: () => import('@/views/login/index'),
     hidden: true
   },
   // 忘记密码

+ 17 - 15
src/views/login/forget-password.vue

@@ -31,7 +31,7 @@
             label-position="left"
             label-width="95px"
           >
-            <el-form-item prop="username" label="账号:">
+            <!-- <el-form-item prop="username" label="账号:">
               <el-input
                 ref="username"
                 v-model="loginFormX.username"
@@ -42,7 +42,7 @@
                 maxlength="50"
                 autocomplete="on"
               />
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item prop="mobile" label="手机号:">
               <el-input
                 ref="mobile"
@@ -163,13 +163,13 @@ export default {
   name: 'Login',
   mixins: [resToken],
   data() {
-    const validateUsername = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('请输入账号'))
-      } else {
-        callback()
-      }
-    }
+    // const validateUsername = (rule, value, callback) => {
+    //   if (value === '') {
+    //     callback(new Error('请输入账号'))
+    //   } else {
+    //     callback()
+    //   }
+    // }
     const validatemobile = (rule, value, callback) => {
       if (value === '') {
         callback(new Error('手机号不能为空!'))
@@ -228,14 +228,14 @@ export default {
       num: 3,
       step: 0,
       loginFormX: {
-        username: '',
+        // username: '',
         mobile: '',
         code: ''
       },
       loginRulesX: {
-        username: [
-          { required: true, trigger: 'blur', validator: validateUsername }
-        ],
+        // username: [
+        //   { required: true, trigger: 'blur', validator: validateUsername }
+        // ],
         mobile: [
           { required: true, trigger: 'blur', validator: validatemobile }
         ],
@@ -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
@@ -316,7 +316,9 @@ export default {
               if (res && res.code === 1) {
                 this.step++
                 this.setTime()
-              } 
+              } else{
+                this.$message.warning(res.msg)
+              }
             })
           }
         } else {

+ 5 - 5
src/views/login/index.vue

@@ -91,8 +91,8 @@
           @click.native.prevent="handleLogin()"
         >登&nbsp;&nbsp;录</el-button>
 
-        <!-- <div style="position: relative; padding: 12px 0 0 0"> -->
-        <!-- <div class="tips" style="float: left">
+        <div style="position: relative; padding: 12px 0 0 0">
+       <!-- <div class="tips" style="float: left">
             <el-popover
               placement="top"
               title="初始密码:"
@@ -103,12 +103,12 @@
               <i slot="reference" class="el-icon-info" />
             </el-popover>
           </div> -->
-        <!-- <router-link to="/forget-password">
+         <router-link to="/forget-password">
             <div class="tips" style="float: right">
               <span>忘记密码</span>
             </div>
-          </router-link> -->
-        <!-- </div> -->
+          </router-link> 
+       </div>
       </el-form>
     </div>
 

+ 55 - 157
src/views/operate/account/addEdit.vue

@@ -5,7 +5,7 @@
     :center="true"
     align="left"
     top="10vh"
-    width="750px"
+    width="500px"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
     element-loading-text="拼命加载中"
@@ -25,71 +25,32 @@
             label-width="80px"
             class="demo-ruleForm"
           >
-            <el-row style="margin-bottom:20px">
-              <el-form-item prop="username" label="用户名" v-if="id === 'add'">
-                <el-input
-                  ßßsize="mini"
-                  v-model="ruleForm.username"
-                  placeholder="用户名"
-                 />
-              </el-form-item>
+            <el-form-item label="手机号" prop="mobile">
+              <el-input
+                v-model="ruleForm.mobile"
+                :placeholder="'手机号'"
+                maxlength="11"
+                :disabled="isDetail"
+              />
+            </el-form-item>
 
-              <el-col :span="24">
-                <el-form-item label="昵称" prop="nickname">
-                  <el-input
-                    v-model="ruleForm.nickname"
-                    :placeholder="'账号名'"
-                    :disabled="isDetail"
-                    maxlength="100"
-                  />
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="24">
-                <el-form-item label="密码" prop="password" v-if="id === 'add'">
-                  <el-input
-                    type="password"
-                    v-model="ruleForm.password"
-                    :placeholder="'密码'"
-                    :disabled="isDetail"
-                    maxlength="100"
-                  />
-                </el-form-item>
-              </el-col>
-              
-              <el-col :span="24">
-                <el-form-item label="手机号" prop="mobile">
-                  <el-input
-                    v-model="ruleForm.mobile"
-                    :placeholder="'手机号'"
-                    maxlength="11"
-                    :disabled="isDetail"
-                  />
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="24" v-if="id === 'add'">
-                <el-form-item label="邮箱" prop="email">
-                  <el-input
-                    v-model="ruleForm.email"
-                    :placeholder="'邮箱'"
-                    maxlength="11"
-                    :disabled="isDetail"
-                  />
-                </el-form-item>
-              </el-col>
-
-              <!-- <el-col :span="24">
-                <el-form-item label="角色等级" prop="level">
-                  <el-select size="mini" style="width:100%" :disabled="isDetail" v-model="ruleForm.level" placeholder="角色等级">
-                    <el-option />
-                  </el-select>
-                </el-form-item>
-              </el-col> -->
-            </el-row>
+            <el-form-item label="验证码" prop="code" v-if="id === 'add'">
+              <el-input
+                v-model="ruleForm.code"
+                :placeholder="'验证码'"
+                maxlength="6"
+                :disabled="isDetail"
+              >
+                <send-verification-code
+                  slot="append"
+                  :mobile="ruleForm.mobile"
+                  @phoneErr="phoneErr"
+                />
+              </el-input>
+            </el-form-item>
           </el-form>
         </el-col>
-        <el-col :span="6" class="bottom-btn">
+        <el-col :span="24" class="tr">
           <el-button v-if="!isDetail" type="primary" @click="submitForm" :size="'mini'"
             >保 存
           </el-button>
@@ -113,53 +74,17 @@ import {
 } from "@/utils/validate";
 
 /**
- * @props 
+ * @props
  *  nickname 账号名
  *  mobile 手机号
  *  level 角色等级
-*/
+ */
 
 export default {
   name: "Account",
   props: ["showModel", "id", "isDetail", "sitem"],
   mixins: [resToken],
   data() {
-    const validateusername = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("账号不能为空!"));
-      } else {
-        if (value.length < 6 || value.length > 18) {
-          callback(new Error("账号规则为6~18位数字与字母组合!"));
-        } else {
-          if (isnumber(value)) {
-            callback(new Error("账号规则为6~18位数字与字母组合!"));
-          } else if (validAlphabets(value)) {
-            callback(new Error("账号规则为6~18位数字与字母组合!"));
-          } else if (!isAlphanumeric(value)) {
-            callback(new Error("账号规则为6~18位数字与字母组合!"));
-          } else {
-            callback();
-          }
-        }
-      }
-    };
-
-    const validatename = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("账号名不能为空!"));
-      } else {
-        if (value.length < 2 || value.length > 12) {
-          callback(new Error("账号名规则为2~12位!"));
-        } else {
-          if (isEmoticon(value)) {
-            callback(new Error("账号名规则为2~12位!"));
-          } else {
-            callback();
-          }
-        }
-      }
-    };
-
     const validatemobile = (rule, value, callback) => {
       if (value === "") {
         callback(new Error("手机号不能为空!"));
@@ -182,35 +107,25 @@ export default {
       is_mainoptions: [],
       isIndeterminate: false,
       ruleForm: {
-        password:"",
-        username:"",
-        nickname: "", // 账号名
         mobile: "", //手机号
-        role_id: "", //角色id
+        code: "",
       },
       platformoptions: [],
       rules: {
-        nickname: [
+        mobile: [
           {
             required: true,
-            validator: validatename,
+            validator: validatemobile,
             trigger: "blur",
           },
         ],
-        mobile: [
+        code: [
           {
             required: true,
-            validator: validatemobile,
             trigger: "blur",
+            message: "角色等级",
           },
         ],
-        level:[
-          {
-            required:true,
-            trigger:'blur',
-            message:'角色等级'
-          }
-        ]
       },
     };
   },
@@ -219,6 +134,7 @@ export default {
       this.showModelThis = val;
       if (val) {
         this.initForm();
+        console.log(this.ruleForm);
       }
     },
     showModelThis(val) {
@@ -229,9 +145,11 @@ export default {
   },
   mounted() {},
   methods: {
-    itemidChange(e) {
-      this.ruleForm.itemid = e;
-      this.$refs.ruleForm.validateField("itemid");
+  
+    phoneErr(e) {
+      if (!e) {
+        this.$refs.ruleForm.validateField("mobile");
+      }
     },
     async initForm() {
       this.loading = true;
@@ -261,7 +179,7 @@ export default {
       if (code === 1) {
         this.organizeList = data;
         this.recursion(this.organizeList);
-      } 
+      }
     },
     handleCheckedCitiesChange(value) {
       console.log(value);
@@ -305,7 +223,7 @@ export default {
       });
       if (code === 1) {
         await this.resetForm(data);
-      } 
+      }
     },
     async resetForm() {
       // 重置
@@ -314,33 +232,25 @@ export default {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
           if (this.sitem) {
-            const {
-              email,
-              password,
-              username,
-              nickname,
-              mobile,
-              id
-            } = this.sitem;
+            const { email, password, username, nickname, mobile, id } = this.sitem;
 
             this.ruleForm = {
               id,
-              email:email || "",
-              password:password || "",
-              username:username || "",
+              email: email || "",
+              password: password || "",
+              username: username || "",
               nickname: nickname || "",
-              mobile: mobile || ""
+              mobile: mobile || "",
+              code: "",
             };
-
-
-
           } else {
             this.ruleForm = {
-              email:"",
-              password:"",
-              username:"",
+              email: "",
+              password: "",
+              username: "",
               nickname: "", // 账号名
-              mobile: ""
+              mobile: "",
+              code: "",
             };
           }
         }
@@ -351,15 +261,9 @@ export default {
         if (valid) {
           if (!this.loading) {
             this.loading = true;
-            const {
-              username,
-              nickname,
-              password,
-              mobile,
-              email,
-              id
-            } = JSON.parse(JSON.stringify(this.ruleForm));
-
+            const { username, nickname, password, mobile, email, id,code } = JSON.parse(
+              JSON.stringify(this.ruleForm)
+            );
 
             const model = {
               password,
@@ -367,7 +271,8 @@ export default {
               username,
               mobile,
               email,
-              id
+              id,
+              code
             };
 
             let res = {};
@@ -401,12 +306,5 @@ export default {
 
 <style lang="scss" scoped>
 .account {
-  .bottom-btn {
-    position: absolute;
-    bottom: 0px;
-    right: 0;
-    text-align: right;
-    z-index: 2;
-  }
 }
 </style>

+ 2 - 2
src/views/operate/account/components/setRoleModal.vue

@@ -1,8 +1,8 @@
 <template>
   <el-dialog title="设置角色" :visible="visible" @close="handleClose" :close-on-click-modal="false"> 
     <el-form label-width="80px" v-if="info" :rules="rules" :model="ruleForm" ref="ruleForm">
-      <el-form-item label="昵称">
-        <el-input disabled v-model="info.nickname" placeholder="昵称" />
+      <el-form-item label="手机号">
+        <el-input disabled v-model="info.mobile" placeholder="手机号" />
       </el-form-item>
 
       <el-form-item label="角色" prop="role_id">

+ 10 - 32
src/views/operate/account/index.vue

@@ -46,25 +46,6 @@
                     />
                   </el-select>
                 </el-col>
-                <el-col :span="4" style="width: 150px; padding: 0 0 0 10px">
-                  <el-input
-                    :size="searchSize"
-                    v-model="parmValue.nickname"
-                    clearable
-                    :maxlength="40"
-                    placeholder="账号名"
-                    @blur="
-                      pageInfo.curr = 1;
-                      parmValue.page = 1;
-                      searchList();
-                    "
-                    @clear="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              searchList();
-            "
-                  />
-                </el-col>
                 <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
@@ -102,7 +83,7 @@
                   </el-button>
                 </el-col>
                 <el-col :span="3" style="width: 125px; float: right">
-                  <el-button type="primary" size="mini"  @click="openModal('add', false, {})">注册</el-button>
+                  <el-button type="success" size="mini"  @click="openModal('add', false, {})">新建</el-button>
                   <el-button
                     :size="searchSize"
                     type="primary"
@@ -142,14 +123,15 @@
           ></el-tag>
         </template>
         <template #operation="{ scope }">
-          <el-tooltip
+           <el-tooltip
+            v-if="powers.some((i) => i == '002')"
             effect="dark"
-            content="详情"
+            content="重置密码"
             placement="top"
           >
             <i
-              class="el-icon-view tb-icon"
-              @click="openModal(scope.row.id, true, scope.row)"
+              class="el-icon-refresh-left tb-icon"
+              @click="openPasswordModal(scope.row.id, false)"
             ></i>
           </el-tooltip>
           <el-tooltip
@@ -198,7 +180,6 @@
         @cancel="passwordModel = false"
       />
     </div>
-  </div>
 </template>
 <script>
 import asyncRequest from "@/apis/service/operate/account";
@@ -208,12 +189,13 @@ import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
 import addEdit from "./addEdit";
 import SetRoleModal from "./components/setRoleModal.vue"
-
+import resetPassword from "./resetPassword";
 export default {
   name: "account",
   components: {
     addEdit,
-    SetRoleModal
+    SetRoleModal,
+    resetPassword
   },
   mixins: [mixinPage, resToken],
   computed: {
@@ -266,15 +248,11 @@ export default {
           prop: "mobile",
           label: "联系电话",
         },
-        {
-          prop: "nickname",
-          label: "昵称",
-        },
+      
         {
           prop: "status",
           label: "状态",
           _slot_: "status",
-          width: "70px",
         },
         {
           prop:'role_name',

+ 1 - 1
src/views/operate/account/resetPassword.vue

@@ -61,7 +61,7 @@
   </el-dialog>
 </template>
 <script>
-import asyncRequest from "@/apis/service/interest/account";
+import asyncRequest from "@/apis/service/operate/account";
 import { isnumber, isAlphanumeric, validAlphabets } from "@/utils/validate";
 import resToken from "@/mixins/resToken";
 export default {

+ 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

@@ -64,7 +64,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"
@@ -99,23 +99,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"
@@ -148,11 +155,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)"
@@ -182,48 +185,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')"
@@ -237,8 +222,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>
@@ -250,12 +247,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
@@ -265,12 +262,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"]),
@@ -284,7 +281,7 @@ export default {
   data() {
     return {
       supplierLevelList,
-      currentRow:{},
+      currentRow: {},
       statusList,
       roleLevel: roleLevel,
       loading: true,
@@ -296,26 +293,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: "未上传" },
@@ -339,8 +336,8 @@ export default {
       // 表格 - 列参数
       columns: [
         {
-          type:'selection',
-          width:'40px'
+          type: "selection",
+          width: "40px",
         },
         {
           prop: "code",
@@ -356,12 +353,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",
         },
         {
@@ -406,9 +403,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) {
@@ -439,12 +436,12 @@ export default {
       this.parmValue = {
         page: 1, // 页码
         size: 15, // 每页显示条数
-        start:"", // 创建开始时间
-        end:"", // 创建结束时间
-        status:"", // 状态
-        name:"", // 供应商名称
-        creator:"", // 创建人
-        level: "" // 供应商等级
+        start: "", // 创建开始时间
+        end: "", // 创建结束时间
+        status: "", // 状态
+        name: "", // 供应商名称
+        creator: "", // 创建人
+        level: "", // 供应商等级
       };
       this.searchList();
     },
@@ -467,8 +464,8 @@ export default {
         await this.searchList();
       }
     },
-    handleSelection({list}){
-      this.selected = list
+    handleSelection({ list }) {
+      this.selected = list;
     },
     gotoEdit(row, type) {
       // const { status } = row;
@@ -501,13 +498,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("取消");
@@ -530,19 +526,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() {