Browse Source

邮箱需求更改

cz 1 year ago
parent
commit
644cd21c2b

+ 1 - 0
src/store/modules/mail.js

@@ -1,6 +1,7 @@
 const useMailStore = defineStore(
   'mail', {
     state: () => ({
+      userMailList: [],
       selectMail: {}, //当前选中的邮箱
       currentMenu: {}, //当前选中的邮箱菜单数据
       currentId: "", //当前选中的邮箱菜单id

+ 3 - 2
src/views/connect/E-mail/mail/com/left.vue

@@ -37,7 +37,7 @@
             </div>
           </template>
         </el-tab-pane>
-        <el-tab-pane label="联系人" name="second">
+        <!-- <el-tab-pane label="联系人" name="second">
           <template #label>
             <div>
               <i
@@ -55,7 +55,7 @@
               <span>客户</span>
             </div>
           </template>
-        </el-tab-pane>
+        </el-tab-pane> -->
       </el-tabs>
       <div>
         <el-button
@@ -598,6 +598,7 @@ const getMialList = () => {
   proxy.get("/mailService/getUserEmailList").then((res) => {
     const arr = handleMapMailListData(res.data);
     mailList.value = arr;
+    mailStore.userMailList = arr;
     if (mailList.value.length) {
       // 默认赋值第一邮箱
       selectMail.value = mailList.value[0];

+ 44 - 11
src/views/connect/E-mail/mail/com/mailWrite.vue

@@ -208,12 +208,28 @@
             />
           </div>
         </el-form-item>
-        <el-form-item label="发件人" prop="replyTo">
+        <!-- <el-form-item label="发件人" prop="replyTo">
           <el-input
             v-model="formData.data.replyTo"
             placeholder="请输入"
             style="width: 50%"
           />
+        </el-form-item> -->
+        <el-form-item label="发件人" prop="replyTo">
+          <el-select
+            v-model="formData.data.replyTo"
+            filterable
+            placeholder="请选择"
+            style="width: 50%"
+            @change="handleChangeReply"
+          >
+            <el-option
+              v-for="item in userMailList"
+              :key="item.mailUser"
+              :label="item.mailUser"
+              :value="item.mailUser"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item>
           <el-button type="primary" @click="handleSend()"> 发 送 </el-button>
@@ -231,9 +247,11 @@ import TinymceEditor from "@/components/Editor/TinymceEditor.vue";
 
 import { validEmail } from "@/utils/validate.js";
 import useMailStore from "@/store/modules/mail";
-import { nextTick } from "vue";
+import { computed, nextTick } from "vue";
 const mailStore = useMailStore();
 const { proxy } = getCurrentInstance();
+const userMailList = computed(() => mailStore.userMailList);
+let currentMail = ref({});
 const loading = ref(false);
 let uploadData = ref({});
 const fileList = ref([]);
@@ -300,7 +318,8 @@ const formConfig = computed(() => {
 });
 const rules = ref({
   subject: [{ required: true, message: "请输入主题", trigger: "blur" }],
-  replyTo: [{ required: true, message: "请输入发件人", trigger: "blur" }],
+  // replyTo: [{ required: true, message: "请输入发件人", trigger: "blur" }],
+  replyTo: [{ required: true, message: "请输入发件人", trigger: "change" }],
 });
 const formData = reactive({
   data: {
@@ -313,6 +332,11 @@ const bcc = ref([]);
 const replyTo = ref([]);
 const submit = ref(null);
 const contentEditor = ref(null);
+
+const handleChangeReply = (val) => {
+  currentMail.value = userMailList.value.find((x) => x.mailUser === val);
+};
+
 const handleReset = () => {
   formData.data = {
     to: "",
@@ -329,6 +353,7 @@ const handleReset = () => {
   fileListCopy.value = [];
   // contentEditor.value.changeHtml("");
 };
+
 const handleSend = () => {
   submit.value.validate((valid) => {
     if (valid) {
@@ -339,12 +364,12 @@ const handleSend = () => {
           type: "info",
         });
       }
-      if (!validEmail(formData.data.replyTo)) {
-        return ElMessage({
-          message: "发件人邮箱格式不正确",
-          type: "info",
-        });
-      }
+      // if (!validEmail(formData.data.replyTo)) {
+      //   return ElMessage({
+      //     message: "发件人邮箱格式不正确",
+      //     type: "info",
+      //   });
+      // }
       if (data.content) {
         loading.value = true;
         let replyTo = [
@@ -354,8 +379,8 @@ const handleSend = () => {
           },
         ];
         const submitData = {
-          type: mailStore.selectMail.type,
-          mailboxId: mailStore.selectMail.id,
+          type: currentMail.value.type,
+          mailboxId: currentMail.value.id,
           subject: data.subject,
           content: data.content,
           to: to.value,
@@ -384,9 +409,11 @@ const handleSend = () => {
     }
   });
 };
+
 const updateContent = (val) => {
   formData.data.content = val;
 };
+
 const handleBeforeUpload = async (file) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
   uploadData.value = res.uploadBody;
@@ -398,6 +425,7 @@ const handleBeforeUpload = async (file) => {
     uid: file.uid,
   });
 };
+
 const handleClose = (index, val) => {
   switch (val) {
     case 10:
@@ -548,12 +576,15 @@ const handleReplyInit = (allData, pageType) => {
     //   contentEditor.value.getFocus();
     // });
     formData.data.replyTo = mailStore.selectMail.mailUser;
+    handleChangeReply(formData.data.replyTo);
   }
 };
 // pageType 10为回复  20为转发 30为全部回复 40为再次编辑  0为写信 50为只回填收件人
 const init = () => {
   if (mailStore.currentMenu.pageType === "0") {
     handleReset();
+    formData.data.replyTo = mailStore.selectMail.mailUser;
+    handleChangeReply(formData.data.replyTo);
   } else if (mailStore.currentMenu.pageType === "10") {
     handleReplyInit(mailStore.currentMenu, "10");
   } else if (mailStore.currentMenu.pageType === "20") {
@@ -572,6 +603,8 @@ watch(
   (val) => {
     if (val === "0") {
       handleReset();
+      formData.data.replyTo = mailStore.selectMail.mailUser;
+      handleChangeReply(formData.data.replyTo);
     } else if (val === "10") {
       handleReplyInit(mailStore.currentMenu, "10");
     } else if (val === "20") {

+ 67 - 43
src/views/purchaseManage/purchaseManage/alreadyPurchase/index.vue

@@ -146,60 +146,71 @@ let rules = ref({
   count: [{ required: true, message: "请输入本次到货", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
+const statusData = ref([
+  {
+    label: "审批中",
+    value: "10",
+  },
+  {
+    label: "驳回",
+    value: "20",
+  },
+  {
+    label: "已采购",
+    value: "30",
+  },
+  {
+    label: "终止",
+    value: "99",
+  },
+  {
+    label: "已作废",
+    value: "88",
+  },
+]);
+const arrivalStatus = ref([
+  {
+    label: "未到货",
+    value: "0",
+  },
+  {
+    label: "部分到货",
+    value: "10",
+  },
+  {
+    label: "已到货",
+    value: "20",
+  },
+]);
+const paymentStatus = ref([
+  {
+    label: "未付款",
+    value: "0",
+  },
+  {
+    label: "部分付款",
+    value: "10",
+  },
+  {
+    label: "已付款",
+    value: "20",
+  },
+]);
 const selectConfig = reactive([
   {
     label: "采购状态",
     prop: "purchaseStatus",
-    data: [
-      {
-        label: "审批中",
-        value: "10",
-      },
-      {
-        label: "已驳回",
-        value: "20",
-      },
-      {
-        label: "已采购",
-        value: "30",
-      },
-    ],
+    data: statusData.value,
   },
   {
     label: "到货状态",
     prop: "arrivalStatus",
-    data: [
-      {
-        label: "未到货",
-        value: "0",
-      },
-      {
-        label: "部分到货",
-        value: "10",
-      },
-      {
-        label: "已到货",
-        value: "20",
-      },
-    ],
+    data: arrivalStatus.value,
   },
   {
     label: "付款状态",
     prop: "payStatus",
-    data: [
-      {
-        label: "未付款",
-        value: "1",
-      },
-      {
-        label: "部分付款",
-        value: "2",
-      },
-      {
-        label: "已付款",
-        value: "3",
-      },
-    ],
+    data: paymentStatus.value,
   },
 ]);
 const config = computed(() => {
@@ -220,7 +231,10 @@ const config = computed(() => {
     {
       attrs: {
         label: "采购金额",
-        prop: "remarks",
+        prop: "amount",
+      },
+      render(amount) {
+        return proxy.moneyFormat(amount, 2);
       },
     },
     {
@@ -240,18 +254,28 @@ const config = computed(() => {
         label: "采购状态",
         prop: "purchaseStatus",
       },
+      render(status) {
+        return proxy.dictValueLabel(status, statusData.value);
+      },
     },
+
     {
       attrs: {
         label: "到货状态",
         prop: "arrivalStatus",
       },
+      render(status) {
+        return proxy.dictValueLabel(status, arrivalStatus.value);
+      },
     },
     {
       attrs: {
         label: "付款状态",
         prop: "payStatus",
       },
+      render(status) {
+        return proxy.dictValueLabel(status, paymentStatus.value);
+      },
     },
 
     {

+ 1 - 1
src/views/salesMange/shipmentMange/packing/index.vue

@@ -565,7 +565,7 @@ const config = computed(() => {
         width: 90,
       },
       render(status) {
-        return status == 1 ? "出货" : status == 0 ? "未出货" : "";
+        return status == 1 ? "出货" : status == 0 ? "未出货" : "";
       },
     },
     {