Parcourir la source

交接单新需求

cz il y a 1 an
Parent
commit
2c5bd8d3c9

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

@@ -5,6 +5,51 @@
         <Refresh />
       </el-icon>
       <div class="vertical-line"></div>
+      <div>
+        <el-checkbox
+          v-model="isCheckAll"
+          label="全选"
+          size="default"
+          @change="handleChangeCheckAll"
+        />
+      </div>
+      <div style="color: #666666">
+        <span
+          >(共998封,其中<span style="color: #39c55a"> 未读邮件 </span
+          >6封)</span
+        >
+      </div>
+      <el-button
+        @click="handleMove"
+        :disabled="selectData.length === 0"
+        style="margin-left: 10px"
+        >全部标为已读</el-button
+      >
+      <el-select
+        v-model="selectTag"
+        placeholder="标记为"
+        style="margin: 0 10px; width: 120px"
+        :disabled="selectData.length === 0"
+      >
+        <el-option
+          v-for="item in tagData"
+          :key="item.id"
+          :label="item.name"
+          :value="item.id"
+        />
+      </el-select>
+      <el-tree-select
+        v-model="selectFolder"
+        :data="myFolderTreeData"
+        :disabled="selectData.length === 0"
+        placeholder="移动到"
+        style="margin-right: 10px; width: 120px"
+        check-strictly
+        :render-after-expand="false"
+      />
+      <el-button @click="handleMove" :disabled="selectData.length === 0"
+        >删除</el-button
+      >
     </div>
     <div style="padding: 10px 15px; width: 100%">
       <el-table
@@ -14,7 +59,18 @@
         @selection-change="handleSelectionChange"
         v-loading="loading"
       >
-        <!-- <el-table-column type="selection" width="40" /> -->
+        <el-table-column label=" " width="40" align="center">
+          <template #default="{ row, $index }">
+            <div>
+              <el-checkbox
+                v-model="row.isCheck"
+                label=""
+                size="default"
+                @change="handleChangeCheck"
+              />
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column label="状态" width="70">
           <template #default="{ row, $index }">
             <div style="cursor: pointer" @click="handleRowClick(row, $index)">
@@ -120,11 +176,12 @@
 <script setup>
 import byTable from "@/components/byTable/index";
 import useMailStore from "@/store/modules/mail";
+import useUserStore from "@/store/modules/user";
 const { proxy } = getCurrentInstance();
 const mailStore = useMailStore();
 let loading = ref(false);
 const tableHeight = ref(0);
-tableHeight.value = window.innerHeight - 270;
+tableHeight.value = window.innerHeight - 280;
 const tableData = reactive({
   data: [],
   pagination: {
@@ -178,8 +235,11 @@ const getList = () => {
         ...tableData.pagination,
       })
       .then((res) => {
-        tableData.data = res.rows;
-        mailStore.mailDataList = res.rows;
+        tableData.data = res.rows.map((x) => ({ ...x, isCheck: false }));
+        mailStore.mailDataList = res.rows.map((x) => ({
+          ...x,
+          isCheck: false,
+        }));
         tableData.pagination.total = res.total;
         loading.value = false;
       });
@@ -192,8 +252,14 @@ const getList = () => {
         ...tableData.pagination,
       })
       .then((res) => {
-        tableData.data = res.rows;
-        mailStore.mailDataList = res.rows;
+        tableData.data = res.rows.map((x) => ({
+          ...x,
+          isCheck: false,
+        }));
+        mailStore.mailDataList = res.rows.map((x) => ({
+          ...x,
+          isCheck: false,
+        }));
         tableData.pagination.total = res.total;
         loading.value = false;
       });
@@ -206,8 +272,14 @@ const getList = () => {
         ...tableData.pagination,
       })
       .then((res) => {
-        tableData.data = res.rows;
-        mailStore.mailDataList = res.rows;
+        tableData.data = res.rows.map((x) => ({
+          ...x,
+          isCheck: false,
+        }));
+        mailStore.mailDataList = res.rows.map((x) => ({
+          ...x,
+          isCheck: false,
+        }));
         tableData.pagination.total = res.total;
         loading.value = false;
       });
