cz 1 ano atrás
pai
commit
bb9d7f375c

+ 12 - 0
src/directive/common/disabledBtn.js

@@ -0,0 +1,12 @@
+export default {
+  mounted(el, binding, vnode) {
+    el.addEventListener('click', () => {
+      el.classList.add('is-disabled');
+      el.disabled = true;
+      setTimeout(() => {
+        el.disabled = false;
+        el.classList.remove('is-disabled');
+      }, 1500);
+    })
+  }
+}

+ 3 - 1
src/directive/index.js

@@ -1,11 +1,13 @@
 import hasRole from './permission/hasRole'
 import hasPermi from './permission/hasPermi'
 import copyText from './common/copyText'
+import disabledBtn from './common/disabledBtn'
 import mousewheel from './permission/mousewheel'
 
-export default function directive(app){
+export default function directive(app) {
   app.directive('hasRole', hasRole)
   app.directive('hasPermi', hasPermi)
   app.directive('copyText', copyText)
+  app.directive('disabledBtn', disabledBtn)
   app.directive('mousewheel', mousewheel)
 }

+ 100 - 4
src/views/EHSD/saleContract/exportTracking/index.vue

@@ -21,7 +21,9 @@
 
       <template #customer="{ item }">
         <div style="width: 100%">
-          <span class="public-class">{{ item.buyCorporationName }}</span>
+          <span class="public-class" @click="clickCorporationName(item)">{{
+            item.buyCorporationName
+          }}</span>
         </div>
       </template>
 
@@ -225,9 +227,46 @@
       v-model="openRecords"
       width="600"
     >
-      <el-button type="primary" @click="handleClickAddRecord()"
-        >添加记录</el-button
-      >
+      <div style="padding-left: 50px; margin-bottom: 20px">
+        <el-button type="primary" @click="handleClickAddRecord()"
+          >添加记录</el-button
+        >
+      </div>
+      <el-timeline>
+        <el-timeline-item
+          v-for="(activity, index) in recordsData"
+          :key="index"
+          :timestamp="activity.timestamp"
+        >
+          <div
+            style="
+              width: 100%;
+              display: flex;
+              justify-content: space-between;
+              color: #bfb9b9;
+            "
+          >
+            <div>{{ activity.documentaryTime }}</div>
+            <div>{{ activity.userName }}</div>
+          </div>
+          <div style="width: 100%; margin-top: 8px">
+            {{ activity.documentaryRemark }}
+          </div>
+          <div
+            style="width: 100%; margin-top: 8px"
+            v-if="activity.fileList && activity.fileList.length > 0"
+          >
+            <div v-for="(item, index) in activity.fileList" :key="index">
+              <div
+                style="cursor: pointer; color: #409eff"
+                @click="openFile(item)"
+              >
+                {{ item.fileName }}
+              </div>
+            </div>
+          </div>
+        </el-timeline-item>
+      </el-timeline>
 
       <template #footer>
         <el-button @click="openRecords = false" size="large">关 闭</el-button>
@@ -568,11 +607,23 @@ const formLoading = ref(false);
 const openRemarks = ref(false);
 const remarksForm = ref(null);
 const handleClickLookRemarks = (row) => {
+  let id = row.id;
   formData.remarksFormData = {
     id: row.id,
     remarkFileList: [],
     documentaryRemark: row.documentaryRemark,
   };
+  proxy
+    .post("/fileInfo/getList", {
+      businessIdList: [id],
+    })
+    .then((fileObj) => {
+      if (fileObj[id] && fileObj[id].length > 0) {
+        formData.filesFormData.fileList = fileObj[id]
+          .filter((x) => x.businessType === "30")
+          .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
+      }
+    });
   openRemarks.value = true;
 };
 const submitRemarks = () => {
@@ -664,8 +715,31 @@ const getRecordsData = () => {
     })
     .then((res) => {
       recordsData.value = res.rows;
+      const idList = recordsData.value.map((x) => x.id);
+      // 请求文件数据并回显
+      if (idList.length > 0) {
+        proxy
+          .post("/fileInfo/getList", {
+            businessIdList: idList,
+          })
+          .then((fileObj) => {
+            if (fileObj) {
+              for (let i = 0; i < recordsData.value.length; i++) {
+                const e = recordsData.value[i];
+                for (const key in fileObj) {
+                  if (e.id === key) {
+                    e.fileList = fileObj[key];
+                  }
+                }
+              }
+            }
+          });
+      }
     });
 };
+const openFile = (item) => {
+  window.open(item.fileUrl, "_blank");
+};
 const handleClickLook = (row, purchase, node) => {
   contractData.value = row;
   purchaseData.value = purchase;
@@ -747,6 +821,28 @@ const handleClickLookContractFile = (row, flag) => {
       }
     });
 };
+
+const openDetails = (row) => {
+  // currentContractId.value = row.id;
+  // openDetailsDialog.value = true;
+  // 新页面打开方式
+  const page = proxy.$router.resolve({
+    name: "contractDetails",
+    query: {
+      currentContractId: row.id,
+    },
+  });
+  window.open(page.href, "_blank");
+};
+
+const clickCorporationName = (row) => {
+  proxy.$router.push({
+    name: "Portrait",
+    query: {
+      id: row.buyCorporationId,
+    },
+  });
+};
 </script>
 
 <style lang="scss" scoped>