소스 검색

沟通模块文件新增

cz 2 년 전
부모
커밋
1ca1b3ae32

+ 14 - 7
src/store/modules/user.js

@@ -1,10 +1,17 @@
-import { login, logout, getInfo } from '@/api/login'
-import { getToken, setToken, removeToken } from '@/utils/auth'
+import {
+  login,
+  logout,
+  getInfo
+} from '@/api/login'
+import {
+  getToken,
+  setToken,
+  removeToken
+} from '@/utils/auth'
 import defAva from '@/assets/images/profile.jpg'
 
 const useUserStore = defineStore(
-  'user',
-  {
+  'user', {
     state: () => ({
       token: getToken(),
       name: '',
@@ -15,13 +22,13 @@ const useUserStore = defineStore(
     actions: {
       // 登录
       login(userInfo) {
-        
+
         const username = userInfo.username.trim()
         const password = userInfo.password
         const code = userInfo.code
         const uuid = userInfo.uuid
         return new Promise((resolve, reject) => {
-          login(username, password, code, uuid,userInfo.tenantId).then(res => {
+          login(username, password, code, uuid, userInfo.tenantId).then(res => {
             setToken(res.token)
             this.token = res.token
             resolve()
@@ -68,4 +75,4 @@ const useUserStore = defineStore(
     }
   })
 
-export default useUserStore
+export default useUserStore

+ 571 - 0
src/views/connect/E-mail/businessConfig/index.vue

@@ -0,0 +1,571 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[
+          {
+            text: '邮箱域名管理',
+            action: () => openModalOne(),
+          },
+          {
+            text: '添加邮箱',
+            action: () => openModal('10'),
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #slotName="{ item }">
+          {{ item.createTime }}
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="titleText"
+      v-model="dialogVisible"
+      width="400"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #mailAddress>
+          <el-row style="width: 100%">
+            <el-col :span="11">
+              <el-input
+                v-model="formData.data.contactPerson"
+                placeholder="请输入"
+              >
+              </el-input>
+            </el-col>
+            <el-col :span="2" style="text-align: center"> @ </el-col>
+            <el-col :span="11">
+              <el-input
+                v-model="formData.data.contactPerson"
+                placeholder="请输入"
+              >
+              </el-input>
+            </el-col>
+          </el-row>
+        </template>
+
+        <template #rSlot>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-select
+                v-model="formData.data.countryId"
+                placeholder="收件协议"
+                disabled
+              >
+                <el-option
+                  v-for="item in countryData"
+                  :label="item.chineseName"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-col>
+            <el-col :span="8">
+              <el-input
+                v-model="formData.data.contactPerson"
+                placeholder="请输入"
+              >
+              </el-input>
+            </el-col>
+          </el-row>
+        </template>
+        <template #sSlot>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-select
+                v-model="formData.data.countryId"
+                placeholder="发件协议"
+                disabled
+              >
+                <el-option
+                  v-for="item in countryData"
+                  :label="item.chineseName"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-col>
+            <el-col :span="8">
+              <el-input
+                v-model="formData.data.contactPerson"
+                placeholder="请输入"
+              >
+              </el-input>
+            </el-col>
+          </el-row>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      title="邮箱域名管理"
+      v-model="dialogVisibleOne"
+      width="800"
+      v-loading="loading"
+    >
+      <div style="width: 100%">
+        <div style="padding: 0px 20px">
+          <el-button type="primary" @click="openModal('20')">
+            添加域名
+          </el-button>
+        </div>
+        <byTable
+          :source="sourceListOne.data"
+          :config="configOne"
+          :loading="loading"
+          highlight-current-row
+          :hidePagination="true"
+          :hideSearch="true"
+        >
+        </byTable>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, defineComponent, ref } from "vue";
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+const sourceListOne = ref({
+  data: [],
+});
+let dialogVisible = ref(false);
+let dialogVisibleOne = ref(false);
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let submitType = ref("");
+let titleText = ref("");
+let rules = ref({
+  name: [{ required: true, message: "请输入平台名称", trigger: "blur" }],
+  endPoint: [{ required: true, message: "请输入EndPoint", trigger: "blur" }],
+  accessKey: [{ required: true, message: "请输入access_key", trigger: "blur" }],
+  accessCode: [
+    { required: true, message: "请输入access_code", trigger: "blur" },
+  ],
+  accessKeyId: [
+    { required: true, message: "请输入Access Key Id", trigger: "blur" },
+  ],
+  secretAccessKey: [
+    { required: true, message: "请输入Secret Access Key", trigger: "blur" },
+  ],
+  productId: [{ required: true, message: "请输入项目 ID", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = [];
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "邮箱地址",
+        prop: "type",
+      },
+      render(type) {
+        return "华为";
+      },
+    },
+    {
+      attrs: {
+        label: "授权码",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "绑定用户",
+        prop: "endPoint",
+      },
+    },
+    {
+      attrs: {
+        label: "收件协议",
+        prop: "accessKeyId",
+      },
+    },
+    {
+      attrs: {
+        label: "收件端口号",
+        prop: "secretAccessKey",
+      },
+    },
+    {
+      attrs: {
+        label: "发件协议",
+        prop: "productId",
+      },
+    },
+    {
+      attrs: {
+        label: "发件端口号",
+        prop: "fa",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              // 弹窗提示是否删除
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
+                // 删除
+                proxy
+                  .post("/supplierInfo/delete", {
+                    id: row.id,
+                  })
+                  .then((res) => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const configOne = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "邮箱域名",
+        prop: "type",
+      },
+      render(type) {
+        return "华为";
+      },
+    },
+    {
+      attrs: {
+        label: "海外邮箱",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "收件协议",
+        prop: "endPoint",
+      },
+    },
+
+    {
+      attrs: {
+        label: "收件端口号",
+        prop: "secretAccessKey",
+      },
+    },
+    {
+      attrs: {
+        label: "发件协议",
+        prop: "productId",
+      },
+    },
+    {
+      attrs: {
+        label: "发件端口号",
+        prop: "fa",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "150",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              // 弹窗提示是否删除
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
+                // 删除
+                proxy
+                  .post("/supplierInfo/delete", {
+                    id: row.id,
+                  })
+                  .then((res) => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+let formData = reactive({
+  data: {
+    type: "1",
+  },
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = ref({});
+const configData = [
+  [
+    {
+      type: "slot",
+      slotName: "mailAddress",
+      label: "邮箱地址",
+      required: true,
+    },
+    {
+      type: "input",
+      prop: "type",
+      label: "授权码",
+      required: true,
+    },
+    {
+      type: "select",
+      prop: "name",
+      label: "绑定用户",
+    },
+  ],
+  [
+    {
+      type: "input",
+      prop: "type",
+      label: "邮箱域名",
+      required: true,
+    },
+    {
+      type: "radio",
+      prop: "type",
+      label: "是否海外邮箱",
+      required: true,
+      border: true,
+      data: [
+        { label: "是", value: "1" },
+        { label: "否", value: "2" },
+      ],
+    },
+    {
+      type: "input",
+      prop: "type",
+      label: "收件服务器地址",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "rSlot",
+      label: "收件协议",
+    },
+    {
+      type: "input",
+      prop: "type",
+      label: "发件服务器地址",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "sSlot",
+      label: "发件协议",
+    },
+  ],
+];
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/tdaConfig/page", sourceList.value.pagination).then((message) => {
+    console.log(message);
+    sourceList.value.data = message.rows;
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+
+const openModal = (type) => {
+  formData.data = {};
+  dialogVisible.value = true;
+  modalType.value = "add";
+  submitType.value = type;
+  if (type === "10") {
+    titleText.value = "添加邮箱";
+    formConfig.value = configData[0];
+  } else if (type === "20") {
+    titleText.value = "添加域名";
+    formConfig.value = configData[1];
+  }
+};
+
+const openModalOne = () => {
+  dialogVisibleOne.value = true;
+  modalType.value = "add";
+  formData.data = {};
+};
+const selection = ref({
+  data: [],
+});
+const select = (_selection, row) => {
+  selection.value.data = _selection;
+  console.log(_selection.length);
+};
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    if (submitType.value === "10") {
+      submitLoading.value = true;
+      proxy.post("/tdaConfig/" + modalType.value, formData.data).then(
+        (res) => {
+          ElMessage({
+            message: modalType.value == "add" ? "添加成功" : "编辑成功",
+            type: "success",
+          });
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => (submitLoading.value = false)
+      );
+    } else if (submitType.value === "20") {
+    }
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  formData.data = {
+    supplierPriceList: [],
+  };
+  dialogVisible.value = true;
+  // proxy.post("/tdaConfig/detail", { id: row.id }).then((res) => {
+  //   formData.data = res;
+  //   console.log(formData);
+  //   dialogVisible.value = true;
+  // });
+};
+
+const addRow = () => {
+  formData.data.supplierPriceList.push({
+    price: "",
+    pricea: "",
+  });
+};
+
+getList();
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 389 - 0
src/views/connect/E-mail/personalConfig/index.vue

@@ -0,0 +1,389 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[
+          {
+            text: '添加邮箱',
+            action: () => openModal('add'),
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #slotName="{ item }">
+          {{ item.createTime }}
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '添加邮箱' : '编辑邮箱'"
+      v-model="dialogVisible"
+      width="400"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #rSlot>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-select
+                v-model="formData.data.countryId"
+                placeholder="收件协议"
+                disabled
+              >
+                <el-option
+                  v-for="item in countryData"
+                  :label="item.chineseName"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-col>
+            <el-col :span="8">
+              <el-input
+                v-model="formData.data.contactPerson"
+                placeholder="请输入"
+              >
+              </el-input>
+            </el-col>
+          </el-row>
+        </template>
+        <template #sSlot>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-select
+                v-model="formData.data.countryId"
+                placeholder="发件协议"
+                disabled
+              >
+                <el-option
+                  v-for="item in countryData"
+                  :label="item.chineseName"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-col>
+            <el-col :span="8">
+              <el-input
+                v-model="formData.data.contactPerson"
+                placeholder="请输入"
+              >
+              </el-input>
+            </el-col>
+          </el-row>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, defineComponent, ref } from "vue";
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  name: [{ required: true, message: "请输入平台名称", trigger: "blur" }],
+  endPoint: [{ required: true, message: "请输入EndPoint", trigger: "blur" }],
+  accessKey: [{ required: true, message: "请输入access_key", trigger: "blur" }],
+  accessCode: [
+    { required: true, message: "请输入access_code", trigger: "blur" },
+  ],
+
+  accessKeyId: [
+    { required: true, message: "请输入Access Key Id", trigger: "blur" },
+  ],
+  secretAccessKey: [
+    { required: true, message: "请输入Secret Access Key", trigger: "blur" },
+  ],
+  productId: [{ required: true, message: "请输入项目 ID", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = [];
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "邮箱地址",
+        prop: "type",
+        width: 100,
+      },
+      render(type) {
+        return "华为";
+      },
+    },
+    {
+      attrs: {
+        label: "海外邮箱",
+        prop: "name",
+        width: 150,
+      },
+    },
+    {
+      attrs: {
+        label: "授权码",
+        prop: "endPoint",
+      },
+    },
+    {
+      attrs: {
+        label: "收件协议",
+        prop: "accessKeyId",
+      },
+    },
+    {
+      attrs: {
+        label: "收件端口号",
+        prop: "secretAccessKey",
+      },
+    },
+    {
+      attrs: {
+        label: "发件协议",
+        prop: "productId",
+      },
+    },
+    {
+      attrs: {
+        label: "发件端口号",
+        prop: "productId",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              // 弹窗提示是否删除
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
+                // 删除
+                proxy
+                  .post("/supplierInfo/delete", {
+                    id: row.id,
+                  })
+                  .then((res) => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {
+    type: "1",
+  },
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "type",
+      label: "邮箱地址",
+      required: true,
+    },
+    {
+      type: "radio",
+      prop: "type",
+      label: "是否海外邮箱",
+      required: true,
+      border: true,
+      data: [
+        { label: "是", value: "1" },
+        { label: "否", value: "2" },
+      ],
+    },
+    {
+      type: "input",
+      prop: "type",
+      label: "授权码",
+      required: true,
+    },
+    {
+      type: "input",
+      prop: "type",
+      label: "收件服务器地址",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "rSlot",
+      label: "收件协议",
+    },
+    {
+      type: "input",
+      prop: "type",
+      label: "发件服务器地址",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "sSlot",
+      prop: "contactPerson",
+      label: "发件协议",
+      required: true,
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/tdaConfig/page", sourceList.value.pagination).then((message) => {
+    console.log(message);
+    sourceList.value.data = message.rows;
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {};
+};
+const selection = ref({
+  data: [],
+});
+const select = (_selection, row) => {
+  selection.value.data = _selection;
+  console.log(_selection.length);
+};
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/tdaConfig/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  formData.data = {
+    supplierPriceList: [],
+  };
+  dialogVisible.value = true;
+  // proxy.post("/tdaConfig/detail", { id: row.id }).then((res) => {
+  //   formData.data = res;
+  //   console.log(formData);
+  //   dialogVisible.value = true;
+  // });
+};
+
+const addRow = () => {
+  formData.data.supplierPriceList.push({
+    price: "",
+    pricea: "",
+  });
+};
+
+getList();
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 330 - 0
src/views/oa/mailList/interior/index.vue

@@ -0,0 +1,330 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[]"
+        @get-list="getList"
+      >
+        <template #slotName="{ item }">
+          {{ item.createTime }}
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '添加IoT平台' : '编辑'"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #fileSlot>
+          <div style="width: 100%">
+            <el-button type="primary" @click="addRow"> 添加 </el-button>
+            <el-form
+              ref="tableForm"
+              :model="formData.data"
+              :rules="rules"
+              label-width="0px"
+              style="margin-top: 15px"
+            >
+              <el-table :data="formData.data.supplierPriceList">
+                <el-table-column prop="pricea" label="类型" min-width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'supplierPriceList.' + $index + '.pricea'"
+                      :rules="rules.pricea"
+                      :inline-message="true"
+                    >
+                      <el-input v-model="row.pricea" placeholder="请输入" />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="price" label="联系号码" min-width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'supplierPriceList.' + $index + '.price'"
+                      :rules="rules.price"
+                      :inline-message="true"
+                    >
+                      <el-input v-model="row.price" placeholder="请输入" />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+
+                <el-table-column prop="zip" label="操作" width="100">
+                  <template #default="{ $index }">
+                    <el-button type="primary" link @click="handleRemove($index)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-form>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, defineComponent, ref } from "vue";
+import useUserStore from "@/store/modules/user";
+
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  name: [{ required: true, message: "请输入平台名称", trigger: "blur" }],
+  endPoint: [{ required: true, message: "请输入EndPoint", trigger: "blur" }],
+  accessKey: [{ required: true, message: "请输入access_key", trigger: "blur" }],
+  accessCode: [
+    { required: true, message: "请输入access_code", trigger: "blur" },
+  ],
+
+  accessKeyId: [
+    { required: true, message: "请输入Access Key Id", trigger: "blur" },
+  ],
+  secretAccessKey: [
+    { required: true, message: "请输入Secret Access Key", trigger: "blur" },
+  ],
+  productId: [{ required: true, message: "请输入项目 ID", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = [];
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "部门",
+        prop: "type",
+        width: 100,
+      },
+      render(type) {
+        return "华为";
+      },
+    },
+    {
+      attrs: {
+        label: "工号",
+        prop: "name",
+        width: 150,
+      },
+    },
+    {
+      attrs: {
+        label: "姓名",
+        prop: "endPoint",
+      },
+    },
+    {
+      attrs: {
+        label: "手机号",
+        prop: "accessKeyId",
+      },
+    },
+    {
+      attrs: {
+        label: "电子邮箱",
+        prop: "secretAccessKey",
+      },
+    },
+    {
+      attrs: {
+        label: "座机号码",
+        prop: "productId",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {
+    type: "1",
+  },
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "type",
+      label: "所属部门",
+      required: true,
+      disabled: true,
+    },
+    {
+      prop: "name",
+      type: "input",
+      label: "姓名",
+    },
+    {
+      type: "slot",
+      slotName: "fileSlot",
+      label: "联系方式",
+    },
+  ];
+});
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .get("/internalAddressBook/page", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {};
+};
+const selection = ref({
+  data: [],
+});
+const select = (_selection, row) => {
+  selection.value.data = _selection;
+  console.log(_selection.length);
+};
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/tdaConfig/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  formData.data = {
+    supplierPriceList: [],
+  };
+  dialogVisible.value = true;
+  // proxy.post("/tdaConfig/detail", { id: row.id }).then((res) => {
+  //   formData.data = res;
+  //   console.log(formData);
+  //   dialogVisible.value = true;
+  // });
+};
+
+const addRow = () => {
+  formData.data.supplierPriceList.push({
+    price: "",
+    pricea: "",
+  });
+};
+
+const getDict = () => {
+  let tenantId = "";
+  // const tenantId = useUserStore().userInfo.tenantId;
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: tenantId,
+      dictCode: "contact_information",
+    })
+    .then((res) => {
+      console.log(res);
+    });
+};
+
+getList();
+getDict();
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 444 - 0
src/views/oa/mailList/outside/index.vue

@@ -0,0 +1,444 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[
+          {
+            text: '添加联系人',
+            action: () => openModal('add'),
+          },
+        ]"
+        @get-list="getList"
+      >
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '添加联系人' : '编辑联系人'"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #fileSlot>
+          <div style="width: 100%">
+            <el-button type="primary" @click="addRow"> 添加 </el-button>
+
+            <el-form
+              ref="tableForm"
+              :model="formData.data"
+              :rules="rules"
+              label-width="0px"
+              style="margin-top: 15px"
+            >
+              <el-table
+                :data="formData.data.supplierPriceList"
+                v-if="modalType == 'add'"
+              >
+                <el-table-column prop="pricea" label="联系人" min-width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'supplierPriceList.' + $index + '.pricea'"
+                      :rules="rules.pricea"
+                      :inline-message="true"
+                    >
+                      <el-input v-model="row.pricea" placeholder="请输入" />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="price" label="手机号" min-width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'supplierPriceList.' + $index + '.price'"
+                      :rules="rules.price"
+                      :inline-message="true"
+                    >
+                      <el-input v-model="row.price" placeholder="请输入" />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+
+                <el-table-column prop="zip" label="操作" width="100">
+                  <template #default="{ $index }">
+                    <el-button type="primary" link @click="handleRemove($index)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+
+              <el-table
+                :data="formData.data.supplierPriceList"
+                v-if="modalType == 'edit'"
+              >
+                <el-table-column prop="pricea" label="类型" min-width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'supplierPriceList.' + $index + '.pricea'"
+                      :rules="rules.pricea"
+                      :inline-message="true"
+                    >
+                      <el-input v-model="row.pricea" placeholder="请输入" />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="price" label="联系号码" min-width="150">
+                  <template #default="{ row, $index }">
+                    <el-form-item
+                      :prop="'supplierPriceList.' + $index + '.price'"
+                      :rules="rules.price"
+                      :inline-message="true"
+                    >
+                      <el-input v-model="row.price" placeholder="请输入" />
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+
+                <el-table-column prop="zip" label="操作" width="100">
+                  <template #default="{ $index }">
+                    <el-button type="primary" link @click="handleRemove($index)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-form>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import FileUpload from "@/components/FileUpload/index";
+import { computed, defineComponent, ref } from "vue";
+import { getToken } from "@/utils/auth";
+
+const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
+const headers = ref({ Authorization: "Bearer " + getToken() });
+const uploadData = ref({});
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: "",
+    keyword: "",
+  },
+});
+let dialogVisible = ref(false);
+let modalType = ref("add");
+let fileList = ref([]);
+let rules = ref({
+  pricea: [{ required: true, message: "请输入联系人", trigger: "blur" }],
+  price: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "来源",
+    prop: "type",
+    data: [
+      {
+        label: "客户",
+        value: "1",
+      },
+      {
+        label: "供应商",
+        value: "2",
+      },
+      {
+        label: "自定义",
+        value: "3",
+      },
+    ],
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "来源",
+        prop: "type",
+      },
+      render(type) {
+        return type === 1
+          ? "客户"
+          : type === 2
+          ? "供应商"
+          : type === 3
+          ? "自定义"
+          : "";
+      },
+    },
+    {
+      attrs: {
+        label: "关联企业",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "联系人",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "手机号",
+        prop: "remarks",
+      },
+    },
+    {
+      attrs: {
+        label: "电子邮箱",
+        prop: "contactPerson",
+      },
+    },
+    {
+      attrs: {
+        label: "座机",
+        prop: "contactNumber",
+      },
+    },
+    {
+      attrs: {
+        label: "WhatsApp",
+        prop: "remark",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              // 弹窗提示是否删除
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
+                // 删除
+                proxy
+                  .post("/supplierInfo/delete", {
+                    id: row.id,
+                  })
+                  .then((res) => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {
+    type: "1",
+  },
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const formConfig = ref([]);
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/supplierInfo/page", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+const openModal = () => {
+  dialogVisible.value = true;
+  formConfig.value = configData[0];
+  modalType.value = "add";
+  formData.data = {
+    supplierPriceList: [],
+  };
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    // if (fileList.value.length > 0) {
+    //   formData.data.fileList = fileList.value;
+
+    // } else {
+    //   return ElMessage({
+    //     message: "请上传附件!",
+    //     type: "info",
+    //   });
+    // }
+
+    submitLoading.value = true;
+    proxy.post("/supplierInfo/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        fileList.value = [];
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err, "aswwwww");
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+const configData = [
+  [
+    {
+      type: "input",
+      prop: "type",
+      label: "关联企业",
+      required: true,
+    },
+    {
+      type: "slot",
+      slotName: "fileSlot",
+      label: "联系方式",
+    },
+  ],
+  [
+    {
+      type: "input",
+      prop: "type",
+      label: "关联企业",
+      required: true,
+      disabled: true,
+    },
+    {
+      prop: "name",
+      type: "input",
+      label: "联系人",
+    },
+    {
+      type: "slot",
+      slotName: "fileSlot",
+      label: "联系方式",
+    },
+  ],
+];
+const getDtl = (row) => {
+  modalType.value = "edit";
+  formConfig.value = configData[1];
+  dialogVisible.value = true;
+
+  // proxy.post("/supplierInfo/detail", { id: row.id }).then((res) => {
+  //   getCityData(res.countryId, "20");
+  //   getCityData(res.provinceId, "30");
+  //   // fileList.value = [
+  //   //   {
+  //   //     id: "",
+  //   //     fileName: res.fileName,
+  //   //     path: "",
+  //   //   },
+  //   // ];
+  //   res.type = res.type + "";
+  //   formData.data = res;
+  //   dialogVisible.value = true;
+  // });
+};
+
+const handleRemove = (file) => {};
+
+getList();
+
+const addRow = () => {
+  formData.data.supplierPriceList.push({
+    price: "",
+    pricea: "",
+  });
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 6 - 0
src/views/purchaseManage/supplier/supplier/index.vue

@@ -115,6 +115,7 @@
                 <el-input
                   v-model="formData.data.contactNumber"
                   placeholder="联系电话"
+                  @input="(val) => val.replace(/[^\d]/g, '')"
                 >
                 </el-input>
               </el-form-item>
@@ -206,6 +207,7 @@ let rules = ref({
   cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
   areaDetail: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
   contactPerson: [{ required: true, message: "请输入联系人", trigger: "blur" }],
+  // contactNumber: [{ validator: checkContactNumber, trigger: "blur" }],
   contactNumber: [
     { required: true, message: "请输入联系电话", trigger: "blur" },
   ],
@@ -525,6 +527,10 @@ const getCityData = (id, type, isChange) => {
 };
 getCityData("0");
 getList();
+
+// const checkContactNumber = ()=>{
+
+// }
 </script>
   
 <style lang="scss" scoped>