xiaodai2022 2 năm trước cách đây
mục cha
commit
32a237d7fc

+ 21 - 0
src/apis/service/serviceParam/supplierAccount/index.js

@@ -0,0 +1,21 @@
+// 物业管理员
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 分页查询
+  slist: (data, params) => http(api + "supplerlist", data, "post", params),
+  // 添加
+  add: (data, params) => http(api + "addAccount", data, "post", params),
+  // 删除
+  delete: (data, params) => http(api + "supplerdelete", data, "post", params),
+  // 分页查询
+  list: (data, params) => http(api + "geAccounttList", data, "post", params),
+  // 更新
+  update: (data, params) => http(api + "editAccount", data, "post", params),
+  // 修改状态
+  status: (data, params) => http(api + "statusAccount", data, "post", params),
+  // 详情
+  detail: (data, params) => http(api + "deleteAccount", data, "post", params),
+  // 修改密码
+  setpwd: (data, params) => http(api + "passset", data, "post", params),
+};

+ 420 - 0
src/views/serviceParam/supplierAccount/addEdit.vue

@@ -0,0 +1,420 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="10vh"
+    width="750px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card style="margin-top: -20px">
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :size="'mini'"
+            :rules="rulesThis"
+            label-width="80px"
+            class="demo-ruleForm"
+          >
+            <el-row>
+              <el-col :span="24">
+                <el-form-item label="真实姓名" prop="name">
+                  <el-input
+                    v-model="ruleForm.name"
+                    :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">
+                <el-form-item label="邮箱" prop="email">
+                  <el-input
+                    v-model="ruleForm.email"
+                    :placeholder="'邮箱'"
+                    maxlength="100"
+                    :disabled="isDetail"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="24" class="bottom-btn">
+                <el-button
+                  v-if="!isDetail"
+                  type="primary"
+                  @click="submitForm"
+                  :size="'mini'"
+                  >保 存
+                </el-button>
+                <el-button @click="showModelThis = false" :size="'mini'">{{
+                  isDetail ? "关 闭" : "取 消"
+                }}</el-button>
+              </el-col>
+            </el-row>
+          </el-form>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/serviceParam/supplierAccount";
+import resToken from "@/mixins/resToken";
+import {
+  isnumber,
+  isMobile,
+  validEmail,
+  isAlphanumeric,
+  isChinese,
+  isEmoticon,
+  validAlphabets,
+} from "@/utils/validate";
+export default {
+  name: "Account",
+  props: ["showModel", "id", "isDetail"],
+  mixins: [resToken],
+  data() {
+    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 (!isChinese(value)) {
+            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("手机号不能为空!"));
+      } else {
+        if (!isMobile(value)) {
+          callback(new Error("手机号格式不正确!"));
+        } else {
+          callback();
+        }
+      }
+    };
+
+    const validateEmail = (rule, value, callback) => {
+      if (value === "") {
+        callback();
+      } else {
+        if (!validEmail(value)) {
+          callback(new Error("邮箱格式不正确!"));
+        } else {
+          callback();
+        }
+      }
+    };
+    return {
+      roleList: [],
+      loading: false,
+      title: "添加供应商账号",
+      organizeList: [],
+      showModelThis: this.showModel,
+      coptions: [],
+      is_mainoptions: [],
+      isIndeterminate: false,
+      ruleForm: {
+        supplierNo: "",
+        nickname: "", // 真实姓名
+        mobile: "",
+        email: "",
+      },
+      platformoptions: [],
+      rulesThis: this.rules,
+      rules: {
+        nickname: [
+          {
+            required: true,
+            validator: validatename,
+            trigger: "blur",
+          },
+        ],
+
+        mobile: [
+          {
+            required: true,
+            validator: validatemobile,
+            trigger: "blur",
+          },
+        ],
+        email: [
+          {
+            required: false,
+            validator: validateEmail,
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  mounted() {},
+  methods: {
+    async initForm() {
+      this.loading = true;
+      if (this.id === "add") {
+        await this.resetForm();
+      } else {
+        await this.initData();
+      }
+      if (this.id === "add") {
+        this.title = "添加供应商账号";
+        this.rulesThis = this.rules;
+      } else {
+        if (this.isDetail) {
+          this.title = "供应商账号详情";
+          this.rulesThis = {};
+        } else {
+          this.title = "修改供应商账号";
+          this.rulesThis = this.rules;
+        }
+      }
+      this.loading = false;
+    },
+    async initData() {
+      const { code, data, message } = await asyncRequest.detail({
+        id: this.id,
+      });
+      if (code === 0) {
+        await this.resetForm(data);
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+    async resetForm(sitem) {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          if (sitem) {
+            const {
+              username,
+              nickname,
+              mobile,
+              email,
+              roleid,
+              status,
+              depart,
+              business,
+              platform,
+            } = sitem;
+            let depart_code = [];
+            if (depart && depart.length > 0) {
+              depart.forEach((a) => {
+                depart_code.push(a.depart_code);
+              });
+            }
+            let copyBusiness =
+              business && business.length > 0 ? JSON.parse(JSON.stringify(business)) : [];
+
+            let businessList =
+              business && business.length > 0 ? JSON.parse(JSON.stringify(business)) : [];
+            businessList.forEach((a, ai) => {
+              let sindex = this.coptions.findIndex((b) => b.id == a.businessid);
+              if (sindex === -1) {
+                copyBusiness.splice(ai, 1);
+              }
+            });
+            let is_all = false,
+              add = 0;
+            // if(copyBusiness.length===)
+
+            let resbusinesslist = [],
+              is_main = "";
+            if (copyBusiness && copyBusiness.length > 0) {
+              copyBusiness.forEach((a) => {
+                resbusinesslist.push(a.businessid);
+                if (a.is_main === "1") {
+                  is_main = a.businessid;
+                }
+              });
+            }
+
+            let copyplatform =
+              platform && platform.length > 0 ? JSON.parse(JSON.stringify(platform)) : [];
+            let platformList =
+              platform && platform.length > 0 ? JSON.parse(JSON.stringify(platform)) : [];
+            platformList.forEach((a, ai) => {
+              let sindex = this.platformoptions.findIndex((b) => b.id == a.id);
+              if (sindex === -1) {
+                copyplatform.splice(ai, 1);
+              }
+            });
+            let resplatformlist = [];
+            if (copyplatform && copyplatform.length > 0) {
+              copyplatform.forEach((a) => {
+                resplatformlist.push(a.id);
+              });
+            }
+
+            this.ruleForm = {
+              username: username || "", // 供应商账号
+              name: nickname || "", // 真实姓名
+              mobile: mobile || "",
+              email: email || "",
+              role_id: roleid || "",
+              status: status || "",
+              itemid: depart_code,
+              is_main: is_main || "",
+              companyArr: resbusinesslist || [],
+              platform: resplatformlist || [],
+              is_all: resbusinesslist.length === this.coptions.length,
+            };
+            this.isIndeterminate =
+              resbusinesslist.length > 0 && resbusinesslist.length < this.coptions.length;
+          } else {
+            this.ruleForm = {
+              username: "", // 供应商账号
+              name: "", // 真实姓名
+              mobile: "",
+              email: "",
+              role_id: "",
+              is_all: "",
+              status: "1",
+              itemid: [],
+              companyArr: [],
+              is_main: "",
+              platform: [],
+            };
+            this.handleCheckAllChange();
+          }
+        }
+      });
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          if (!this.loading) {
+            this.loading = true;
+            const {
+              username,
+              name,
+              mobile,
+              email,
+              role_id,
+              status,
+              itemid,
+              is_main,
+              is_all,
+              companyArr,
+              platform,
+            } = JSON.parse(JSON.stringify(this.ruleForm));
+            let list = [],
+              isok = true;
+            companyArr.forEach((e) => {
+              let item = {
+                businessid: e,
+                is_main: is_main === e ? "1" : "0",
+              };
+              list.push(item);
+              let findex = this.coptions.findIndex((a) => a.id === e && a.status === "0");
+              if (findex !== -1) {
+                isok = false;
+              }
+            });
+            if (!isok) {
+              this.$message.warning("不能选择禁用的业务企业!");
+              this.loading = true;
+              return;
+            }
+            const model = {
+              id: this.id,
+              username: username || "", // 供应商账号
+              nickname: name || "", // 真实姓名
+              mobile: mobile || "",
+              email: email || "",
+              role: role_id || "",
+              status: status || "",
+              itemid: itemid || [],
+              is_all: is_all ? "1" : "0",
+              platform: platform || [],
+              companyArr: list,
+            };
+            let res = {};
+            if (this.id === "add") {
+              delete model["id"];
+              res = await asyncRequest.add(model);
+            } else {
+              res = await asyncRequest.update(model);
+            }
+            this.loading = false;
+            if (res && res.code === 0) {
+              const title = this.id === "add" ? "添加成功" : "修改成功";
+              this.$notify.success({
+                title,
+                message: "",
+              });
+              this.showModelThis = false;
+              // 刷新
+              this.$emit("refresh");
+            } else if (res && res.code >= 100 && res.code <= 104) {
+              await this.logout();
+            } else {
+              this.$message.warning(res.message);
+            }
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.account {
+  .bottom-btn {
+    position: absolute;
+    bottom: 0px;
+    right: 0;
+    text-align: right;
+    z-index: 2;
+  }
+}
+</style>

+ 593 - 0
src/views/serviceParam/supplierAccount/columns.js

@@ -0,0 +1,593 @@
+import { isSpecialSymbol, hasSpace } from "@/utils/validate";
+
+//是否定制
+const options1 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+];
+//专属类型
+const options2 = [
+  { id: "0", name: "非泰康" },
+  { id: "1", name: "泰康" },
+];
+//销售权限
+const options3 = [
+  { id: "0", name: "无销售权限" },
+  { id: "1", name: "有销售权限" },
+];
+
+//是否库存品
+const options4 = [
+  { id: "0", name: "非库存品" },
+  { id: "1", name: "库存品" },
+];
+//是否启用实时金价
+const options5 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+];
+//供货区域
+const options6 = [
+  { id: "1", name: "全国" },
+  { id: "2", name: "全国除偏远" },
+];
+//是否启用阶梯
+const options7 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+];
+
+//有无工差
+const options8 = [
+  { id: "0", name: "无工差" },
+  { id: "1", name: "有工差" },
+];
+//配置要求
+const options9 = ["证书", "包装盒", "绒布袋", "标签", "其他"];
+const listCol = [
+  { type: "selection", fixed: "left", _noset_: true },
+  {
+    prop: "spuCode",
+    label: "编号",
+    width: "160px",
+  },
+  {
+    prop: "good_thumb_img",
+    label: "图片",
+    _slot_: "good_thumb_img",
+    width: "45px",
+  },
+  {
+    prop: "good_name",
+    label: "名称",
+    "min-width": "160px",
+  },
+  {
+    prop: "cat_name",
+    label: "分类",
+  },
+  {
+    prop: "brand_name",
+    label: "品牌",
+  },
+  {
+    prop: "isonline",
+    label: "是否上线",
+    _slot_: "isonline",
+    width: "70px",
+  },
+  {
+    prop: "status",
+    label: "状态",
+    _slot_: "status",
+    width: "118px",
+  },
+  {
+    prop: "supplierNo",
+    label: "供应商编号",
+    width: "110px",
+  },
+  {
+    prop: "supplier_name",
+    label: "供应商名称",
+    width: "110px",
+  },
+  {
+    prop: "companyNo",
+    label: "业务公司编号",
+    width: "110px",
+  },
+  {
+    prop: "company",
+    label: "业务公司名称",
+    width: "110px",
+  },
+  {
+    prop: "company_name",
+    label: "创建人部门",
+    minWidth: "150px",
+  },
+  {
+    prop: "creater",
+    label: "创建人",
+    width: "70px",
+  },
+
+  {
+    prop: "addtime",
+    label: "创建时间",
+    width: "140px",
+  },
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    _noset_: true,
+    width: "200px",
+    _slot_: "operation",
+  },
+];
+const validate_num = (rule, value, callback) => {
+  const { required } = rule;
+  if (required && value === "") {
+    callback(new Error("不能为空!"));
+  } else {
+    callback();
+  }
+};
+const validate_num_0 = (rule, value, callback) => {
+  const { required } = rule;
+  if (required && value === "") {
+    callback(new Error("不能为空!"));
+  } else if (
+    required &&
+    (value === "0" ||
+      value === "0." ||
+      value === "0.0" ||
+      value === "0.00" ||
+      value === "0.000")
+  ) {
+    callback(new Error("不能为零!"));
+  } else {
+    callback();
+  }
+};
+const validate_good_img = (rule, value, callback) => {
+  const { required } = rule;
+  if (required && value.length == 0) {
+    callback(new Error("请上传商品主图!"));
+  } else if (required && (value.length < 3 || value.length > 10)) {
+    callback(new Error("商品主图应为3~10张!"));
+  } else {
+    callback();
+  }
+};
+const validate_desc = (rule, value, callback) => {
+  const { required } = rule;
+  if (required && value.length == 0) {
+    callback(new Error("不能为空!"));
+  } else if (isSpecialSymbol(value)) {
+    callback(new Error("不能使用英文特殊字符!"));
+  } else {
+    callback();
+  }
+};
+const validate_good_name = (rule, value, callback) => {
+  const { required } = rule;
+  if (required && value.length == 0) {
+    callback(new Error("不能为空!"));
+  } else if (hasSpace(value)) {
+    callback(new Error("不能出现回车/换行符!"));
+  } else if (isSpecialSymbol(value)) {
+    callback(new Error("不能使用英文特殊字符!"));
+  } else {
+    callback();
+  }
+};
+const rules = {
+  cat_id: [
+    {
+      type: "array",
+      required: true,
+      message: "请选择商品分类",
+      trigger: "change",
+    },
+  ],
+  brandid: [
+    {
+      type: "array",
+      required: true,
+      message: "请选择商品品牌",
+      trigger: "change",
+    },
+  ],
+  noble_weight: [
+    {
+      required: true,
+      validator: validate_num_0,
+      trigger: "blur",
+    },
+  ],
+  weight: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
+  good_type: [
+    {
+      required: true,
+      message: "请选择是否定制",
+      trigger: "change",
+    },
+  ],
+  is_stock: [
+    {
+      required: true,
+      message: "请选择是否库存品",
+      trigger: "change",
+    },
+  ],
+  company_id: [
+    {
+      required: true,
+      message: "请选择业务公司",
+      trigger: "change",
+    },
+  ],
+  supplierNo: [
+    {
+      type: "array",
+      required: true,
+      message: "请选择供应商",
+      trigger: "change",
+    },
+  ],
+  is_auth: [
+    {
+      required: true,
+      message: "请选择是否有权限销售",
+      trigger: "change",
+    },
+  ],
+  tax: [
+    {
+      required: true,
+      message: "请选择税率",
+      trigger: "change",
+    },
+  ],
+  good_name: [
+    {
+      required: true,
+      validator: validate_good_name,
+      trigger: "blur",
+    },
+  ],
+  unit: [
+    {
+      type: "array",
+      required: true,
+      message: "请输入商品单位",
+      trigger: "blur",
+    },
+  ],
+  is_exclusive: [
+    {
+      required: true,
+      type: "array",
+      message: "请选择专属类型",
+      trigger: "change",
+    },
+  ],
+  noble_metal: [
+    {
+      required: true,
+      message: "请选择贵金属种类",
+      trigger: "change",
+    },
+  ],
+  is_gold_price: [
+    {
+      required: true,
+      message: "请选择是否启用实时金价",
+      trigger: "change",
+    },
+  ],
+  moq: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
+  stock_moq: [
+    {
+      required: true,
+      validator: validate_num_0,
+      trigger: "blur",
+    },
+  ],
+  customized: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
+  after_sales: [
+    {
+      required: true,
+      message: "售后说明不能为空",
+      trigger: "blur",
+    },
+    {
+      required: true,
+      validator: validate_desc,
+      trigger: "blur",
+    },
+  ],
+  // isSpecialSymbol
+  good_remark: [
+    {
+      required: true,
+      message: "商品备注不能为空",
+      trigger: "blur",
+    },
+    {
+      required: true,
+      validator: validate_desc,
+      trigger: "blur",
+    },
+  ],
+  //包装/发货/图片
+  packing_list: [
+    {
+      required: true,
+      message: "请输入包装清单",
+      trigger: "blur",
+    },
+  ],
+  packing_way: [
+    {
+      required: true,
+      message: "请输入包装方式",
+      trigger: "blur",
+    },
+  ],
+
+  packing_spec: [
+    {
+      required: true,
+      message: "请输入装箱规格",
+      trigger: "blur",
+    },
+  ],
+  packing_weight: [
+    {
+      required: true,
+      message: "请输入装箱重量",
+      trigger: "blur",
+    },
+  ],
+  packing_szie: [
+    {
+      required: true,
+      message: "请输入装箱尺寸",
+      trigger: "blur",
+    },
+  ],
+  supply_area: [
+    {
+      required: true,
+      message: "请选择供货区域",
+      trigger: "change",
+    },
+  ],
+  delivery_place: [
+    {
+      type: "array",
+      required: true,
+      message: "请选择发货地",
+      trigger: "change",
+    },
+  ],
+  origin_place: [
+    {
+      type: "array",
+      required: true,
+      message: "请选择产地",
+      trigger: "change",
+    },
+  ],
+  delivery_day: [
+    {
+      required: true,
+      message: "请输入物流时间",
+      trigger: "blur",
+    },
+  ],
+  lead_time: [
+    {
+      required: true,
+      message: "请输入供货周期",
+      trigger: "blur",
+    },
+  ],
+  sample_day: [
+    {
+      required: true,
+      message: "请输入调样周期",
+      trigger: "blur",
+    },
+  ],
+  packing_size: [
+    {
+      required: true,
+      message: "请输入装箱尺寸",
+      trigger: "blur",
+    },
+  ],
+  good_size: [
+    {
+      required: true,
+      message: "请输入商品尺寸",
+      trigger: "blur",
+    },
+  ],
+  good_thumb_img: [
+    {
+      required: true,
+      message: "请上传商品缩略图",
+      trigger: "change",
+    },
+  ],
+  good_img: [
+    {
+      type: "array",
+      required: true,
+      validator: validate_good_img,
+      trigger: "change",
+    },
+  ],
+  good_info_img: [
+    {
+      type: "array",
+      required: true,
+      message: "至少上传一张商品详情介绍图",
+      trigger: "change",
+    },
+  ],
+  demo_fee: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
+  is_diff: [
+    {
+      required: true,
+      message: "请选择有无工差",
+      trigger: "change",
+    },
+  ],
+  config: [
+    {
+      required: true,
+      type: "array",
+      message: "请选择配置要求",
+      trigger: "change",
+    },
+  ],
+  other_config: [
+    {
+      required: true,
+      message: "其他要求不能为空",
+      trigger: "blur",
+    },
+  ],
+  open_fee: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
+  sample_fee: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
+  market_price: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
+
+  cgd_gold_price: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
+  craft_desc: [
+    {
+      required: false,
+      validator: validate_desc,
+      trigger: "blur",
+    },
+  ],
+
+  // is_step: {
+  //   required: true,
+  //   message: "请选择是否启用阶梯",
+  //   trigger: "change",
+  // },
+};
+ // 表格 - 列参数
+ const columns= [
+  {
+    prop: "id",
+    label: "Id",
+  },
+  {
+    prop: "nickname",
+    label: "姓名",
+  },
+  {
+    prop: "mobile",
+    label: "手机号",
+  },
+  {
+    prop: "email",
+    label: "邮箱",
+  },
+  {
+    prop: "status",
+    label: "状态",
+    _slot_: "status",
+
+    width: "80",
+  },
+
+
+  {
+    prop: "creater",
+    label: "创建人",
+    width: "100",
+  },
+  {
+    prop: "addtime",
+    label: "创建时间",
+    width: "145",
+  },
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    width: "140",
+    _noset_: true,
+    _slot_: "operation",
+  },
+];
+export {
+  options1,
+  options2,
+  options3,
+  options4,
+  options5,
+  options6,
+  options7,
+  options8,
+  options9,
+  listCol,
+  rules,
+  columns
+};

+ 525 - 0
src/views/serviceParam/supplierAccount/index.vue

@@ -0,0 +1,525 @@
+<template>
+  <div class="supplierAccount">
+    <div class="supplierAccount_show_box" v-if="powers.some((i) => i == '001')">
+      <div class="role-list fl">
+        <supplierlist @change="supplierChange" />
+      </div>
+      <div class="rule-view fr">
+        <ex-table
+          v-loading="loading"
+          :table="table"
+          :data="tableData"
+          :columns="columns"
+          :page="pageInfo"
+          :size="size"
+          @page-curr-change="handlePageChange"
+          @page-size-change="handleSizeChange"
+          @screen-reset="
+            pageInfo.curr = 1;
+            parmValue.page = 1;
+            searchList();
+          "
+          @screen-submit="
+            pageInfo.curr = 1;
+            parmValue.page = 1;
+            searchList();
+          "
+        >
+          <template #table-header="{}">
+            <div style="width: 100%">
+              <el-row style="padding: 0 0 0 80px">
+                <el-col :span="4" style="width: 160px">
+                  <el-select
+                    v-model="parmValue.status"
+                    filterable
+                    clearable
+                    :size="searchSize"
+                    placeholder="状态"
+                    style="width: 100%"
+                    @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  >
+                    <el-option
+                      v-for="item in statusList"
+                      :key="'status' + item.code"
+                      :label="item.name"
+                      :value="item.code"
+                    />
+                  </el-select>
+                </el-col>
+                <el-col :span="4" style="width: 200px; padding: 0 0 0 10px">
+                  <el-input
+                    :size="searchSize"
+                    v-model="parmValue.keyword"
+                    :maxlength="40"
+                    @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                    placeholder="姓名/手机号"
+                  ></el-input>
+                </el-col>
+
+                <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+                  <el-button type="primary" :size="searchSize" @click="searchList">
+                    刷新
+                  </el-button>
+                </el-col>
+                <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+                  <el-button type="warning" :size="searchSize" @click="restSearch">
+                    重置
+                  </el-button>
+                </el-col>
+                <el-col
+                  :span="3"
+                  class="fr"
+                  style="width: 66px; padding: 0 0 0 10px"
+                  v-if="powers.some((i) => i == '003')"
+                >
+                  <el-button
+                    :size="searchSize"
+                    type="success"
+                    style="float: right"
+                    @click="openModal('add', false)"
+                  >
+                    添加
+                  </el-button>
+                </el-col>
+              </el-row>
+            </div></template
+          >
+          <template #status="{ scope }">
+            <el-tag
+              :size="tablebtnSize"
+              :type="scope.row.status == '0' ? 'warning' : ''"
+              v-text="
+                (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
+                '--'
+              "
+            ></el-tag>
+          </template>
+          <template #ocr_status="{ scope }">
+            <el-tag
+              :size="tablebtnSize"
+              :type="
+                scope.row.ocr_status == '0'
+                  ? 'info'
+                  : scope.row.ocr_status == '1'
+                  ? 'primary'
+                  : scope.row.ocr_status == '2'
+                  ? 'danger'
+                  : ''
+              "
+              v-text="
+                (ocr_status.find((item) => item.id == scope.row.ocr_status) || {})
+                  .label || '--'
+              "
+            ></el-tag>
+          </template>
+
+          <template #operation="{ scope }">
+            <el-tooltip
+              v-if="powers.some((i) => i == '007')"
+              effect="dark"
+              content="详情"
+              placement="top"
+            >
+              <i class="el-icon-view tb-icon" @click="openModal(scope.row.uid, true)"></i>
+            </el-tooltip>
+            <el-tooltip
+              v-if="powers.some((i) => i == '005')"
+              effect="dark"
+              content="修改"
+              placement="top"
+            >
+              <i
+                class="el-icon-edit tb-icon"
+                @click="openModal(scope.row.uid, false)"
+              ></i>
+            </el-tooltip>
+            <el-tooltip
+              v-if="powers.some((i) => i == '004') && scope.row.status === '1'"
+              effect="dark"
+              content="禁用"
+              placement="top"
+            >
+              <i
+                class="el-icon-video-pause tb-icon"
+                @click="changeStatus(scope.row.id, scope.row.status)"
+              ></i>
+            </el-tooltip>
+            <el-tooltip
+              v-if="powers.some((i) => i == '004') && scope.row.status === '0'"
+              effect="dark"
+              content="启用"
+              placement="top"
+            >
+              <i
+                class="el-icon-video-play tb-icon"
+                @click="changeStatus(scope.row.id, scope.row.status)"
+              ></i>
+            </el-tooltip>
+            <el-tooltip
+              v-if="powers.some((i) => i == '006')"
+              effect="dark"
+              content="删除"
+              placement="top"
+            >
+              <i class="el-icon-delete tb-icon" @click="deleteItem(scope.row.id)"></i>
+            </el-tooltip>
+          </template>
+        </ex-table>
+      </div>
+      <add-edit
+        :id="modelId"
+        :sitem="sitem"
+        :show-model="showModel"
+        :is-detail="isDetail"
+        @refresh="searchList"
+        @cancel="showModel = false"
+      />
+
+      <reset-password
+        :id="passwordModelId"
+        :show-model="passwordModel"
+        :is-detail="isPasswordDetail"
+        @refresh="searchList"
+        @cancel="passwordModel = false"
+      />
+    </div>
+
+    <no-auth v-else></no-auth>
+  </div>
+</template>
+<script>
+import asyncRequest from "@/apis/service/serviceParam/supplierAccount";
+import { statusList } from "@/assets/js/statusList";
+import mixinPage from "@/mixins/elPaginationHandle";
+import { mapGetters } from "vuex";
+import supplierlist from "./supplierlist";
+import addEdit from "./addEdit";
+import resetPassword from "./resetPassword";
+import resToken from "@/mixins/resToken";
+import { columns } from "./columns";
+export default {
+  name: "supplierAccount",
+  mixins: [mixinPage, resToken],
+  components: {
+    supplierlist,
+    addEdit,
+    resetPassword,
+  },
+  computed: {
+    //组件SIZE设置
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "supplierAccount"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      statusList: statusList,
+      loading: true,
+
+      stype: {},
+      parmValue: {
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        supplierNo: "",
+        keyword: "",
+        status: "",
+      },
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      passwordModel: false,
+      passwordModelId: 0,
+      isPasswordDetail: false,
+      // 状态
+      statusOptions: [
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
+      ],
+      ocr_status: [
+        { id: "0", label: "未上传" },
+        { id: "1", label: "识别成功" },
+        { id: "2", label: "识别失败" },
+      ],
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns,
+    };
+  },
+
+  methods: {
+    async supplierChange(e) {
+      this.parmValue.page = 1;
+      this.parmValue.supplierNo = e;
+      await this.searchList();
+    },
+
+    restSearch() {
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.parmValue.page = 1;
+      this.parmValue.size = 15;
+      this.parmValue.keyword = "";
+      this.parmValue.status = "";
+      this.searchList();
+    },
+    openModal(id, isDetail) {
+      if (this.parmValue.supplierNo === "") {
+        this.$message.warning("请选择供应商!");
+        return;
+      }
+      this.modelId = id;
+      this.isDetail = isDetail;
+      this.sitem = this.parmValue.supplierNo;
+      this.showModel = true;
+    },
+    openPasswordModal(id, isDetail) {
+      this.passwordModel = true;
+      this.passwordModelId = id;
+      this.isPasswordDetail = isDetail;
+    },
+
+    gotoEdit(row, type) {
+      const { status } = row;
+      if (type === "005" && status === "1") {
+        this.$message.warning("禁用后,才可以修改!");
+        return;
+      }
+      this.routeGoto("supplierAccountDetail", {
+        id: row.code,
+        type: "edit",
+      });
+    },
+    /**
+     * 启用/禁用
+     * @param {String} id id
+     * @param {String} status 0-禁用 1-启用
+     */
+    async changeStatus(id, status) {
+      await this.$confirm(`确定要改为${status === "1" ? "禁用" : "启用"}?`, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+          const model = {
+            id: id,
+            status: status === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.status(model);
+          if (res && res.code === 0) {
+            this.loading = false;
+            this.$notify.success({
+              title: "状态修改成功!",
+              message: "",
+            });
+            await this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.loading = false;
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    async deleteItem(id) {
+      await this.$confirm("确定要删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const model = {
+            id: id,
+          };
+          const res = await asyncRequest.delete(model);
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "删除成功",
+              message: "",
+            });
+            this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    // 刷新表格
+    async searchList() {
+      if (
+        (this.parmValue.start !== "" && this.parmValue.end === "") ||
+        (this.parmValue.start == "" && this.parmValue.end != "")
+      ) {
+        this.$message.warning("开始时间和结束时间不能为空");
+        return;
+      }
+      this.loading = true;
+      const { code, data, message } = await asyncRequest.list(this.parmValue);
+      let scode = parseInt(code + "");
+      if (scode === 0) {
+        const { list, count } = data;
+        this.tableData = list;
+        this.pageInfo.total = Number(count + "");
+      } else if (scode >= 100 && scode <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+@import "~@/styles/mixin.scss";
+.supplierAccount {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+
+  .supplierAccount_show_box {
+    // position: relative;
+    // height: calc(100% - 50px);
+    // min-height: calc(100% - 50px);
+
+    display: relative;
+    width: 100%;
+    height: calc(100vh - 50px);
+    overflow: hidden;
+    text-align: left;
+    //左侧
+    .role-list {
+      height: 100%;
+      overflow-y: auto;
+      width: 320px;
+      // padding: 8px 16px;
+      min-height: 100%;
+      flex-shrink: 0;
+      border-right: 2px solid #dfe6ec;
+      @include scrollBar();
+      &::after {
+        content: "";
+        position: absolute;
+        top: 0;
+        right: 0;
+        height: 100%;
+        width: 2px;
+        background-color: #e4e7ed;
+        z-index: 1;
+      }
+      .role-list__title {
+        color: #b4b6c0;
+        line-height: 32px;
+      }
+      .role-list__item {
+        position: relative;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        overflow: hidden;
+        height: 32px;
+        line-height: 32px;
+        padding-left: 8px;
+        color: rgb(48, 49, 51);
+        cursor: pointer;
+        i {
+          position: absolute;
+          right: 0;
+          line-height: 32px;
+        }
+      }
+      .role-list__item.active {
+        color: #63cbe7;
+        background: #f7f7f7;
+      }
+    }
+    //右侧
+    .rule-view {
+      height: calc(100% - 50px);
+      width: calc(100% - 320px);
+      overflow-y: auto;
+      padding: 10px 16px;
+      @include scrollBar();
+      .rule-list {
+        border-right: 1px solid #dfe6ec;
+        .title {
+          padding: 18px 18px 12px 18px;
+          border-bottom: 1px dashed #dfe6ec;
+          font-size: 15px;
+          color: #000;
+        }
+        .main {
+          padding: 18px 18px 12px 18px;
+          border-bottom: 1px solid #dfe6ec;
+        }
+        .main-title {
+          width: 80px;
+        }
+        .main-item {
+          width: calc(100% - 80px);
+        }
+      }
+    }
+    .rule-bottom {
+      padding: 10px 18px 8px 0;
+      background: #fff;
+      width: calc(100% - 200px);
+      position: absolute;
+      text-align: right;
+      bottom: 0;
+      right: 0;
+      &::before {
+        content: "";
+        position: absolute;
+        top: 0;
+        right: 0;
+        height: 2px;
+        width: 100%;
+        background-color: #e4e7ed;
+        z-index: 1;
+      }
+    }
+  }
+}
+</style>

+ 191 - 0
src/views/serviceParam/supplierAccount/resetPassword.vue

@@ -0,0 +1,191 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="5vh"
+    width="600px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card>
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :rules="rulesThis"
+            label-width="110px"
+            class="demo-ruleForm"
+          >
+            <el-form-item prop="password" label="新密码:">
+              <el-input
+                ref="password"
+                v-model="ruleForm.password"
+                placeholder="新密码"
+                name="password"
+                type="password"
+                tabindex="1"
+                maxlength="50"
+                autocomplete="on"
+              />
+            </el-form-item>
+            <el-form-item prop="confirmPassword" label="确认密码:">
+              <el-input
+                ref="confirmPassword"
+                v-model="ruleForm.confirmPassword"
+                placeholder="确认密码"
+                name="confirmPassword"
+                type="password"
+                tabindex="1"
+                maxlength="50"
+                autocomplete="on"
+              />
+            </el-form-item>
+          </el-form>
+        </el-col>
+        <el-col :span="24" style="text-align: right">
+          <el-button type="primary" @click="submitForm">保 存 </el-button>
+          <el-button @click="showModelThis = false">{{
+            isDetail ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/serviceParam/supplierAccount";
+import { isnumber, isAlphanumeric, validAlphabets } from "@/utils/validate";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "Account",
+  props: ["showModel", "id", "isDetail"],
+  mixins: [resToken],
+  data() {
+    const validateNewPassword = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("新密码不能为空!"));
+      } else {
+        if (!isAlphanumeric(value)) {
+          callback(new Error("新密码为6-16位数字字母组合!"));
+        } else if (value.length < 6 || value.length > 16) {
+          callback(new Error("新密码为6-16位数字字母组合!"));
+        } else if (isnumber(value)) {
+          callback(new Error("新密码不能为纯数字!"));
+        } else if (validAlphabets(value)) {
+          callback(new Error("新密码不能为纯字母!"));
+        } else {
+          callback();
+        }
+      }
+    };
+    const validateConfirmPassword = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("确认密码不能为空!"));
+      } else {
+        if (this.ruleForm.password !== value) {
+          callback(new Error("确认密码与新密码不一致!"));
+        } else {
+          callback();
+        }
+      }
+    };
+    return {
+      roleList: [],
+      loading: false,
+      title: "重置密码",
+      showModelThis: this.showModel,
+      ruleForm: {
+        id: this.id,
+        password: "",
+        confirmPassword: "",
+      },
+      rulesThis: this.rules,
+      rules: {
+        password: [{ required: true, trigger: "blur", validator: validateNewPassword }],
+        confirmPassword: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validateConfirmPassword,
+          },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    async initForm() {
+      this.rulesThis = this.rules;
+      await this.resetForm();
+    },
+
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.ruleForm = {
+            id: this.id,
+            password: "",
+            confirmPassword: "",
+          };
+        }
+      });
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          if (!this.loading) {
+            this.loading = true;
+            const obj = JSON.parse(JSON.stringify(this.ruleForm));
+            const res = await asyncRequest.setpwd(obj);
+            this.loading = false;
+            if (res && res.code === 0) {
+              this.$notify.success({
+                title: "密码修改成功!",
+                message: "",
+              });
+              this.showModelThis = false;
+              // 刷新
+              this.$emit("refresh");
+            } else if (res && res.code >= 100 && res.code <= 104) {
+              await this.logout();
+            } else {
+              this.$message.warning(res.message);
+            }
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.account {
+}
+</style>

+ 227 - 0
src/views/serviceParam/supplierAccount/supplierlist.vue

@@ -0,0 +1,227 @@
+<template>
+  <div class="supplier-list" v-loading="loading">
+    <div class="role-list__title">
+      <p class="title">
+        <span class="font">供应商列表</span>
+
+        <el-button type="warning" class="fr" size="mini" @click="restSearch"
+          >重置</el-button
+        >
+      </p>
+      <p class="search">
+        <el-input
+          placeholder="供应商名称"
+          v-model="parmValue.name"
+          class="input-with-select"
+          size="small"
+          @blur="
+            parmValue.page = 1;
+            pageInfo.curr = 1;
+            searchList();
+          "
+        >
+          <el-button
+            slot="append"
+            icon="el-icon-search"
+            @click="
+              parmValue.page = 1;
+              pageInfo.curr = 1;
+              searchList();
+            "
+          ></el-button>
+        </el-input>
+      </p>
+    </div>
+    <div class="data-show">
+      <p
+        v-if="tableData.length == 0"
+        style="line-height: 60px; text-align: center; color: #909399"
+      >
+        暂无数据
+      </p>
+      <ul v-else class="main">
+        <li
+          v-for="(item, index) in tableData"
+          :key="'supplier' + index"
+          class="role-list__item"
+          :class="{ active: item.code == activeCode }"
+          @click="switchRoleHandle(item.code)"
+        >
+          {{ item.name }}
+        </li>
+      </ul>
+    </div>
+
+    <div class="Pagination tc">
+      <el-pagination
+        :current-page="pageInfo.curr"
+        :size="'small'"
+        layout="total,  jumper"
+        :total="pageInfo.total"
+        @current-change="currentChange"
+      />
+    </div>
+  </div>
+</template>
+<script>
+import asyncRequest from "@/apis/service/serviceParam/supplierAccount";
+import mixinPage from "@/mixins/elPaginationHandle";
+import { mapGetters } from "vuex";
+
+import resToken from "@/mixins/resToken";
+export default {
+  name: "supplierAccount",
+  mixins: [mixinPage, resToken],
+
+  computed: {
+    //组件SIZE设置
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+  },
+  data() {
+    return {
+      loading: false,
+      activeCode: "",
+      parmValue: {
+        page: 1, // 页码
+        size: 20, // 每页显示条数
+        start: "",
+        end: "",
+        status: "",
+        creater: "",
+        company_name: "",
+        name: "",
+        ocr_status: "",
+      },
+
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 20,
+        curr: 1,
+        total: 0,
+      },
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+  methods: {
+    restSearch() {
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 20,
+        curr: 1,
+        total: 0,
+      };
+      this.parmValue = {
+        page: 1, // 页码
+        size: 20, // 每页显示条数
+        start: "",
+        end: "",
+        status: "",
+        company_name: "", //创建人部门
+        creater: "",
+        name: "",
+        person: "",
+        ocr_status: "",
+      };
+      this.searchList();
+    },
+    switchRoleHandle(code) {
+      this.activeCode = code;
+      this.$emit("change", code);
+    },
+    async currentChange(e) {
+      this.parmValue.page = e;
+      this.pageInfo.curr = e;
+      await this.searchList();
+    },
+    // 刷新表格
+    async searchList() {
+      if (this.loading) return;
+      this.activeCode = "";
+      this.loading = true;
+      const { code, data } = await asyncRequest.slist(this.parmValue);
+      const scode = parseInt(code);
+      if (scode === 0) {
+        const { list, count } = data;
+        this.tableData = list;
+        this.pageInfo.total = Number(count + "");
+        if (list.length !== 0) {
+          this.switchRoleHandle(list[0].code);
+        } else {
+          this.switchRoleHandle("");
+        }
+      } else if (scode >= 100 && scode <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.supplier-list {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  .role-list__title {
+    width: 100%;
+    top: 0;
+    left: 0;
+    padding: 12px 16px;
+    background: #f7f7f7;
+    position: absolute;
+    z-index: 2;
+    margin: 0 0 10px 0;
+    p.title {
+      height: 35px;
+      line-height: 29px;
+      padding-left: 5px;
+      span.font {
+        font-size: 16px;
+        font-weight: bolder;
+      }
+    }
+  }
+  .data-show {
+    padding: 100px 16px 70px 16px;
+    .main {
+      li {
+        height: 33px;
+        line-height: 33px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        &:hover {
+          cursor: pointer;
+        }
+        &.active {
+          color: #409eff;
+          // background: #f7f7f7;
+        }
+      }
+    }
+  }
+
+  .Pagination {
+    background: #f7f7f7;
+    position: absolute;
+    z-index: 2;
+    bottom: 0;
+    left: 0;
+    padding: 12px 0 18px 0;
+    width: 100%;
+  }
+}
+</style>

+ 0 - 0
src/views/serviceParam/supplierAccount/供应商账号管理