Kaynağa Gözat

邮箱功能完善

cz 1 yıl önce
ebeveyn
işleme
f9b20fe408

+ 1 - 0
src/utils/request.js

@@ -68,6 +68,7 @@ service.interceptors.request.use(config => {
       if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
         const message = '数据正在处理,请勿重复提交';
         // console.warn(`[${s_url}]: ` + message)
+        console.log(s_url, '重复提交的url');
         return Promise.reject(new Error(message))
       } else {
         cache.session.setJSON('sessionObj', requestObj)

+ 1 - 1
src/views/WDLY/outInBound/waitOutBound/index.vue

@@ -224,7 +224,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "物品编码",
-        prop: "productCode",
+        prop: "productCustomCode",
       },
     },
     {

+ 25 - 24
src/views/connect/E-mail/mail/com/left.vue

@@ -330,10 +330,10 @@ let activeName = ref("first");
 const mailMapData = {
   inbox: ["INBOX"],
   unread: ["UNREAD"],
-  draft: ["草稿箱", "草稿", "Drafts"],
-  sent: ["已发送", "Sent Messages"],
-  delete: ["已删除", "Deleted Messages"],
-  waste: ["垃圾邮件", "Junk"],
+  draft: ["草稿箱", "Drafts", "[Gmail]/草稿"],
+  sent: ["已发送", "Sent Messages", "[Gmail]/已发邮件"],
+  delete: ["已删除", "Deleted Messages", "[Gmail]/已删除邮件"],
+  waste: ["垃圾邮件", "Junk", "[Gmail]/垃圾邮件"],
 };
 let selectFloderId = ref("");
 const mailList = ref([]);
@@ -376,9 +376,11 @@ const tagFormConfig = computed(() => [
     itemWidth: 100,
   },
 ]);
+
 const tagRules = ref({
   name: [{ required: true, message: "请输入标签名称", trigger: "blur" }],
 });
+
 const getTagsList = () => {
   proxy
     .post("/myTag/page", {
@@ -387,15 +389,13 @@ const getTagsList = () => {
       id: useUserStore().user.userId,
     })
     .then((res) => {
-      if (res && res.rows.length > 0) {
-        tagsTreeData.value = [
-          {
-            name: "我的标签",
-            id: "0",
-            children: res.rows,
-          },
-        ];
-      }
+      tagsTreeData.value = [
+        {
+          name: "我的标签",
+          id: "0",
+          children: res.rows,
+        },
+      ];
     });
 };
 
@@ -450,15 +450,13 @@ const handleDelTag = (data) => {
 
 const getMyFolderTree = (data) => {
   proxy.post("/myFolder/tree", { mailboxId: data.id }).then((res) => {
-    if (res && res.length > 0) {
-      myFolderTreeData.value = [
-        {
-          label: "我的文件夹",
-          id: "0",
-          children: res,
-        },
-      ];
-    }
+    myFolderTreeData.value = [
+      {
+        label: "我的文件夹",
+        id: "0",
+        children: res,
+      },
+    ];
   });
 };
 
@@ -512,6 +510,7 @@ const handleDelFolder = (data) => {
     });
   });
 };
