瀏覽代碼

0.4部分需求以及bug解决

cz 1 年之前
父節點
當前提交
c632e4f94f

+ 12 - 3
src/components/Editor/index.vue

@@ -9,6 +9,7 @@
       v-model:content="content"
       :options="data.editorOption"
       contentType="html"
+      :read-only="readOnly"
       @update:content="setValue()"
     />
     <!-- 使用自定义图片上传 -->
@@ -25,10 +26,18 @@
 <script setup>
 import { QuillEditor } from "@vueup/vue-quill";
 import "@vueup/vue-quill/dist/vue-quill.snow.css";
-import { reactive, onMounted, ref, toRaw, watch } from "vue";
+import { reactive, onMounted, ref, toRaw, watch, computed } from "vue";
 // import { backsite } from '@/api'
 
-const props = defineProps(["value"]);
+// const props = defineProps(["value"]);
+const props = defineProps({
+  value: String,
+  readOnly: Boolean,
+});
+const readOnly = computed(() => {
+  return props.readOnly !== undefined ? props.readOnly : false;
+});
+
 const emit = defineEmits(["updateValue"]);
 const content = ref("");
 const myQuillEditor = ref();
@@ -54,7 +63,7 @@ const data = reactive({
         [{ color: [] }, { background: [] }],
       ],
     },
