Pārlūkot izejas kodu

Merge branch 'master' into 测试

lxf 1 gadu atpakaļ
vecāks
revīzija
998ae365f7

+ 16 - 6
src/views/group/finance/check-bill/ExcelFile.vue

@@ -7,12 +7,6 @@
       :loading="loading"
       :searchConfig="searchConfig"
       highlight-current-row
-      :action-list="[
-        // {
-        //   text: '刷新',
-        //   action: () => getList(),
-        // },
-      ]"
       @get-list="getList">
     </byTable>
   </div>
@@ -155,6 +149,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy.post("/excelGenerateLog/page", sourceList.value.pagination).then((res) => {
+    console.log(res.rows);
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
@@ -189,6 +184,21 @@ const clickDelete = (row) => {
     })
     .catch(() => {});
 };
+const timer = ref(null);
+const startTimer = () => {
+  timer.value = setInterval(() => {
+    if (sourceList.value.data && sourceList.value.data.length > 0) {
+      let list = sourceList.value.data.filter((item) => [1, 2, 3].includes(item.status));
+      if (list && list.length > 0) {
+        getList();
+      }
+    }
+  }, 5000);
+};
+startTimer();
+onBeforeUnmount(() => {
+  clearInterval(timer.value); // 清除定时器
+});
 </script>
 
 <style lang="scss" scoped></style>

+ 27 - 1
src/views/group/order/management/index.vue

@@ -420,12 +420,25 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 240,
+        width: 180,
         align: "center",
         fixed: "right",
       },
       renderHTML(row) {
         return [
+          !props.selectStatus && row.status == 40
+            ? {
+                attrs: {
+                  label: "导出",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  deriveExcel(row);
+                },
+              }
+            : {},
           {
             attrs: {
               label: "修改包装配置",
@@ -786,6 +799,19 @@ const clickCancel = (status) => {
     getList();
   }
 };
+const deriveExcel = (row) => {
+  ElMessageBox.confirm("你是否确认此操作", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.postFile("/orderInfo/orderExportExcel", { id: row.id }).then((res) => {
+        proxy.downloadFile(res, row.code + ".xlsx");
+      });
+    })
+    .catch(() => {});
+};
 const formData = reactive({
   data: {
     orderPackageBomList: [],