gaoluyang
4 天以前 84e3953ec23a393fdfdadb21463ed502a494e27f
采购管理-添加导出功能
已修改3个文件
59 ■■■■ 文件已修改
src/views/procurementManagement/invoiceEntry/index.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/paymentEntry/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/paymentHistory/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/invoiceEntry/index.vue
@@ -45,10 +45,10 @@
      <div class="actions">
        <div></div>
        <div>
          <el-button @click="handleExport" style="margin-right: 10px">导出</el-button>
          <el-button type="primary" @click="handleAdd('add')">
            新增登记
          </el-button>
<!--          <el-button @click="handleOut">导出</el-button>-->
<!--          <el-button type="danger" plain @click="handleDelete">删除</el-button>-->
        </div>
      </div>
@@ -92,7 +92,7 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import {delRegistration, gePurchaseListPage} from "@/api/procurementManagement/invoiceEntry.js";
import { nextTick, onMounted, getCurrentInstance } from "vue";
import { nextTick, onMounted, getCurrentInstance, ref } from "vue";
import ExpandTable from "./components/ExpandTable.vue";
import Modal from "./components/Modal.vue";
import {ElMessageBox} from "element-plus";
@@ -223,6 +223,22 @@
            proxy.$modal.msg("已取消");
        });
};
// 导出采购台账
const handleExport = () => {
    ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning",
    })
        .then(() => {
            proxy.download("/purchase/ledger/exportOne", {}, "来票登记.xlsx");
        })
        .catch(() => {
            proxy.$modal.msg("已取消");
        });
};
// 删除
const handleDelete = () => {
    let ids = [];
src/views/procurementManagement/paymentEntry/index.vue
@@ -27,6 +27,7 @@
          </el-col>
          <el-col :span="4">
            <el-form-item style="float: right; margin-right: unset">
              <el-button @click="handleExport" style="margin-right: 10px">导出</el-button>
              <el-button type="primary" @click="openForm('add')">
                新增付款
              </el-button>
@@ -269,7 +270,7 @@
</template>
<script setup>
import { ref } from "vue";
import { ref, reactive, toRefs, getCurrentInstance, nextTick, onMounted } from "vue";
import { Search } from "@element-plus/icons-vue";
import { ElMessageBox } from "element-plus";
import useUserStore from "@/store/modules/user.js";
@@ -567,7 +568,25 @@
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
// 导出
const handleExport = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      proxy.download("/purchase/registration/exportOne", { ...searchForm, ...page }, "付款登记.xlsx");
    })
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
};
onMounted(() => {
getList();
});
</script>
<style scoped lang="scss">
src/views/procurementManagement/paymentHistory/index.vue
@@ -32,6 +32,7 @@
        >
          搜索
        </el-button>
        <el-button @click="handleExport">导出</el-button>
      </el-form-item>
    </el-form>
    <div class="table_list">
@@ -53,7 +54,7 @@
</template>
<script setup>
import { ref } from "vue";
import { ref, reactive, getCurrentInstance, onMounted } from "vue";
import { Search } from "@element-plus/icons-vue";
import { paymentHistoryListPage } from "@/api/procurementManagement/paymentEntry.js";
import useFormData from "@/hooks/useFormData";
@@ -106,12 +107,9 @@
const total = ref(0);
const { form: searchForm } = useFormData({
  searchText: undefined,
  paymentDate: [
    dayjs().startOf("month").format("YYYY-MM-DD"),
    dayjs().endOf("month").format("YYYY-MM-DD"),
  ],
  paymentDateStart: dayjs().startOf("month").format("YYYY-MM-DD"),
  paymentDateEnd: dayjs().endOf("month").format("YYYY-MM-DD"),
  paymentDate: [],
  paymentDateStart: undefined,
  paymentDateEnd: undefined,
});
// 查询列表
@@ -161,6 +159,12 @@
  getList();
};
// 导出
const handleExport = () => {
  const { paymentDate, ...rest } = searchForm;
  proxy.download("/purchase/paymentRegistration/export", { ...rest, ...page }, "付款流水.xlsx");
};
onMounted(() => {
  getList();
});