-    placeholder: "请输入内容...",
+    placeholder: readOnly.value ? "" : "请输入内容...",
   },
 });
 const imgHandler = (state) => {

+ 7 - 1
src/components/process/SendPurchase.vue

@@ -747,11 +747,17 @@ watch(
   () => {
     if (
       props.queryData &&
-      (route.query.processType == 10 || route.query.processType == 20 || route.query.processType == 30)
+      (route.query.processType == 10 ||
+        route.query.processType == 20 ||
+        route.query.processType == 30)
     ) {
       for (const key in props.queryData) {
         formData.data[key] = props.queryData[key];
       }
+      const ids = formData.data.purchaseDetailList.map((x) => x.bussinessId);
+      if (formData.data.supplyId && ids.length > 0) {
+        getAuxiliaryData(formData.data.supplyId, ids);
+      }
     }
   },
   {

+ 8 - 0
src/views/connect/E-mail/mail/com/left.vue

@@ -843,36 +843,42 @@ const handleMapMailListData = (arr) => {
       if (mailMapData["inbox"].includes(jele.name)) {
         iele.mailFolderInfoListCopy.push({
           ...jele,
+          oldName: jele.name,
           name: "收件箱",
           sort: 1,
         });
       } else if (mailMapData["unread"].includes(jele.name)) {
         iele.mailFolderInfoListCopy.push({
           ...jele,
+          oldName: jele.name,
           name: "未读邮件",
           sort: 2,
         });
       } else if (mailMapData["draft"].includes(jele.name)) {
         iele.mailFolderInfoListCopy.push({
           ...jele,
+          oldName: jele.name,
           name: "草稿箱",
           sort: 3,
         });
       } else if (mailMapData["sent"].includes(jele.name)) {
         iele.mailFolderInfoListCopy.push({
           ...jele,
+          oldName: jele.name,
           name: "已发送",
           sort: 4,
         });
       } else if (mailMapData["delete"].includes(jele.name)) {
         iele.mailFolderInfoListCopy.push({
           ...jele,
+          oldName: jele.name,
           name: "已删除",
           sort: 5,
         });
       } else if (mailMapData["waste"].includes(jele.name)) {
         iele.mailFolderInfoListCopy.push({
           ...jele,
+          oldName: jele.name,
           name: "垃圾邮件",
           sort: 6,
         });
@@ -943,6 +949,8 @@ const handleOpenMenu = (item, listPageType = "10") => {
   // 10为官方文件夹以及六个外侧文件夹 20为我的文件夹  30为标签文件夹
   selectFloderId.value = item.id;
   const menu = {
+    oldName: item.oldName,
+    unReadCount: item.unreadMessageCount || 0,
     title: item.name,
     type: selectMail.value.type,
     folderId: item.id,

+ 132 - 11
src/views/connect/E-mail/mail/com/mailList.vue

@@ -1,10 +1,13 @@
 <template>
   <div>
-    <div style="padding-left: 20px; display: flex; align-items: center">
+    <div
+      style="padding-left: 20px; display: flex; align-items: center"
+      v-loading="btnLoading"
+    >
       <el-icon @click="handleRefresh" style="cursor: pointer">
         <Refresh />
       </el-icon>
-      <!-- <div class="vertical-line"></div>
+      <div class="vertical-line"></div>
       <div>
         <el-checkbox
           v-model="isCheckAll"
@@ -15,12 +18,15 @@
       </div>
       <div style="color: #666666">
         <span
-          >(共998封,其中<span style="color: #39c55a"> 未读邮件 </span
-          >6封)</span
+          >(共 {{ tableData.pagination.total }} 封,其中<span
+            style="color: #39c55a"
+          >
+            未读邮件 </span
+          >{{ unReadCount }} 封)</span
         >
       </div>
       <el-button
-        @click="handleMove"
+        @click="handleSetAllRead"
         :disabled="selectData.length === 0"
         style="margin-left: 10px"
         >全部标为已读</el-button
@@ -30,6 +36,7 @@
         placeholder="标记为"
         style="margin: 0 10px; width: 120px"
         :disabled="selectData.length === 0"
+        @change="handleSetTag"
       >
         <el-option
           v-for="item in tagData"
@@ -46,10 +53,11 @@
         style="margin-right: 10px; width: 120px"
         check-strictly
         :render-after-expand="false"
+        @change="handleSetFolder"
       />
-      <el-button @click="handleMove" :disabled="selectData.length === 0"
+      <el-button @click="handleDeleteAll" :disabled="selectData.length === 0"
         >删除</el-button
-      > -->
+      >
     </div>
     <div style="padding: 10px 15px; width: 100%">
       <el-table
@@ -59,7 +67,7 @@
         @selection-change="handleSelectionChange"
         v-loading="loading"
       >
-        <!-- <el-table-column label=" " width="40" align="center">
+        <el-table-column label=" " width="40" align="center">
           <template #default="{ row, $index }">
             <div>
               <el-checkbox
@@ -70,7 +78,7 @@
               />
             </div>
           </template>
-        </el-table-column> -->
+        </el-table-column>
         <el-table-column label="状态" width="70">
           <template #default="{ row, $index }">
             <div style="cursor: pointer" @click="handleRowClick(row, $index)">
@@ -177,6 +185,8 @@
 import byTable from "@/components/byTable/index";
 import useMailStore from "@/store/modules/mail";
 import useUserStore from "@/store/modules/user";
+import { ElMessage, ElMessageBox } from "element-plus";
+
 const { proxy } = getCurrentInstance();
 const mailStore = useMailStore();
 let loading = ref(false);
@@ -196,6 +206,7 @@ const tableData = reactive({
     total: 0,
   },
 });
+const unReadCount = computed(() => mailStore.currentMenu.unReadCount);
 const config = computed(() => {
   return [
     {
@@ -334,12 +345,24 @@ const handleSizeChange = (val) => {
 };
 const myFolderTreeData = ref([]);
 const tagData = ref([]);
+
+const handleTreeData = (arr) => {
+  for (let i = 0; i < arr.length; i++) {
+    const e = arr[i];
+    e.value = e.id;
+    if (e.children && e.children.length > 0) {
+      e.children = handleTreeData(e.children);
+    }
+  }
+  return arr;
+};
+
 const getOtherData = () => {
   setTimeout(() => {
     proxy
       .post("/myFolder/tree", { mailboxId: mailStore.selectMail.id })
       .then((res) => {
-        myFolderTreeData.value = res.map((x) => ({ ...x, value: x.id }));
+        myFolderTreeData.value = handleTreeData(res);
       });
   }, 1000);
 
@@ -355,7 +378,7 @@ const getOtherData = () => {
       });
   }, 1000);
 };
-// getOtherData();
+getOtherData();
 const isCheckAll = ref(false);
 const selectTag = ref("");
 const selectFolder = ref("");
@@ -377,6 +400,104 @@ const handleChangeCheckAll = () => {
     selectData.value = [];
   }
 };
+const btnLoading = ref(false);
+const handleSetAllRead = () => {
+  btnLoading.value = true;
+  const uidList = selectData.value.map((x) => x.id);
+  const data = {
+    folderName: mailStore.currentMenu.oldName,
+    uidList,
+    mailboxId: mailStore.selectMail.id,
+    type: mailStore.selectMail.type,
+  };
+  proxy.post("/mailService/setSeen", data).then(
+    (res) => {
+      ElMessage({
+        message: `操作成功!`,
+        type: "success",
+      });
+      btnLoading.value = false;
+    },
+    (err) => {
+      btnLoading.value = false;
+    }
+  );
+};
+
+const handleSetTag = (val) => {
+  if (!val) return;
+  btnLoading.value = true;
+  const messageIdList = selectData.value.map((x) => x.id);
+  const data = {
+    myTagId: val,
+    messageIdList,
+  };
+  proxy.post("/myTagMessage/addBath", data).then(
+    (res) => {
+      ElMessage({
+        message: `操作成功!`,
+        type: "success",
+      });
+      selectTag.value = "";
+      btnLoading.value = false;
+    },
+    (err) => {
+      btnLoading.value = false;
+    }
+  );
+};
+
+const handleSetFolder = (val) => {
+  if (!val) return;
+  btnLoading.value = true;
+  const messageIdList = selectData.value.map((x) => x.id);
+  const data = {
+    myFolderId: val,
+    messageIdList,
+  };
+  proxy.post("/myFolderMessage/addBath", data).then(
+    (res) => {
+      ElMessage({
+        message: `操作成功!`,
+        type: "success",
+      });
+      selectFolder.value = "";
+      btnLoading.value = false;
+    },
+    (err) => {
+      btnLoading.value = false;
+    }
+  );
+};
+
+const handleDeleteAll = () => {
+  ElMessageBox.confirm(`此操作将删除选中的邮件, 是否继续?`, "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    btnLoading.value = true;
+    const idList = selectData.value.map((x) => x.id);
+    const data = {
+      type: mailStore.selectMail.type,
+      idList,
+    };
+    proxy.post("/mailService/deleteBatchMail", data).then(
+      (res) => {
+        ElMessage({
+          message: `操作成功!`,
+          type: "success",
+        });
+        btnLoading.value = false;
+        selectData.value = [];
+        getList();
+      },
+      (err) => {
+        btnLoading.value = false;
+      }
+    );
+  });
+};
 
 defineExpose({
   initFn: init,

+ 118 - 3
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -32,10 +32,19 @@
       </template>
       <template #details="{ item }">
         <div>
-          <el-button type="primary" link v-if="item.expendQuantity > 0"
+          <el-button
+            type="primary"
+            link
+            v-if="item.expendQuantity > 0"
+            @click="handleClickDetails(item)"
             >查看</el-button
           >
-          <el-button type="primary" link style="color: #f54a45" v-else
+          <el-button
+            type="primary"
+            link
+            style="color: #f54a45"
+            v-else
+            @click="handleClickDetails(item)"
             >查看</el-button
           >
         </div>
@@ -215,14 +224,53 @@
         </el-timeline>
       </div>
     </el-dialog>
+
+    <el-dialog
+      title="交接单"
+      v-if="openHandover"
+      v-model="openHandover"
+      width="800"
+    >
+      <byForm
+        :formConfig="formHandoverConfig"
+        :formOption="formOption"
+        v-model="productRow.data"
+      >
+        <template #remark>
+          <div style="width: 100%">
+            <Editor
+              ref="remarkEditor"
+              :readOnly="true"
+              :value="productRow.data.remark"
+            />
+          </div>
+        </template>
+        <template #file>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="productRow.data.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              multiple
+              :on-preview="onPreviewFile"
+            >
+            </el-upload>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openHandover = false" size="large">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
-import { computed, ref } from "vue";
+import { computed, nextTick, ref } from "vue";
 import { ElMessage } from "element-plus";
+import Editor from "@/components/Editor/index.vue";
+import { async } from "@antv/x6/lib/registry/marker/async";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -326,6 +374,7 @@ const config = computed(() => {
     },
   ];
 });
+
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -592,6 +641,72 @@ const getRowClass = ({ row }) => {
   }
   return "";
 };
+const openHandover = ref(false);
+const productRow = reactive({
+  data: {
+    productName: "",
+    productModel: "",
+    remark: "",
+    fileList: [],
+  },
+});
+const formHandoverConfig = computed(() => {
+  return [
+    {
+      type: "title",
+      title: "产品信息",
+      label: "",
+    },
+    {
+      type: "input",
+      prop: "productName",
+      label: "产品名称",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "productModel",
+      label: "规格型号",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "slot",
+      slotName: "remark",
+      label: "交接单",
+    },
+    {
+      type: "slot",
+      prop: "file",
+      slotName: "file",
+      label: "附件",
+    },
+  ];
+});
+const remarkEditor = ref(null);
+const handleClickDetails = (row) => {
+  proxy
+    .post("/flowProcess/getStartData", { flowId: row.flowId })
+    .then(async (res) => {
+      const current = res.contractProductList.find(
+        (x) => x.productId === row.productId
+      );
+      productRow.data = current || {};
+      productRow.data.fileList =
+        current.fileList.map((x) => ({
+          raw: x,
+          name: x.fileName,
+          url: x.fileUrl,
+        })) || [];
+      openHandover.value = true;
+      await nextTick();
+      remarkEditor.value.changeHtml(productRow.data.remark);
+    });
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/views/purchaseManage/supplier/supplyPrice/index.vue

@@ -42,7 +42,7 @@
                 <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-number v-model="row.price" :precision="4" :controls="false" :min="1" />
+                      <el-input-number v-model="row.price" :precision="2" :controls="false" :min="1" />
                     </el-form-item>
                   </template>
                 </el-table-column>