浏览代码

新增 代理公司审核

王智慧 3 年之前
父节点
当前提交
283634c8f0
共有 4 个文件被更改,包括 418 次插入0 次删除
  1. 10 0
      src/apis/fetch.js
  2. 4 0
      src/components/Aside.vue
  3. 8 0
      src/router/index.js
  4. 396 0
      src/views/agencyManage/agencyExamine.vue

+ 10 - 0
src/apis/fetch.js

@@ -307,6 +307,16 @@ export default {
     return $http("/proxy/list", data);
   },
 
+  // 获取代理公司审核列表
+  getAgencyExamineList(data) {
+    return $http("/proxy/audit/list", data);
+  },
+
+  // 代理公司审核
+  examineAgency(data) {
+    return $http("/proxy/audit", data);
+  },
+
   // 获取代理公司详情
   getAgencyCompanyDetail(data) {
     return $http("/proxy/detail", data);

+ 4 - 0
src/components/Aside.vue

@@ -62,6 +62,10 @@ export default {
             path: "/agencyManage/agencyCompanyList",
             name: "代理公司列表",
           },
+          {
+            path: "/agencyManage/agencyExamine",
+            name: "代理公司审核",
+          },
         ],
       },
       {

+ 8 - 0
src/router/index.js

@@ -124,6 +124,14 @@ const router = createRouter({
       },
       component: () => import("../views/agencyManage/agencyCompanyList.vue"),
     },
+    {
+      path: "/agencyManage/agencyExamine",
+      name: "agencyExamine",
+      meta: {
+        title: "代理公司审核",
+      },
+      component: () => import("../views/agencyManage/agencyExamine.vue"),
+    },
     {
       path: "/agencyManage/agencyCompanyDetail",
       name: "agencyCompanyDetail",

+ 396 - 0
src/views/agencyManage/agencyExamine.vue

@@ -0,0 +1,396 @@
+<template>
+  <div class="full-container-p24">
+    <div style="display: flex; justify-content: space-between">
+      <div style="display: flex">
+        <div class="df aic">
+          <div
+            @click="changeListType(1)"
+            :class="
+              type == 1
+                ? 'currentbtn radio-btns left-radius'
+                : 'radio-btns left-radius'
+            "
+          >
+            待审核
+          </div>
+          <div
+            @click="changeListType(2)"
+            :class="
+              type == 2
+                ? 'currentbtn radio-btns right-radius'
+                : 'radio-btns right-radius '
+            "
+            style="margin-right: 40px; border-left: none"
+          >
+            已审核
+          </div>
+        </div>
+        <el-input
+          placeholder="请输入代理名称/联系人/联系人手机号"
+          prefix-icon="el-icon-search"
+          v-model="term"
+          clearable
+          style="width: 330px"
+        ></el-input>
+        <div class="seach-btn" @click="getAgencyExamineList(1)">查询</div>
+      </div>
+      <!-- <div class="cargo-owner-add" @click="dialogFormVisible = true">
+        添加代理公司
+      </div> -->
+      <el-dialog title="添加代理公司" v-model="dialogFormVisible">
+        <template v-slot:default>
+          <el-form
+            :model="ruleForm"
+            :rules="rules"
+            ref="form"
+            label-width="110px"
+            label-position="left"
+          >
+            <el-form-item prop="companyName" label="代理公司名称">
+              <el-input
+                style="width: 280px"
+                v-model="ruleForm.companyName"
+              ></el-input>
+            </el-form-item>
+            <el-form-item prop="contactName" label="联系人">
+              <el-input
+                style="width: 280px"
+                v-model="ruleForm.contactName"
+              ></el-input>
+            </el-form-item>
+            <el-form-item prop="contactPhone" label="联系人手机号">
+              <el-input
+                style="width: 280px"
+                v-model="ruleForm.contactPhone"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </template>
+        <template v-slot:footer>
+          <div class="dialog-footer">
+            <el-button @click="resetForm">取 消</el-button>
+            <el-button type="primary" @click="addAgencyCompany(ruleForm)">
+              确 定
+            </el-button>
+          </div>
+        </template>
+      </el-dialog>
+    </div>
+    <div style="margin-top: 24px">
+      <el-table :data="tableData" stripe style="width: 100%">
+        <el-table-column
+          type="index"
+          label="序号"
+          min-width="80"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="companyName"
+          label="代理公司名称"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="contactName"
+          label="联系人"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="contactPhone"
+          label="联系人手机号"
+          min-width="160"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="createTime"
+          label="入驻时间"
+          min-width="200"
+          align="center"
+        >
+          <template v-slot="scope">
+            {{ subTimeStr(scope.row.createTime) }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          v-if="type == 1"
+          label="操作"
+          min-width="180"
+          align="center"
+        >
+          <template v-slot="scope">
+            <el-button
+              @click="pass(scope.row.id, scope.row.companyName)"
+              type="primary"
+              size="small"
+            >
+              通过
+            </el-button>
+            <el-button
+              @click="reject(scope.row.id, scope.row.companyName)"
+              type="danger"
+              size="small"
+            >
+              驳回
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+          v-if="type == 2"
+          label="审核结果"
+          min-width="80"
+          align="center"
+        >
+          <template v-slot="scope">
+            <el-button
+              @click="agencyCompanyDetail(scope.row.id, tableData)"
+              type="text"
+              size="small"
+              :disabled="scope.row.auditStatus == 2"
+            >
+              {{ scope.row.auditStatus == 2 ? "已驳回" : "已通过" }}
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div style="width: 100%; text-align: right; margin-top: 43px">
+        <el-pagination
+          background
+          layout="prev, pager, next"
+          :current-page="currentPage"
+          :total="total"
+          @current-change="pageChange"
+        ></el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+<script setup>
+import { ref, h, reactive, toRefs, onMounted } from "vue";
+import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
+import store from "../../store";
+import router from "../../router";
+import md5 from "md5";
+import api from "../../apis/fetch";
+import { subTimeStr } from "../../utils/utils";
+
+let currentPage = ref(1);
+let term = ref("");
+let tableData = ref([]);
+let total = ref(0);
+let dialogFormVisible = ref(false);
+let form = ref(null);
+const ruleForm = ref({
+  companyName: "",
+  contactName: "",
+  contactPhone: "",
+});
+const rules = ref({
+  companyName: [
+    { required: true, message: "请填写代理公司名称", trigger: "blur" },
+  ],
+  contactName: [{ required: true, message: "请填写联系人", trigger: "blur" }],
+  contactPhone: [
+    { required: true, message: "请填写手机号", trigger: "blur" },
+    { min: 11, max: 11, message: "请正确填写手机号", trigger: "blur" },
+  ],
+});
+async function getAgencyExamineList(page) {
+  currentPage.value = page || currentPage.value;
+
+  let res = await api.getAgencyExamineList({
+    currentPage: currentPage.value,
+    size: 10,
+    term: term.value,
+    type: type.value,
+  });
+  if (res.data.status == 0) {
+    tableData.value = res.data.result;
+    total.value = res.data.total;
+  } else {
+    tableData.value = [];
+    total.value = 0;
+  }
+}
+function resetForm() {
+  dialogFormVisible.value = false;
+
+  form.value.resetFields();
+}
+async function addAgencyCompany() {
+  form.value.validate(async (valid) => {
+    if (valid) {
+      let { companyName, contactName, contactPhone } = ruleForm.value;
+      let res = await api.addAgencyCompany({
+        companyName,
+        contactName,
+        contactPhone,
+      });
+      console.log(res);
+      if (res.data.status == 0) {
+        ElNotification.success({
+          title: "添加成功",
+          duration: 0,
+          message: `${companyName}:${res.data.msg}`,
+          type: "success",
+        });
+        resetForm();
+        getAgencyExamineList();
+      } else {
+        // ElNotification.error({
+        //   title: "失败",
+        //   duration: 3000,
+        //   message: res.data.msg,
+        // });
+      }
+    } else {
+      return false;
+    }
+  });
+}
+
+async function agencyCompanyDetail(id) {
+  router.push({
+    path: "/agencyManage/agencyCompanyDetail",
+    query: {
+      id,
+    },
+  });
+}
+function pageChange(e) {
+  currentPage.value = e;
+  getAgencyExamineList();
+}
+
+let type = ref(1);
+function changeListType(t) {
+  type.value = t;
+  getAgencyExamineList();
+}
+
+async function pass(proxyAuditId, comp) {
+  ElMessageBox.confirm(`是否确认通过: ${comp}?`, "确认", {
+    confirmButtonText: "确认",
+    cancelButtonText: "取消",
+    type: "warning",
+  })
+    .then(async () => {
+      let res = await api.examineAgency({
+        proxyAuditId,
+        auditStatus: 1,
+      });
+      console.log(res);
+      ElNotification.success({
+        title: "审核成功",
+        duration: 0,
+        message: res.data.msg,
+        type: "success",
+      });
+      getAgencyExamineList();
+    })
+    .catch((e) => {
+      console.log(e);
+    });
+}
+async function reject(proxyAuditId, comp) {
+  ElMessageBox.prompt(`请输入驳回 ${comp} 原因`, "驳回", {
+    confirmButtonText: "提交",
+    cancelButtonText: "取消",
+    inputPattern: /\S/,
+    inputErrorMessage: "请填写驳回原因",
+  })
+    .then(async ({ value: auditResaon }) => {
+      let res = await api.examineAgency({
+        proxyAuditId,
+        auditStatus: 2,
+        auditResaon,
+      });
+      ElNotification.success({
+        title: "已驳回",
+        duration: 3000,
+        type: "success",
+      });
+      getAgencyExamineList();
+    })
+    .catch(() => {});
+}
+
+onMounted(() => {
+  getAgencyExamineList();
+});
+</script>
+<style scoped>
+.seach-btn {
+  display: inline-block;
+  width: 60px;
+  height: 38px;
+  background: #0094fe;
+  border-radius: 2px;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #ffffff;
+  text-align: center;
+  line-height: 38px;
+  margin-left: 15px;
+  cursor: pointer;
+  box-sizing: border-box;
+}
+
+.cargo-owner-add {
+  width: 120px;
+  height: 36px;
+  border-radius: 2px;
+  border: 1px solid #0094fe;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #0094fe;
+  line-height: 36px;
+  text-align: center;
+  cursor: pointer;
+  margin-right: 20px;
+}
+
+:deep().el-dialog {
+  width: 560px;
+  padding: 20px 50px;
+  border-radius: 6px;
+}
+
+:deep() .el-dialog__title {
+  font-size: 18px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #0094fe;
+}
+
+.radio-btns {
+  height: 38px;
+  width: 70px;
+  border: 1px solid #1486f9;
+  line-height: 38px;
+  text-align: center;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #0094fe;
+  cursor: pointer;
+}
+
+.left-radius {
+  border-top-left-radius: 19px;
+  border-bottom-left-radius: 19px;
+  width: 80px;
+}
+
+.right-radius {
+  border-top-right-radius: 19px;
+  border-bottom-right-radius: 19px;
+  width: 80px;
+}
+.currentbtn {
+  background: #1486f9;
+  color: #fff;
+}
+</style>