cz 2 лет назад
Родитель
Сommit
d2a847b53c

+ 233 - 0
src/components/process/SendPurchase.vue

@@ -0,0 +1,233 @@
+<template>
+  <div>
+    <el-form
+      :model="formData.data"
+      :rules="rules"
+      ref="formDom"
+      label-position="top"
+    >
+      <div class="_t">基础信息</div>
+      <el-row>
+        <el-col :span="6">
+          <el-form-item label="采购部门" prop="deptName">
+            <el-input v-model="formData.data.deptName" placeholder="请输入">
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="采购人" prop="purchaseName">
+            <el-input v-model="formData.data.purchaseName" placeholder="请输入">
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="采购时间" prop="purchaseTime">
+            <el-date-picker
+              v-model="formData.data.purchaseTime"
+              type="datetime"
+              placeholder="请选择"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="供应商" prop="supplyId">
+            <el-select
+              v-model="formData.data.supplyId"
+              placeholder="请选择"
+              @change="handleChangeSupplier"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in supplierData"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label="采购说明" prop="purchaseContent">
+        <el-input
+          v-model="formData.data.purchaseContent"
+          placeholder="请输入"
+          type="textarea"
+        >
+        </el-input>
+      </el-form-item>
+      <div class="_t">采购明细</div>
+      <el-form-item>
+        <el-button
+          type="primary"
+          @click="openProduct = true"
+          style="margin: 10px 0"
+        >
+          添加货品
+        </el-button>
+        <el-table :data="formData.data.purchaseDetailList">
+          <el-table-column
+            prop="goodType"
+            label="货品类型"
+            :formatter="(row) => (row.goodType == 1 ? '产品' : '物料')"
+          />
+          <el-table-column prop="code" label="货品编码" />
+          <el-table-column prop="name" label="货品名称" min-width="150" />
+          <el-table-column prop="spec" label="规格型号" />
+          <el-table-column prop="unit" label="单位" />
+          <el-table-column prop="count" label="申购数量" />
+          <el-table-column prop="count" label="本次采购" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="'purchaseDetailList.' + $index + '.count'"
+                :rules="rules.count"
+                :inline-message="true"
+              >
+                <el-input-number
+                  v-model="row.count"
+                  :precision="4"
+                  :controls="false"
+                  :min="1"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="count" label="单价" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="'purchaseDetailList.' + $index + '.count'"
+                :rules="rules.count"
+                :inline-message="true"
+              >
+                <el-input-number
+                  v-model="row.count"
+                  :precision="4"
+                  :controls="false"
+                  :min="0"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="count" label="金额" />
+          <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-item>
+    </el-form>
+  </div>
+  <el-dialog v-model="openProduct" title="选择货品" width="70%" append-to-body>
+    <SelectGoods
+      @cancel="openProduct = false"
+      @pushGoods="pushGoods"
+    ></SelectGoods>
+  </el-dialog>
+</template>
+
+<script setup>
+import SelectGoods from "@/components/product/SelectGoods";
+import { ElMessage, ElMessageBox } from "element-plus";
+import useUserStore from "@/store/modules/user";
+
+const { proxy } = getCurrentInstance();
+
+let formData = reactive({
+  data: {
+    purchaseTime: "",
+    purchaseDetailList: [],
+  },
+});
+let rules = ref({
+  deptName: [{ required: true, message: "请输入采购部门", trigger: "blur" }],
+  purchaseName: [
+    { required: true, message: "请输入采购人名称", trigger: "blur" },
+  ],
+  purchaseTime: [
+    { required: true, message: "请选择采购时间", trigger: "change" },
+  ],
+  supplyId: [{ required: true, message: "请选择供应商", trigger: "change" }],
+  count: [{ required: true, message: "请输入本次采购数量", trigger: "blur" }],
+  remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
+});
+
+let openProduct = ref(false);
+// 物品相应逻辑
+const handleRemove = (index) => {
+  formData.data.purchaseDetailList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功!",
+    type: "success",
+  });
+};
+
+const pushGoods = (goods) => {
+  const arr = goods.map((x) => ({
+    ...x,
+    bussinessId: x.id,
+    count: "",
+    remark: "",
+  }));
+  formData.data.purchaseDetailList =
+    formData.data.purchaseDetailList.concat(arr);
+  return ElMessage({
+    message: "添加成功!",
+    type: "success",
+  });
+};
+// 提交方法
+const formDom = ref(null);
+const handleSubmit = async () => {
+  const vaild = await formDom.value.validate();
+  if (vaild) {
+    if (formData.data.purchaseDetailList.length > 0) {
+      return true;
+    }
+    ElMessage({
+      message: "请添加采购明细!",
+      type: "info",
+    });
+    return false;
+  }
+
+  return false;
+};
+// 获取用户信息并赋默认值
+const userInfo = useUserStore().user;
+onMounted(() => {
+  formData.data.purchaseTime = proxy.parseTime(new Date());
+  formData.data.deptName = userInfo.dept.deptName;
+  formData.data.purchaseName = userInfo.nickName;
+  getSupplierList();
+});
+// 获取供应商数据
+const supplierData = ref([]);
+const getSupplierList = async (req) => {
+  proxy
+    .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      supplierData.value = res.rows;
+    });
+};
+// 供应商改变逻辑
+const handleChangeSupplier = (val) => {
+  console.log(val, "as");
+};
+// 向父组件暴露
+defineExpose({
+  submitData: formData.data,
+  handleSubmit,
+});
+</script>
+
+
+<style lang="scss" scoped>
+._t {
+  margin-bottom: 5px;
+  font-size: 14px;
+}
+</style>