+
 const getMialList = () => {
   proxy.get("/mailService/getUserEmailList").then((res) => {
     for (let i = 0; i < res.data.length; i++) {
@@ -756,8 +755,10 @@ const clickTreeMail = (data, node) => {
   }
 };
 
-getMialList();
-getTagsList();
+onMounted(() => {
+  getMialList();
+  getTagsList();
+});
 
 defineExpose({
   handleGoWrite,

+ 157 - 24
src/views/connect/E-mail/mail/com/mailDetail.vue

@@ -1,6 +1,13 @@
 <template>
   <div v-loading="loading" class="box">
-    <div style="margin-bottom: 10px">
+    <div
+      style="
+        margin-bottom: 10px;
+        display: flex;
+        align-items: center;
+        flex-wrap: wrap;
+      "
+    >
       <el-button
         :disabled="currentMailIndex === 0"
         @click="handleChangeEail('10')"
@@ -17,6 +24,23 @@
       <el-button @click="handleReply('40')">再次编辑</el-button>
       <el-button @click="handleMove">移动</el-button>
       <el-button @click="handleRemove">删除</el-button>
+      <el-tag
+        style="margin-left: 8px"
+        type="success"
+        closable
+        v-for="(tag, index) in mailTagList"
+        :key="index"
+        @close="tagClose(tag)"
+      >
+        {{ tag.name }}
+      </el-tag>
+      <el-tag
+        style="margin-left: 8px; cursor: pointer"
+        type="success"
+        @click="handleAddTag"
+      >
+        +
+      </el-tag>
     </div>
     <div class="top">
       <div class="top-row">
@@ -128,11 +152,40 @@
         </el-button>
       </template>
     </el-dialog>
+
+    <el-dialog
+      title="添加标签"
+      v-model="tagDialog"
+      width="300px"
+      destroy-on-close
+      v-loading="submitLoading"
+    >
+      <byForm
+        :formConfig="tagFormConfig"
+        :formOption="formOption"
+        v-model="formData.tagData"
+        :rules="rules"
+        ref="tagForm"
+      >
+      </byForm>
+      <template #footer>
+        <el-button @click="tagDialog = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitTagForm()"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import useMailStore from "@/store/modules/mail";
+import useUserStore from "@/store/modules/user";
 import byForm from "@/components/byForm/index";
 import { ElMessage, ElMessageBox } from "element-plus";
 const { proxy } = getCurrentInstance();
@@ -174,13 +227,35 @@ const myFolderFormConfig = computed(() => [
     },
   },
 ]);
+
 const formData = reactive({
   myFolderData: {},
+  tagData: {},
 });
+
 const rules = ref({
   myFolderId: [{ required: true, message: "请选择文件夹", trigger: "change" }],
+  myTagId: [{ required: true, message: "请选择标签", trigger: "change" }],
 });
 
+const allTagList = ref([]);
+const mailTagList = ref([]);
+const tagForm = ref(null);
+const tagDialog = ref(false);
+const tagFormConfig = computed(() => [
+  {
+    type: "select",
+    prop: "myTagId",
+    label: "标签名称",
+    disabled: false,
+    itemWidth: 100,
+    data: allTagList.value,
+    style: {
+      width: "100%",
+    },
+  },
+]);
+
 const getMyFolderTree = (flag) => {
   if (flag) {
     setTimeout(() => {
@@ -245,14 +320,69 @@ const submitMyFolderForm = () => {
   });
 };
 
+const getAllTagData = () => {
+  proxy
+    .post("/myTag/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      id: useUserStore().user.userId,
+    })
+    .then((res) => {
+      allTagList.value = res.rows;
+    });
+};
+
 const getMailTag = () => {
-  // proxy
-  //   .post("/myTagMessage/getListByMessageId", {
-  //     id: mailStore.currentMenu.messageId,
-  //   })
-  //   .then((res) => {
-  //     console.log(res, "ada");
-  //   });
+  if (mailStore.currentMenu.messageId) {
+    proxy
+      .post("/myTag/getListByMessageId", {
+        id: mailStore.currentMenu.messageId,
+      })
+      .then((res) => {
+        mailTagList.value = res;
+      });
+  }
+};
+
+const tagClose = (tag) => {
+  proxy
+    .post("/myTagMessage/deleteTag", {
+      myTagId: tag.id,
+      messageId: mailStore.currentMenu.messageId,
+    })
+    .then(() => {
+      ElMessage({
+        message: "操作成功",
+        type: "success",
+      });
+      getMailTag();
+    });
+};
+
+const handleAddTag = () => {
+  formData.tagData.messageId = mailStore.currentMenu.messageId;
+  formData.tagData.myTagId = "";
+  tagDialog.value = true;
+};
+
+const submitTagForm = () => {
+  tagForm.value.handleSubmit(() => {
+    submitLoading.value = true;
+    proxy.post("/myTagMessage/add", formData.tagData).then(
+      (res) => {
+        ElMessage({
+          message: `操作成功!`,
+          type: "success",
+        });
+        tagDialog.value = false;
+        submitLoading.value = false;
+        getMailTag();
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
 };
 
 const getDetails = (messageId) => {
@@ -294,20 +424,6 @@ const showBodyText = (text) => {
   }
 };
 
-const init = () => {
-  //实时更换索引
-  if (mailStore.currentMenu.messageId) {
-    mailStore.currentMailIndex = mailStore.mailDataList.findIndex(
-      (x) => x.id === mailStore.currentMenu.messageId
-    );
-  }
-  getDetails(mailStore.currentMenu.messageId);
-};
-
-onMounted(() => {
-  // init();
-});
-
 const handleReply = (pageType) => {
   // pageType 10为回复  20为转发 30为全部回复 40为再次编辑  0为写信
   let title = "";
@@ -398,8 +514,25 @@ const handleClickDownload = (file) => {
     }
   };
 };
-getMyFolderTree(true);
-getMailTag();
+
+// onMounted(() => {
+//   getMyFolderTree(true);
+//   getAllTagData();
+// });
+
+const init = () => {
+  //实时更换索引
+  if (mailStore.currentMenu.messageId) {
+    mailStore.currentMailIndex = mailStore.mailDataList.findIndex(
+      (x) => x.id === mailStore.currentMenu.messageId
+    );
+  }
+  getDetails(mailStore.currentMenu.messageId);
+  getMailTag();
+  getMyFolderTree(true);
+  getAllTagData();
+};
+
 defineExpose({
   initFn: init,
 });

+ 1 - 44
src/views/connect/E-mail/mail/com/mailList.vue

@@ -104,49 +104,6 @@
         @size-change="handleSizeChange"
       />
     </div>
-    <!-- <byTable
-      :source="tableData.data"
-      :pagination="tableData.pagination"
-      :config="config"
-      :loading="loading"
-      :hideSearch="true"
-      highlight-current-row
-      :action-list="[]"
-      :table-events="{
-        //element talbe事件都能传
-        'row-click': handleRowClick,
-      }"
-      @get-list="getList"
-    >
-      <template #icon="{ item }">
-        <div>
-          <span v-if="!item.flags.includes('6')">
-            <img
-              src="@/assets/images/mail/message.png"
-              alt=""
-              title="未读"
-              class="messageImg"
-            />
-          </span>
-          <span v-if="item.flags.includes('6') && item.flags.includes('1')">
-            <img
-              src="@/assets/images/mail/replied.png"
-              alt=""
-              title="已回复"
-              class="messageImg"
-            />
-          </span>
-          <span v-if="item.flags.includes('6')">
-            <img
-              src="@/assets/images/mail/message-open.png"
-              alt=""
-              title="已读"
-              class="messageImg"
-            />
-          </span>
-        </div>
-      </template>
-    </byTable> -->
   </div>
 </template>
 
@@ -252,7 +209,7 @@ const handleRefresh = () => {
     pageNum: 1,
     pageSize: 15,
   };
-  getList();
+  // getList();
 };
 
 const handleRowClick = (row, index) => {

+ 1 - 3
src/views/connect/E-mail/mail/com/mailWrite.vue

@@ -1,8 +1,5 @@
 <template>
   <div v-loading="loading" style="padding: 10px">
-    <!-- <div style="margin-bottom: 10px; padding-left: 65px">
-      <el-button type="primary" @click="handleSend">发 送</el-button>
-    </div> -->
     <div style="width: 100%">
       <el-form
         ref="submit"
@@ -565,6 +562,7 @@ const init = () => {
     handleReplyInit(mailStore.currentMenu, "50");
   }
 };
+
 watch(
   () => mailStore.currentMenu.pageType,
   (val) => {

+ 4 - 4
src/views/dataBoard/board/salesAnalysis/index.vue

@@ -487,10 +487,10 @@ const productSalesOneConfig = computed(() => {
     {
       attrs: {
         label: "销售量(个)",
-        prop: "amount",
+        prop: "quantity",
       },
-      render(amount) {
-        return proxy.moneyFormat(amount, 2);
+      render(quantity) {
+        return proxy.moneyFormat(quantity, 2);
       },
     },
   ];
@@ -560,7 +560,7 @@ const getData = () => {
     sourceList.value.productSalesVolumeOneData = res;
     const option = { ...optionTwo };
     option.data.xAxis[0].data = res.map((x) => x.productName);
-    option.data.series[0].data = res.map((x) => x.amount);
+    option.data.series[0].data = res.map((x) => x.quantity);
     option.data.series[0].name = "销售量(个)";
     myChartFour.setOption(option.data);
     setTimeout(() => {

+ 29 - 7
src/views/salesMange/shipmentMange/packing/index.vue

@@ -148,10 +148,14 @@
                   :prop="'packDetailList.' + index + '.packQuantity'"
                   :rules="rules.packQuantity"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="item.packQuantity"
+                    :precision="0"
+                    :controls="false"
+                    :min="0"
                     placeholder="请输入"
-                  ></el-input>
+                    onmousewheel="return false;"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="5">
@@ -160,10 +164,14 @@
                   :prop="'packDetailList.' + index + '.netWeight'"
                   :rules="rules.netWeight"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="item.netWeight"
+                    :precision="0"
+                    :controls="false"
+                    :min="0"
                     placeholder="请输入"
-                  ></el-input>
+                    onmousewheel="return false;"
+                  />
                 </el-form-item>
               </el-col>
 
@@ -173,10 +181,14 @@
                   :prop="'packDetailList.' + index + '.roughWeight'"
                   :rules="rules.roughWeight"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="item.roughWeight"
+                    :precision="0"
+                    :controls="false"
+                    :min="0"
                     placeholder="请输入"
-                  ></el-input>
+                    onmousewheel="return false;"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="9">
@@ -195,6 +207,7 @@
                           :precision="2"
                           :controls="false"
                           :min="0"
+                          onmousewheel="return false;"
                         ></el-input-number>
                       </el-form-item>
                     </el-col>
@@ -211,6 +224,7 @@
                           :precision="2"
                           :controls="false"
                           :min="0"
+                          onmousewheel="return false;"
                         ></el-input-number>
                       </el-form-item>
                     </el-col>
@@ -227,6 +241,7 @@
                           :precision="2"
                           :controls="false"
                           :min="0"
+                          onmousewheel="return false;"
                         ></el-input-number>
                       </el-form-item>
                     </el-col>
@@ -418,6 +433,7 @@ let dialogVisibleOne = ref(false);
 let modalType = ref("add");
 let fileList = ref([]);
 let rules = ref({
+  contractIds: [{ required: true, message: "请选择合同", trigger: "change" }],
   packQuantity: [{ required: true, message: "请输入箱数", trigger: "blur" }],
   netWeight: [{ required: true, message: "请输入净重", trigger: "blur" }],
   roughWeight: [{ required: true, message: "请输入毛重", trigger: "blur" }],
@@ -684,6 +700,12 @@ const openModalOne = () => {
 const submitForm = () => {
   formDom.value.validate((vaild) => {
     if (vaild) {
+      if (!formData.data.packDetailList.length > 0) {
+        return ElMessage({
+          message: "请添加装箱明细!",
+          type: "info",
+        });
+      }
       submitLoading.value = true;
       loadingOne.value = true;
       for (let i = 0; i < formData.data.packDetailList.length; i++) {
@@ -878,7 +900,7 @@ const getData = (data, type) => {
 };
 
 const handleClose = () => {
-  dialogVisible = false;
+  dialogVisible.value = false;
   selectProductData.value = [];
 };
 getSelectData();