@@ -254,10 +326,48 @@ const handleSizeChange = (val) => {
   tableData.pagination.pageSize = val;
   getList();
 };
+const myFolderTreeData = ref([]);
+const tagData = ref([]);
+const getOtherData = () => {
+  setTimeout(() => {
+    proxy
+      .post("/myFolder/tree", { mailboxId: mailStore.selectMail.id })
+      .then((res) => {
+        myFolderTreeData.value = res.map((x) => ({ ...x, value: x.id }));
+      });
+  }, 1000);
+
+  proxy
+    .post("/myTag/page", {
+      pageNum: 1,
+      pageSize: 9999,
+      id: useUserStore().user.userId,
+    })
+    .then((res) => {
+      tagData.value = res.rows;
+    });
+};
+getOtherData();
+const isCheckAll = ref(false);
+const selectTag = ref("");
+const selectFolder = ref("");
 const selectData = ref([]);
-const handleSelectionChange = (val) => {
-  console.log(val, "ss");
-  selectData.value = val;
+const handleChangeCheck = () => {
+  selectData.value = tableData.data.filter((x) => x.isCheck === true);
+  if (selectData.value.length === tableData.data.length) {
+    isCheckAll.value = true;
+  }
+};
+
+const handleChangeCheckAll = () => {
+  tableData.data.forEach((x) => {
+    x.isCheck = isCheckAll.value;
+  });
+  if (isCheckAll.value) {
+    selectData.value = tableData.data;
+  } else {
+    selectData.value = [];
+  }
 };
 
 defineExpose({
@@ -266,6 +376,9 @@ defineExpose({
 </script>
 
 <style lang="scss" scoped>
+// * {
+//   font-size: 12px;
+// }
 .messageImg {
   width: 18px;
   height: 18px;

+ 1 - 1
src/views/connect/E-mail/mail/index.vue

@@ -75,7 +75,7 @@ onMounted(() => {
     box-sizing: border-box;
   }
   .right {
-    flex: 1;
+    width: calc(100% - 300px);
   }
   .mail-right {
     position: absolute;

+ 59 - 19
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -205,13 +205,13 @@
             placement="top"
             v-for="(activity, index) in activities"
             :key="index"
-            :timestamp="activity.handleTime"
+            :timestamp="activity.followUpTime"
           >
             <div>
-              跟进人:{{ activity.handleUserName }}
-              <span>({{ activity.status ? "已完成" : "处理中" }})</span>
+              跟进结果:
+              <span>{{ activity.resultType ? "已处理" : "处理中" }}</span>
             </div>
-            <div style="margin-top: 5px">跟进记录: {{ activity.explain }}</div>
+            <div style="margin-top: 5px">跟进记录: {{ activity.remark }}</div>
           </el-timeline-item>
         </el-timeline>
       </div>
@@ -240,11 +240,14 @@ const config = computed(() => {
   return [
     {
       type: "selection",
+      attrs: {
+        checkAtt: "isCheck",
+      },
     },
     {
       attrs: {
         label: "归属公司",
-        prop: "aa",
+        prop: "corporationName",
       },
     },
     {
@@ -330,8 +333,10 @@ const getList = async (req) => {
   proxy
     .post("/contractProduct/page", sourceList.value.pagination)
     .then((message) => {
-      message.rows[0].expendQuantity = -1;
-      sourceList.value.data = message.rows;
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        isCheck: true,
+      }));
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
         loading.value = false;
@@ -411,14 +416,23 @@ const formConfigOne = computed(() => {
   return [
     {
       type: "select",
-      prop: "warehouseId",
+      prop: "resultType",
       label: "跟进结果",
-      data: [],
+      data: [
+        {
+          label: "处理中",
+          value: "0",
+        },
+        {
+          label: "已处理",
+          value: "1",
+        },
+      ],
     },
     {
       type: "date",
       itemType: "datetime",
-      prop: "warehouseId",
+      prop: "followUpTime",
       label: "跟进时间",
       format: "YYYY-MM-DD HH:mm:ss",
     },
@@ -430,21 +444,26 @@ const formConfigOne = computed(() => {
     },
   ];
 });
+
 const rulesOne = ref({
-  quantity: [{ required: true, message: "请选择跟进结果", trigger: "change" }],
-  time: [{ required: true, message: "请选择跟进时间", trigger: "change" }],
+  resultType: [
+    { required: true, message: "请选择跟进结果", trigger: "change" },
+  ],
+  followUpTime: [
+    { required: true, message: "请选择跟进时间", trigger: "change" },
+  ],
   remark: [{ required: true, message: "请输入跟进记录", trigger: "blur" }],
 });
 
 const activities = ref([]);
 const lookRecords = (row) => {
   proxy
-    .post("/abnormalDetails/page", {
-      abnormalInfoId: row.id,
+    .post("/contractProductFollowUp/list", {
+      contractProductId: row.productId,
     })
     .then((res) => {
-      if (res.rows.length > 0) {
-        activities.value = res.rows;
+      if (res.length > 0) {
+        activities.value = res;
         dialogVisibleTwo.value = true;
       } else
         return ElMessage({
@@ -453,15 +472,17 @@ const lookRecords = (row) => {
         });
     });
 };
-const handleFollow = () => {
-  formData.dataOne = {};
+const handleFollow = (row) => {
+  formData.dataOne = {
+    contractProductId: row.productId,
+  };
   dialogVisibleOne.value = true;
 };
 
 const submitFormOne = () => {
   submitOne.value.handleSubmit(() => {
     loadingDialog.value = true;
-    proxy.post("/workOrder/addBatch", formData.data.list).then(
+    proxy.post("/contractProductFollowUp/add", formData.dataOne).then(
       () => {
         ElMessage({
           message: "提交成功",
@@ -512,6 +533,22 @@ const transferToProduction = (row) => {
   }
   dialogVisible.value = true;
 };
+// 监听选中的值,并动态更新是否可选中
+watch(selectData, (newVal, oldVal) => {
+  if (newVal.length == 0) {
+    sourceList.value.data.forEach((x) => {
+      x.isCheck = true;
+    });
+  } else if (newVal.length == 1) {
+    const current = newVal[0];
+    sourceList.value.data.forEach((x) => {
+      if (x.corporationId !== current.corporationId) {
+        x.isCheck = false;
+      }
+    });
+  }
+});
+
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (!(formData.data.list && formData.data.list.length > 0)) {
@@ -553,6 +590,9 @@ const getRowClass = ({ row }) => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+:deep(.el-table__header-wrapper .el-checkbox) {
+  display: none;
+}
 </style>
 <style >
 .redClass {

+ 26 - 2
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -186,11 +186,14 @@ const config = computed(() => {
   return [
     {
       type: "selection",
+      attrs: {
+        checkAtt: "isCheck",
+      },
     },
     {
       attrs: {
         label: "归属公司",
-        prop: "subscribeCode",
+        prop: "corporationName",
       },
     },
     {
@@ -359,7 +362,10 @@ const getList = async (req) => {
     .post("/subscribeDetail/page", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
-      sourceList.value.data = message.rows;
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        isCheck: true,
+      }));
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
         loading.value = false;
@@ -464,6 +470,21 @@ const getDict = () => {
   });
 };
 getDict();
+// 监听选中的值,并动态更新是否可选中
+watch(selectData, (newVal, oldVal) => {
+  if (newVal.length == 0) {
+    sourceList.value.data.forEach((x) => {
+      x.isCheck = true;
+    });
+  } else if (newVal.length == 1) {
+    const current = newVal[0];
+    sourceList.value.data.forEach((x) => {
+      if (x.corporationId !== current.corporationId) {
+        x.isCheck = false;
+      }
+    });
+  }
+});
 
 const start = () => {
   if (selectData.value.length > 0) {
@@ -489,4 +510,7 @@ const start = () => {
 .tenant {
   padding: 20px;
 }
+:deep(.el-table__header-wrapper .el-checkbox) {
+  display: none;
+}
 </style>