Ver código fonte

邮箱回复转发功能 以及ui样式更改

cz 1 ano atrás
pai
commit
f0b7a430bb

+ 1 - 1
src/components/byForm/index.vue

@@ -36,7 +36,6 @@
           :disabled="i.disabled ? i.disabled : false"
           :max="i.max"
           :min="i.min"
-          onmousewheel="return false;"
           :maxlength="i.maxlength"
           :readonly="i.readonly ? i.readonly : false"
           :style="i.style"
@@ -168,6 +167,7 @@
           :precision="i.precision !== '' ? i.precision : 2"
           :controls="i.controls === false ? false : true"
           :style="i.style"
+          onmousewheel="return false;"
         >
         </el-input-number>
         <el-tree

+ 1 - 0
src/components/process/Contract.vue

@@ -347,6 +347,7 @@
                       :controls="false"
                       :min="0"
                       @change="totalAmount()"
+                      onmousewheel="return false;"
                     />
                   </el-form-item>
                 </div>

+ 30 - 2
src/components/process/SendFunds.vue

@@ -156,6 +156,31 @@
               </el-form-item>
             </template>
           </el-table-column>
+          <el-table-column prop="count" label="关联合同" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="
+                  'accountRequestFundsDetailList.' + $index + '.contractId'
+                "
+                :rules="rules.contractId"
+                :inline-message="true"
+              >
+                <el-select
+                  v-model="row.contractId"
+                  placeholder="请选择"
+                  filterable
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in contractList"
+                    :label="item.code"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column prop="count" label="款项说明" min-width="150">
             <template #default="{ row, $index }">
               <el-form-item
@@ -381,7 +406,7 @@ const fundsType = ref([]);
 const fundsCostType = ref([]);
 const fundsPaymentMethod = ref([]);
 const currencyType = ref([]);