+ 63 - 32
src/views/connect/E-mail/businessConfig/index.vue

@@ -25,8 +25,8 @@
         ]"
         @get-list="getList"
       >
-        <template #slotName="{ item }">
-          {{ item.createTime }}
+        <template #mialAddress="{ item }">
+          {{ item.mailUserPrefix }}@{{ item.domainName }}
         </template>
       </byTable>
     </div>
@@ -47,18 +47,25 @@
           <el-row style="width: 100%">
             <el-col :span="11">
               <el-input
-                v-model="formData.data.contactPerson"
+                v-model="formData.data.mailUserPrefix"
                 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-select
+                v-model="formData.data.domainId"
+                placeholder="请选择"
+                style="width: 100%"
               >
-              </el-input>
+                <el-option
+                  v-for="item in sourceListOne.data"
+                  :label="item.domainName"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
             </el-col>
           </el-row>
         </template>
@@ -155,6 +162,8 @@ 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({
@@ -174,19 +183,24 @@ 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" },
+  mailUserPrefix: [{ required: true, message: "请输入地址", trigger: "blur" }],
+  domainName: [{ required: true, message: "请输入邮箱域名", trigger: "blur" }],
+  type: [{ required: true, message: "请选择邮箱类型", trigger: "change" }],
+  mailPassword: [{ required: true, message: "请输入授权码", trigger: "blur" }],
+  receiveHost: [
+    { required: true, message: "请输入收件服务器地址", trigger: "blur" },
   ],
-  accessKeyId: [
-    { required: true, message: "请输入Access Key Id", trigger: "blur" },
+  receivePort: [{ required: true, message: "请输入收件端口", trigger: "blur" }],
+  receiveProtocol: [
+    { required: true, message: "请输入收件协议", trigger: "blur" },
   ],
-  secretAccessKey: [
-    { required: true, message: "请输入Secret Access Key", trigger: "blur" },
+  sendHost: [
+    { required: true, message: "请输入发件服务器地址", trigger: "blur" },
+  ],
+  sendPort: [{ required: true, message: "请输入发件端口", trigger: "blur" }],
+  sendProtocol: [
+    { required: true, message: "请输入发件协议", trigger: "blur" },
   ],
-  productId: [{ required: true, message: "请输入项目 ID", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = [];
@@ -194,8 +208,9 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        type: "slot",
+        slot: "mialAddress",
         label: "邮箱地址",
-        prop: "domainName",
       },
     },
     {
@@ -207,7 +222,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "绑定用户",
-        prop: "userId",
+        prop: "userName",
       },
     },
     {
@@ -238,7 +253,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "200",
+        width: "130",
         align: "right",
       },
       // 渲染 el-button,一般用在最后一列。
@@ -297,8 +312,8 @@ const configOne = computed(() => {
   return [
     {
       attrs: {
-        label: "邮箱地址",
-        prop: "mailUser",
+        label: "邮箱域名",
+        prop: "domainName",
       },
     },
     {
@@ -338,7 +353,7 @@ const configOne = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "200",
+        width: "130",
         align: "right",
       },
       // 渲染 el-button,一般用在最后一列。
@@ -383,7 +398,7 @@ const configOne = computed(() => {
                       message: "删除成功",
                       type: "success",
                     });
-                    getList();
+                    getListOne();
                   });
               });
             },
@@ -409,25 +424,35 @@ const configData = [
     {
       type: "slot",
       slotName: "mailAddress",
+      prop: "mailUserPrefix",
       label: "邮箱地址",
       required: true,
     },
     {
       type: "input",
-      prop: "type",
+      prop: "mailPassword",
       label: "授权码",
       required: true,
     },
     {
       type: "select",
-      prop: "name",
+      prop: "userId",
       label: "绑定用户",
+      isLoad: {
+        url: `/tenantUser/list?pageNum=1&pageSize=9999&tenantId=${
+          useUserStore().user.tenantId
+        }`,
+        labelKey: "nickName",
+        labelVal: "userId",
+        method: "get",
+        resUrl: "rows",
+      },
     },
   ],
   [
     {
       type: "input",
-      prop: "mailUser",
+      prop: "domainName",
       label: "邮箱域名",
       required: true,
     },
@@ -490,7 +515,7 @@ const getList = async (req) => {
 const getListOne = async () => {
   loading.value = true;
   proxy
-    .post("/enterpriseDomain/page", sourceList.value.pagination)
+    .post("/enterpriseDomain/page", { pageNum: 1, pageSize: 9999 })
     .then((message) => {
       sourceListOne.value.data = message.rows;
       setTimeout(() => {
@@ -510,17 +535,20 @@ const openModal = (type) => {
   } else if (type === "20") {
     titleText.value = "添加域名";
     formConfig.value = configData[1];
+    formData.data = {
+      type: "1",
+      receiveProtocol: "IMAP",
+      sendProtocol: "SMTP",
+    };
   }
 };
 
 const openModalOne = () => {
   dialogVisibleOne.value = true;
   modalType.value = "add";
-  formData.data = {};
 };
 
 const submitForm = () => {
-  console.log(byform.value);
   byform.value.handleSubmit((valid) => {
     submitLoading.value = true;
     if (submitType.value === "10") {
@@ -543,6 +571,7 @@ const submitForm = () => {
             message: modalType.value == "add" ? "添加成功" : "编辑成功",
             type: "success",
           });
+          dialogVisible.value = false;
           submitLoading.value = false;
           getListOne();
         },
@@ -554,15 +583,17 @@ const submitForm = () => {
 
 const getDtl = (row, type) => {
   modalType.value = "edit";
+  submitType.value = type;
   if (type === "10") {
     proxy.post("/enterpriseMailbox/detail", { id: row.id }).then((res) => {
+      formConfig.value = configData[0];
       formData.data = res;
-      console.log(res);
     });
   } else if (type === "20") {
     proxy.post("/enterpriseDomain/detail", { id: row.id }).then((res) => {
+      formConfig.value = configData[1];
+      res.type = res.type + "";
       formData.data = res;
-      console.log(res);
     });
   }
   dialogVisible.value = true;

+ 1 - 1
src/views/oa/mailList/interior/index.vue

@@ -336,7 +336,7 @@ const getDict = () => {
     .post("/dictTenantData/page", {
       pageNum: 1,
       pageSize: 999,
-      tenantId: "@福建宏星!#¥%……&*()",
+      tenantId: tenantId,
       dictCode: "contact_information",
     })
     .then((res) => {

+ 35 - 9
src/views/oa/mailList/outside/index.vue

@@ -21,6 +21,22 @@
         ]"
         @get-list="getList"
       >
+        <template #phoneNumber="{ item }">
+          <div>
+            <span v-for="(x, index) in getTypeData(item, 0)">
+              {{ x.contactNumber }}
+              <span v-if="index < getTypeData(item, 0).length - 1">,</span>
+            </span>
+          </div>
+        </template>
+        <template #email="{ item }">
+          <div>
+            <span v-for="(x, index) in getTypeData(item, 1)">
+              {{ x.contactNumber }}
+              <span v-if="index < getTypeData(item, 1).length - 1">,</span>
+            </span>
+          </div>
+        </template>
       </byTable>
     </div>
     <el-dialog
@@ -273,14 +289,16 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "手机号",
-        prop: "phoneNumber",
+        type: "slot",
+        slot: "phoneNumber",
+        label: "联系号码",
       },
     },
     {
       attrs: {
+        type: "slot",
+        slot: "email",
         label: "电子邮箱",
-        prop: "createTime",
       },
     },
     {
@@ -431,21 +449,20 @@ const submitForm = () => {
       }
     } else {
       if (formData.data.externalAddressBookList.length > 0) {
-        console.log(formData.data, "aww");
         proxy.$refs.tableForm.validate((vaild) => {
           if (vaild) {
             submitLoading.value = true;
             proxy.post("/contacts/" + modalType.value, formData.data).then(
               (res) => {
                 const submitData = {
+                  contactsId: formData.data.id,
                   externalAddressBookList:
                     formData.data.externalAddressBookList.map((x) => ({
                       ...x,
-                      id: formData.data.id,
                     })),
                 };
                 proxy
-                  .post("/contacts/" + modalType.value, submitData)
+                  .post("/externalAddressBook/" + modalType.value, submitData)
                   .then((res) => {
                     ElMessage({
                       message: "编辑成功",
@@ -515,7 +532,7 @@ const getDict = () => {
     .post("/dictTenantData/page", {
       pageNum: 1,
       pageSize: 999,
-      tenantId: "@福建宏星!#¥%……&*()",
+      tenantId: tenantId,
       dictCode: "contact_information",
     })
     .then((res) => {
@@ -532,10 +549,14 @@ const getDtl = (row) => {
   formConfig.value = configData[1];
   dialogVisible.value = true;
   proxy.post("/contacts/detail", { id: row.id }).then((res) => {
-    res.externalAddressBookList = [];
     formData.data = res;
     proxy.post("/externalAddressBook/detail", { id: row.id }).then((res) => {
-      console.log(res, "ass");
+      formData.data.externalAddressBookList =
+        res.map((x) => ({
+          id: x.id,
+          type: x.type + "",
+          contactNumber: x.contactNumber,
+        })) || [];
     });
   });
 };
@@ -565,6 +586,11 @@ const addRow = () => {
     });
   }
 };
+
+const getTypeData = (item, type) => {
+  // return item.internalAddressBookList.filter((x) => x.type === type) || [];
+  return [];
+};
 </script>
   
 <style lang="scss" scoped>

+ 5 - 1
src/views/process/processApproval/index.vue

@@ -3,7 +3,8 @@
     <div class="left-card">
       <div class="top">
         <div class="commons-title title">流程标题</div>
-        <SendSubscribe ref="makeDom"></SendSubscribe>
+        <!-- <SendSubscribe ref="makeDom"></SendSubscribe> -->
+        <SendPurchase ref="makeDom"></SendPurchase>
       </div>
       <div class="bottom">
         <div class="commons-title title">处理意见</div>
@@ -141,6 +142,9 @@
 <script setup>
 //申购发起
 import SendSubscribe from "@/components/process/SendSubscribe";
+//采购发起
+import SendPurchase from "@/components/process/SendPurchase";
+
 import { ElMessage, ElMessageBox } from "element-plus";
 
 const activeName = ref("first");

+ 1 - 0
src/views/purchaseManage/purchaseManage/subscribe/index.vue

@@ -154,6 +154,7 @@ const sourceList = ref({
     total: 3,
     pageNum: 1,
     pageSize: 10,
+    status: "",
   },
 });
 let dialogVisible = ref(false);