-
+const contractList = ref([]);
 const getDictData = () => {
   // 获取归属公司数据
   proxy
@@ -395,7 +420,10 @@ const getDictData = () => {
     .then((res) => {
       accountData.value = res.rows;
     });
-
+  // 关联合同
+  proxy.post("/contract/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
+    contractList.value = res.rows;
+  });
   // 部门树
   proxy
     .get("/tenantDept/list", {

+ 1 - 1
src/views/WDLY/basic/spu/index.vue

@@ -333,7 +333,7 @@ const handleSelect = (row) => {
     });
   formData.data.productInfos.push({
     name: row.name,
-    code: row.code,
+    code: row.customCode,
     id: row.id,
   });
   return ElMessage({

+ 150 - 208
src/views/WDLY/purchaseManage/payment/index.vue

@@ -17,7 +17,7 @@
           {
             text: '合并付款',
             disabled: selectData.length === 0,
-            action: () => start(20),
+            action: () => handlePayment(20),
           },
         ]"
         @get-list="getList"
@@ -31,23 +31,28 @@
           </div>
         </template>
 
-        <template #paymentStatus="{ item }">
+        <template #payStatus="{ item }">
           <div
             style="cursor: pointer; color: #409eff"
-            @click="handleClickArrivalStatus(item)"
+            @click="handleClickPayStatus(item)"
           >
-            {{ dictValueLabel(item.arrivalStatus, arrivalStatus) }}
+            {{ dictValueLabel(item.payStatus, paymentStatus) }}
           </div>
         </template>
 
         <template #btn="{ item }">
           <div>
-            <el-button type="primary" link @click="start(10)">付款</el-button>
-
-            <el-button type="primary" link @click="handleEdit(item, 88)"
+            <el-button type="primary" link @click="handlePayment(10)"
+              >付款</el-button
+            >
+            <el-button
+              type="primary"
+              link
+              v-if="item.payStatus != 30"
+              @click="handleEnd(item)"
               >结束</el-button
             >
-            <el-button type="primary" link @click="handleEdit(item, 99)"
+            <el-button type="primary" link @click="handleClear(item)"
               >清空</el-button
             >
           </div>
@@ -70,22 +75,23 @@
       >
         <template #details>
           <div style="width: 100%">
-            <el-table :data="formData.data.afterSaleDetailList">
-              <el-table-column prop="productCode" label="采购单号" />
-              <el-table-column prop="productName" label="采购金额" />
-              <el-table-column prop="productSpec" label="已付款金额" />
-              <el-table-column prop="quantity" label="付款金额" min-width="150">
+            <el-table :data="formData.data.purchasePayRecordDetailList">
+              <el-table-column prop="code" label="采购单号" />
+              <el-table-column prop="waitAmount" label="采购金额" />
+              <el-table-column prop="alreadyAmount" label="已付款金额" />
+              <el-table-column prop="amount" label="付款金额" min-width="150">
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'afterSaleDetailList.' + $index + '.quantity'"
-                    :rules="rules.quantity"
+                    :prop="'purchasePayRecordDetailList.' + $index + '.amount'"
+                    :rules="rules.amount"
                     :inline-message="true"
                   >
                     <el-input-number
-                      v-model="row.quantity"
-                      :precision="2"
+                      v-model="row.amount"
+                      :precision="4"
                       :controls="false"
                       :min="0"
+                      onmousewheel="return false;"
                     />
                   </el-form-item>
                 </template>
@@ -120,17 +126,15 @@
             placement="top"
             v-for="(activity, index) in activities"
             :key="index"
-            :timestamp="activity.handleTime"
+            :timestamp="activity.payUserName"
           >
-            <div>
-              跟进人:{{ activity.handleUserName }}
-              <span
-                >({{
-                  dictValueLabel(activity.status, afterSalesStatus)
-                }})</span
-              >
+            <!-- <template default>
+              <div>aa</div>
+            </template> -->
+            <div>付款金额:{{ moneyFormat(activity.amount, 2) }}</div>
+            <div style="margin-top: 5px">
+              付款时间: {{ activity.createTime }}
             </div>
-            <div style="margin-top: 5px">跟进记录: {{ activity.remark }}</div>
           </el-timeline-item>
         </el-timeline>
       </div>
@@ -142,19 +146,10 @@
 </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";
-import SelectProduct from "@/components/WDLY/product/SelectProduct";
-import useUserStore from "@/store/modules/user";
 
-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({
@@ -171,14 +166,8 @@ let dialogVisible = ref(false);
 let dialogVisibleOne = ref(false);
 let activities = ref([]);
 let modalType = ref("add");
-
 let rules = ref({
-  detailedAddress: [
-    { required: true, message: "请输入详细地址", trigger: "blur" },
-  ],
-  handleUserId: [
-    { required: true, message: "请选择跟进人", trigger: "change" },
-  ],
+  amount: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const arrivalStatus = ref([
@@ -212,12 +201,12 @@ const paymentStatus = ref([
 const selectConfig = computed(() => [
   {
     label: "到货状态",
-    prop: "type",
+    prop: "arrivalStatus",
     data: arrivalStatus.value,
   },
   {
     label: "付款状态",
-    prop: "status",
+    prop: "payStatus",
     data: paymentStatus.value,
   },
 ]);
@@ -234,45 +223,44 @@ const config = computed(() => {
         label: "采购单号",
         slot: "contractCode",
       },
-      // render(type) {
-      //   return proxy.dictValueLabel(type, afterSalesType.value);
-      // },
     },
     {
       attrs: {
         label: "供应商",
-        prop: "customerName",
+        prop: "supplyName",
       },
     },
     {
       attrs: {
         label: "收获仓库",
-        prop: "createTime",
+        prop: "receiptWarehouseName",
       },
     },
     {
       attrs: {
         label: "采购金额",
-        prop: "address",
+        prop: "amount",
+        width: 100,
       },
-      render() {
-        return proxy.moneyFormat(20, 2);
+      render(amount) {
+        return proxy.moneyFormat(amount, 2);
       },
     },
     {
       attrs: {
         label: "已付款金额",
-        prop: "cause",
+        prop: "paidAmount",
+        width: 100,
       },
-      render() {
-        return proxy.moneyFormat(20, 2);
+      render(paidAmount) {
+        return proxy.moneyFormat(paidAmount, 2);
       },
     },
     {
       attrs: {
         label: "采购人",
-        prop: "createTime",
-        width: 100,
+        prop: "purchaseName",
+        width: 150,
       },
     },
     {
@@ -285,14 +273,17 @@ const config = computed(() => {
     {
       attrs: {
         label: "到货状态",
-        prop: "createTime",
+        prop: "arrivalStatus",
         width: 100,
       },
+      render(status) {
+        return proxy.dictValueLabel(status, arrivalStatus.value);
+      },
     },
     {
       attrs: {
         label: "付款状态",
-        slot: "paymentStatus",
+        slot: "payStatus",
         width: 100,
       },
     },
@@ -324,22 +315,22 @@ const byform = ref(null);
 let formConfig = computed(() => [
   {
     type: "input",
-    prop: "type",
+    prop: "supplyName",
     label: "供应商",
     disabled: true,
   },
   {
     type: "date",
     itemType: "datetime",
-    prop: "type",
+    prop: "payDate",
     label: "付款时间",
     format: "YYYY-MM-DD HH:mm:ss",
   },
   {
     type: "number",
-    prop: "aa",
+    prop: "amount",
     label: "付款金额",
-    precision: 2,
+    precision: 4,
     min: 0,
     controls: false,
   },
@@ -357,37 +348,39 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/afterSaleRecord/page", sourceList.value.pagination)
-    .then((message) => {
-      console.log(message);
-      sourceList.value.data = message.rows;
-      sourceList.value.pagination.total = message.total;
+    .post("/purchase/pageByWdly", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows.map((x) => ({
+        ...x,
+        ...JSON.parse(x.victoriatouristJson),
+        isCheck: true,
+      }));
+      sourceList.value.pagination.total = res.total;
       setTimeout(() => {
         loading.value = false;
       }, 200);
     });
 };
-
-const rowData = ref({});
-
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
-    const list = formData.data.afterSaleDetailList;
-    if (!list.length > 0)
-      return ElMessage({
-        message: `请关联商品!`,
-        type: "info",
-      });
+    const list = formData.data.purchasePayRecordDetailList;
     for (let i = 0; i < list.length; i++) {
       const e = list[i];
-      if (e.quantity == 0) {
+      if (Number(e.amount) + Number(e.alreadyAmount) > Number(e.waitAmount)) {
         return ElMessage({
-          message: `数量不能为0!`,
+          message: `本次付款加已付款金额不可大于采购金额`,
           type: "info",
         });
       }
     }
-    proxy.post("ada", formData.data).then(
+    const total = list.reduce((total, x) => (total += Number(x.amount)), 0);
+    if (Number(formData.data.amount) != total) {
+      return ElMessage({
+        message: "本次付款合计必须等于上方的付款金额",
+        type: "info",
+      });
+    }
+    proxy.post("/purchasePayRecord/add", formData.data).then(
       (res) => {
         ElMessage({
           message: "操作成功",
@@ -406,158 +399,107 @@ const submitForm = () => {
   });
 };
 
-const getDtl = (row) => {
-  modalType.value = "edit";
-  proxy.post("/supplierInfo/detail", { id: row.id }).then((res) => {
-    proxy
-      .post("/fileInfo/getList", { businessIdList: [row.id] })
-      .then((fileObj) => {
-        fileList.value = fileObj[row.id] || [];
-        fileListCopy.value = [...fileList.value];
-        getCityData(res.countryId, "20");
-        getCityData(res.provinceId, "30");
-        res.type = res.type + "";
-        res.victoriatouristJson = JSON.parse(res.victoriatouristJson);
-        formData.data = res;
-        dialogVisible.value = true;
-      });
-  });
-};
-
-const handleClickFile = (row) => {
-  ElMessage({
-    message: "数据请求中,请稍后!",
-    type: "success",
-  });
-  let id = row.id;
-  proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
-    const file = res[id][0];
-    window.open(file.fileUrl, "_blank");
-  });
-};
-
-const handleClose = (index) => {
-  if (fileListCopy.value.length === 1) {
-    return ElMessage({
-      message: "最后一个附件啦!",
-      type: "info",
-    });
-  }
-  fileList.value.splice(index, 1);
-  fileListCopy.value.splice(index, 1);
-};
-
-const countryData = ref([]);
-const provinceData = ref([]);
-const cityData = ref([]);
-
-const getCityData = (id, type, flag) => {
-  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
-    if (type === "20") {
-      provinceData.value = res;
-      if (flag) {
-        formData.data.provinceId = "";
-        formData.data.provinceName = "";
-        formData.data.cityId = "";
-        formData.data.cityName = "";
-      }
-    } else if (type === "30") {
-      cityData.value = res;
-      if (flag) {
-        formData.data.cityId = "";
-        formData.data.cityName = "";
-      }
-    } else {
-      countryData.value = res;
-    }
-  });
-};
-const handleSelect = (row) => {
-  const flag = formData.data.afterSaleDetailList.some(
-    (x) => x.productId === row.id
-  );
-  if (flag)
-    return ElMessage({
-      message: "该商品已选择",
-      type: "info",
-    });
-  formData.data.afterSaleDetailList.push({
-    productName: row.name,
-    productCode: row.code,
-    productSpec: row.spec,
-    productId: row.id,
-    quantity: null,
-    remark: "",
-  });
-  return ElMessage({
-    message: "选择成功",
-    type: "success",
-  });
-};
-
-const handleRemove = (index) => {
-  formData.data.afterSaleDetailList.splice(index, 1);
-  return ElMessage({
-    message: "删除成功",
-    type: "success",
-  });
-};
-
-const getDict = () => {
-  proxy.getDict(["after_sale_type", "after_sale_status"]).then((res) => {
-    afterSalesType.value = res["after_sale_type"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-    afterSalesStatus.value = res["after_sale_status"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-  });
-};
-
 const selectData = ref([]);
-const selectDataOne = ref([]);
 const selectRow = (data) => {
   selectData.value = data;
 };
 watch(selectData, (newVal, oldVal) => {
   if (newVal.length == 0) {
     sourceList.value.data.forEach((x) => {
-      if (x.status <= 30) {
-        x.isCheck = true;
-      } else {
-        x.isCheck = false;
-      }
+      x.isCheck = true;
     });
   } else if (newVal.length == 1) {
     const current = newVal[0];
     sourceList.value.data.forEach((x) => {
-      if (x.receiptWarehouseId !== current.receiptWarehouseId) {
+      if (x.supplyId !== current.supplyId) {
         x.isCheck = false;
       }
     });
   }
 });
-
-const start = (type, data) => {
+const handlePayment = (type, data) => {
   modalType.value = "add";
-  let ids = [];
-  let row = {};
   if (type === 10) {
-    selectDataOne.value = [data];
-    // row = selectDataOne.value[0];
-    // ids = selectDataOne.value.map((x) => x.id).join();
+    selectData.value = [data];
   } else if (type === 20) {
-    // ids = selectData.value.map((x) => x.id).join();
-    // row = selectData.value[0];
   }
+  formData.data = {
+    supplyName: selectData.value[0].supplyName,
+    amount: "",
+    payDate: "",
+    purchasePayRecordDetailList: selectData.value.map((x) => ({
+      purchaseId: x.id,
+      code: x.contractCode,
+      waitAmount: x.amount,
+      alreadyAmount: x.paidAmount,
+      amount: null,
+    })),
+  };
   dialogVisible.value = true;
 };
 
-getCityData("0");
+const handleClickPayStatus = (row) => {
+  proxy
+    .post("/purchasePayRecordDetail/page", { purchaseId: row.id })
+    .then((res) => {
+      if (res && res.rows && res.rows.length > 0) {
+        activities.value = res.rows;
+        dialogVisibleOne.value = true;
+      } else {
+        return ElMessage({
+          message: `暂无付款记录`,
+          type: "info",
+        });
+      }
+    });
+};
+
+const handleEnd = (row) => {
+  // 弹窗提示是否删除
+  ElMessageBox.confirm("是否确认结束?", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    // 删除
+    proxy
+      .post("/purchase/edit", {
+        ...row,
+        payStatus: 30,
+      })
+      .then((res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        getList();
+      });
+  });
+};
+
+const handleClear = (row) => {
+  // 弹窗提示是否删除
+  ElMessageBox.confirm("是否确认清空付款记录?", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    // 删除
+    proxy
+      .post("/purchasePayRecordDetail/empty", {
+        purchaseId: row.id,
+      })
+      .then((res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        getList();
+      });
+  });
+};
+
 getList();
-getDict();
 </script>
   
 <style lang="scss" scoped>

+ 2 - 2
src/views/WDLY/stockManage/query/index.vue

@@ -168,7 +168,7 @@ const configData = [
     {
       attrs: {
         label: "物品编码",
-        prop: "productCode",
+        prop: "productCustomCode",
       },
     },
     {
@@ -255,7 +255,7 @@ const configData = [
     {
       attrs: {
         label: "物品编码",
-        prop: "productCode",
+        prop: "productCustomCode",
       },
     },
     {

+ 11 - 4
src/views/connect/E-mail/mail/com/left.vue

@@ -71,8 +71,8 @@
           ></el-tree>
         </div>
       </div>
-      <div v-if="activeName === 'second'">b</div>
-      <div v-if="activeName === 'third'">c</div>
+      <div v-if="activeName === 'second'">暂未开放</div>
+      <div v-if="activeName === 'third'">暂未开放</div>
     </div>
   </div>
 </template>
@@ -146,12 +146,19 @@ const handleGoWrite = (mail = "") => {
     title: "写信",
     type: selectMail.value.type,
     id: "write",
+    pageType: "0",
   };
   if (mail) {
     menu.reMail = mail;
   }
-  const menuItem = mailStore.mailMenuList.find((x) => x.id === menu.id);
-  if (menuItem === undefined) {
+  // const menuItem = mailStore.mailMenuList.find((x) => x.id === menu.id);
+  // if (menuItem === undefined) {
+  //   mailStore.mailMenuList.push(menu);
+  // }
+  const index = mailStore.mailMenuList.findIndex((x) => x.id === menu.id);
+  if (index >= 0) {
+    mailStore.mailMenuList[index] = menu;
+  } else {
     mailStore.mailMenuList.push(menu);
   }
   mailStore.currentMenu = menu;

+ 97 - 9
src/views/connect/E-mail/mail/com/mailDetail.vue

@@ -1,7 +1,10 @@
 <template>
   <div v-loading="loading" class="box">
+    <div style="margin-bottom: 10px">
+      <el-button type="primary" @click="handleReply('10')">回 复</el-button>
+      <el-button type="warning" @click="handleReply('20')">转 发</el-button>
+    </div>
     <div class="top">
-      <!-- <div class="top-row"></div> -->
       <div class="top-row">
         <div class="label">发 件 人:</div>
         <div class="value">
@@ -10,7 +13,7 @@
             :key="item.id"
             style="margin-right: 10px"
           >
-            {{ item.personalName }}</span
+            {{ item.email || item.personalName }}</span
           >
         </div>
       </div>
@@ -18,31 +21,52 @@
         <div class="label">收 件 人:</div>
         <div class="value">
           <span v-for="item in to" :key="item.id" style="margin-right: 10px">{{
-            item.personalName
+            item.email || item.personalName
           }}</span>
         </div>
       </div>
-      <div class="top-row" v-if="cc.length > 0">
+      <div class="top-row" v-if="cc && cc.length > 0">
         <div class="label">抄 送 人:</div>
         <div class="value">
           <span v-for="item in cc" :key="item.id" style="margin-right: 10px">
-            {{ item.personalName }}</span
+            {{ item.email || item.personalName }}</span
           >
         </div>
       </div>
-      <div class="top-row" v-if="bcc.length > 0">
+      <div class="top-row" v-if="bcc && bcc.length > 0">
         <div class="label">密 送 人:</div>
         <div class="value">
           <span v-for="item in bcc" :key="item.id" style="margin-right: 10px">
-            {{ item.personalName }}</span
+            {{ item.email || item.personalName }}</span
           >
         </div>
       </div>
       <div class="top-row">
         <div class="label">时 间:</div>
-        <div class="value">{{ time }}</div>
+        <div class="value">
+          {{ time }}
+        </div>
+      </div>
+      <div class="top-row" v-if="fileList && fileList.length > 0">
+        <div class="label">附 件:</div>
+        <div class="value">
+          <div
+            v-for="item in fileList"
+            style="margin-right: 20px; display: flex; align-items: center"
+          >
+            <span style="cursor: pointer" @click="handleClickFile(item)">{{
+              item.name
+            }}</span>
+            <span
+              style="margin-left: 8px; cursor: pointer"
+              @click="handleClickDownload(item)"
+              ><el-icon color="#0084FF"><Download /></el-icon
+            ></span>
+          </div>
+        </div>
       </div>
     </div>
+
     <div class="body">
       <iframe
         frameborder="0"
@@ -51,7 +75,7 @@
           width: 99% !important;
           overflow-x: scroll;
           padding-top: 10px;
-          height: 600px;
+          height: 500px;
         "
         :srcdoc="showBodyText(detailsData.data.content)"
         :ref="'iframeText_' + mailStore.currentId"
@@ -75,7 +99,9 @@ const to = ref([]);
 const cc = ref([]);
 const bcc = ref([]);
 const replyTo = ref([]);
+const fileList = ref([]);
 const requestData = ref({});
+const time = ref("");
 const getDetails = () => {
   loading.value = true;
   proxy
@@ -84,11 +110,16 @@ const getDetails = () => {
       messageId: mailStore.currentMenu.messageId,
     })
     .then((res) => {
+      if (mailStore.currentMenu.time) {
+        time.value = mailStore.currentMenu.time;
+      }
+
       detailsData.data = res;
       to.value = res.messageAddressList.filter((x) => x.type === 1);
       cc.value = res.messageAddressList.filter((x) => x.type === 2);
       bcc.value = res.messageAddressList.filter((x) => x.type === 3);
       replyTo.value = res.messageAddressList.filter((x) => x.type === 4);
+      fileList.value = res.messageAttachmentList;
       loading.value = false;
     });
 };
@@ -119,6 +150,62 @@ onMounted(() => {
   // init();
 });
 
+const handleReply = (pageType) => {
+  // pageType 10为回复  20为转发  0为写信
+  let title = "";
+  if (pageType === "10") {
+    title = "回复";
+  } else if (pageType === "20") {
+    title = "转发";
+  }
+  const menu = {
+    title: title,
+    type: mailStore.currentMenu.type,
+    id: "write",
+    pageType: pageType,
+    details: {
+      ...detailsData.data,
+      ...mailStore.currentMenu.row,
+    },
+  };
+  const index = mailStore.mailMenuList.findIndex((x) => x.id === menu.id);
+  if (index >= 0) {
+    mailStore.mailMenuList[index] = menu;
+  } else {
+    mailStore.mailMenuList.push(menu);
+  }
+  mailStore.currentMenu = menu;
+  mailStore.currentId = menu.id;
+};
+
+const handleClickFile = (file) => {
+  const path = file.path ? file.path : file.url ? file.url : "";
+  if (path) {
+    window.open(path, "_blank");
+  }
+};
+
+const handleClickDownload = (file) => {
+  let xhr = new XMLHttpRequest();
+  //域名是华为云的
+  xhr.open("GET", `${file.url}`, true);
+  xhr.responseType = "blob";
+  xhr.send();
+  xhr.onreadystatechange = function () {
+    if (xhr.readyState === 4 && xhr.status === 200) {
+      let url = window.URL.createObjectURL(xhr.response);
+      const a = document.createElement("a");
+      a.href = url;
+      a.download = file.fileName; // 下载后文件名
+      a.style.display = "none";
+      document.body.appendChild(a);
+      a.click(); // 点击下载
+      window.URL.revokeObjectURL(a.href);
+      document.body.removeChild(a); // 下载完成移除元素
+    }
+  };
+};
+
 defineExpose({
   initFn: init,
 });
@@ -144,6 +231,7 @@ defineExpose({
         color: #333333;
         font-weight: 700;
         margin-right: 10px;
+        display: flex;
       }
     }
   }

+ 2 - 0
src/views/connect/E-mail/mail/com/mailList.vue

@@ -131,6 +131,8 @@ const handleRowClick = (row) => {
     type: mailStore.selectMail.type,
     messageId: row.id,
     id: "detail" + "," + row.id,
+    time: row.sendDate,
+    row: { ...row },
   };
   const menuItem = mailStore.mailMenuList.find((x) => x.id === menu.id);
   if (menuItem === undefined) {

+ 68 - 8
src/views/connect/E-mail/mail/com/mailWrite.vue

@@ -202,6 +202,7 @@
             <Editor
               :value="formData.data.content"
               @updateValue="updateContent"
+              ref="contentEditor"
             />
           </div>
         </el-form-item>
@@ -306,6 +307,22 @@ const cc = ref([]);
 const bcc = ref([]);
 const replyTo = ref([]);
 const submit = ref(null);
+const handleReset = () => {
+  formData.data = {
+    to: "",
+    cc: "",
+    bcc: "",
+    content: "",
+    subject: "",
+    replyTo: "",
+  };
+  to.value = [];
+  cc.value = [];
+  bcc.value = [];
+  fileList.value = [];
+  fileListCopy.value = [];
+  contentEditor.value.changeHtml("");
+};
 const handleSend = () => {
   submit.value.validate((valid) => {
     if (valid) {
@@ -342,14 +359,7 @@ const handleSend = () => {
             message: "发送成功",
             type: "success",
           });
-          formData.data = {
-            content: "",
-          };
-          to.value = [];
-          cc.value = [];
-          bcc.value = [];
-          fileList.value = [];
-          fileListCopy.value = [];
+          handleReset();
         });
       } else {
         return ElMessage({
@@ -449,6 +459,52 @@ const querySearchPerson = (queryString, callback) => {
   callback(results);
 };
 
+const contentEditor = ref(null);
+const handleReplyInit = (allData, pageType) => {
+  let data = allData.details;
+  // 回复功能:则发件人是回复的收件人
+  if (pageType === "10") {
+    if (data.messageAddressList && data.messageAddressList.length > 0) {
+      to.value = data.messageAddressList
+        .filter((x) => x.type === 4)
+        .map((x) => ({
+          address: x.email,
+          personal: x.personalName,
+        }));
+    }
+    formData.data.subject = "Re: " + data.subject;
+  } else if (pageType === "20") {
+    to.value = [];
+    formData.data.subject = "Fw: " + data.subject;
+  }
+  console.log(data.content, "ada");
+  contentEditor.value.changeHtml("<p><br></p><p><br></p>" + data.content);
+  formData.data.replyTo = mailStore.selectMail.mailUser;
+};
+
+const init = () => {
+  // if (mailStore.currentMenu.pageType === "0") {
+  //   handleReset();
+  // } else if (mailStore.currentMenu.pageType === "10") {
+  //   handleReplyInit(mailStore.currentMenu, "10");
+  // } else if (mailStore.currentMenu.pageType === "20") {
+  //   handleReplyInit(mailStore.currentMenu, "20");
+  // }
+};
+
+watch(
+  () => mailStore.currentMenu.pageType,
+  (val) => {
+    if (val === "0") {
+      handleReset();
+    } else if (val === "10") {
+      handleReplyInit(mailStore.currentMenu, "10");
+    } else if (val === "20") {
+      handleReplyInit(mailStore.currentMenu, "20");
+    }
+  }
+);
+
 onMounted(() => {
   if (mailStore.currentMenu.reMail) {
     to.value.push({
@@ -457,6 +513,10 @@ onMounted(() => {
     });
   }
 });
+
+defineExpose({
+  initFn: init,
+});
 </script>
 
 <style lang="scss" scoped>

+ 10 - 3
src/views/connect/E-mail/mail/com/main.vue

@@ -23,7 +23,10 @@
             v-show="item.id.includes('detail')"
             :ref="'detail' + index"
           ></mailDetail>
-          <mailWrite v-show="item.id.includes('write')"></mailWrite>
+          <mailWrite
+            v-show="item.id.includes('write')"
+            :ref="'write' + index"
+          ></mailWrite>
         </div>
       </el-tab-pane>
     </el-tabs>
@@ -74,11 +77,15 @@ const handleTabRemove = (id) => {
 };
 
 const checkType = (menu, type) => {
-  if (type == "write") return;
+  // if (type == "write") return;
   const index = menuList.value.findIndex((x) => x.id === activeMenu.value);
   const dom = type + index.toString();
   nextTick(() => {
-    proxy.$refs[dom][0].initFn();
+    if (type == "write") {
+      proxy.$refs[dom][0].initFn();
+    } else {
+      proxy.$refs[dom][0].initFn();
+    }
   });
 };
 

+ 78 - 31
src/views/finance/fundManage/accountPayment/index.vue

@@ -13,17 +13,33 @@
           select: select,
         }"
         :action-list="[]"
-        @get-list="getList">
+        @get-list="getList"
+      >
         <template #pic="{ item }">
           <div v-if="item.fileList.length > 0">
-            <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
+            <img
+              :src="item.fileList[0].fileUrl"
+              class="pic"
+              @click="handleClickFile(item.fileList[0])"
+            />
           </div>
           <div v-else></div>
         </template>
       </byTable>
     </div>
-    <el-dialog :title="modalType == 'add' ? '打款' : '打款'" v-model="dialogVisible" width="500" v-loading="loading">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+    <el-dialog
+      :title="modalType == 'add' ? '打款' : '打款'"
+      v-model="dialogVisible"
+      width="500"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
         <template #productPic>
           <div>
             <el-upload
@@ -33,7 +49,8 @@
               list-type="picture-card"
               :on-remove="handleRemove"
               :on-success="handleSuccess"
-              :before-upload="handleBeforeUpload">
+              :before-upload="handleBeforeUpload"
+            >
               <el-icon><Plus /></el-icon>
             </el-upload>
           </div>
@@ -41,13 +58,34 @@
       </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>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
       </template>
     </el-dialog>
-    <el-dialog title="Excel导入" v-model="openExcelDialog" width="400" v-loading="loading">
+    <el-dialog
+      title="Excel导入"
+      v-model="openExcelDialog"
+      width="400"
+      v-loading="loading"
+    >
       <template #footer>
-        <el-button @click="openExcelDialog = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitExcel()" size="large" :loading="submitLoading"> 确 定 </el-button>
+        <el-button @click="openExcelDialog = false" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          @click="submitExcel()"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
       </template>
     </el-dialog>
   </div>
@@ -79,10 +117,12 @@ let openExcelDialog = ref(false);
 
 let modalType = ref("add");
 let rules = ref({
-  productClassifyId: [{ required: true, message: "请选择物料分类", trigger: "change" }],
+  productClassifyId: [
+    { required: true, message: "请选择物料分类", trigger: "change" },
+  ],
   type: [{ required: true, message: "请选择物料类型", trigger: "change" }],
-  name: [{ required: true, message: "请输入物料名称", trigger: "blur" }],
-  unit: [{ required: true, message: "请选择单位", trigger: "change" }],
+  // name: [{ required: true, message: "请输入物料名称", trigger: "blur" }],
+  // unit: [{ required: true, message: "请选择单位", trigger: "change" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = computed(() => {
@@ -217,55 +257,54 @@ const formConfig = computed(() => {
       type: "input",
       prop: "businessManagementName",
       label: "付款账户",
-      readonly: true,
+      disabled: true,
     },
     {
       type: "input",
       prop: "incomeAmount",
       label: "请款金额",
-      readonly: true,
+      disabled: true,
     },
     {
       type: "input",
       prop: "paymentMethod",
       label: "付款方式",
-      readonly: true,
+      disabled: true,
     },
     {
       type: "input",
       prop: "name",
       label: "户名",
-      readonly: true,
+      disabled: true,
     },
     {
       type: "input",
       prop: "accountOpening",
       label: "银行账号",
-      readonly: true,
+      disabled: true,
     },
     {
       type: "input",
       prop: "openingBank",
       label: "开户银行",
-      readonly: true,
+      disabled: true,
     },
     {
       type: "input",
       prop: "interbankNumber",
       label: "联行号 / SWIFT Code",
-      readonly: true,
+      disabled: true,
     },
     {
       type: "input",
       prop: "remark",
       label: "摘要",
-      readonly: true,
+      disabled: true,
     },
     {
       type: "title",
-      label: "付款信息",
+      title: "付款信息",
     },
-
     {
       type: "select",
       prop: "accountManagementId",
@@ -292,11 +331,14 @@ const formConfig = computed(() => {
       placeholder: "请输入",
       selectPlaceholder: "币种",
       selectProp: "currency",
+      disabled: true,
     },
     {
       type: "date",
+      itemType: "datetime",
       prop: "expensesTime",
       label: "打款时间",
+      format: "YYYY-MM-DD HH:mm:ss",
     },
     {
       type: "input",
@@ -331,14 +373,16 @@ const generatePassword = () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/accountPayment/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);
-  });
+  proxy
+    .post("/accountPayment/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 uploadData = ref({});
 const fileList = ref([]);
@@ -432,6 +476,7 @@ const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/accountPayment/detail", { id: row.id }).then((res) => {
     formData.data = res;
+    formData.data.amount = formData.data.incomeAmount;
     dialogVisible.value = true;
   });
 };
@@ -457,7 +502,9 @@ const handleSuccess = (res, file, files) => {
 };
 
 const handleRemove = (file) => {
-  const index = fileListCopy.value.findIndex((x) => x.uid === file.uid || x.id === file.id);
+  const index = fileListCopy.value.findIndex(
+    (x) => x.uid === file.uid || x.id === file.id
+  );
   fileListCopy.value.splice(index, 1);
 };