zhangwei
1 天以前 309b5a2eb4a99f20b2dcceca41c7ed1275bcc6ae
src/views/item/index.vue
@@ -2,15 +2,16 @@
import { ref, reactive, onMounted } from "vue";
import { ElMessageBox, ElMessage } from "element-plus";
// import { downloadStreamFile } from "@/utils/download";
import { useProcurementComplaintApi } from "/@/api/fb_p_complaints/procurementComplaint";
import editDialog from "/@/views/fb_p_complaints/procurementComplaint/component/editDialog.vue";
import printDialog from "/@/views/system/print/component/hiprint/preview.vue";
// import { useProcurementComplaintApi } from "/@/api/fb_p_complaints/procurementComplaint";
import { shouyeOrder } from "@/api/item/index";
// import editDialog from "/@/views/fb_p_complaints/procurementComplaint/component/editDialog.vue";
// import printDialog from "/@/views/system/print/component/hiprint/preview.vue";
import ModifyRecord from "/@/components/table/modifyRecord.vue";
import ImportData from "/@/components/table/importData.vue";
import commonFunction from "@/utils/commonFunction";
// import ImportData from "/@/components/table/importData.vue";
// import commonFunction from "@/utils/commonFunction";
const { dateFormatYMD } = commonFunction();
const procurementComplaintApi = useProcurementComplaintApi();
// const { dateFormatYMD } = commonFunction();
// const procurementComplaintApi = useProcurementComplaintApi();
const printDialogRef = ref();
const editDialogRef = ref();
const importDataRef = ref();
@@ -34,15 +35,19 @@
});
// 页面加载时
onMounted(async () => {});
onMounted(async () => {
  handleQuery();
});
// 查询操作
const handleQuery = async (params: any = {}) => {
  state.tableLoading = true;
  state.tableParams = Object.assign(state.tableParams, params);
  const result = await procurementComplaintApi
    .page(Object.assign(state.tableQueryParams, state.tableParams))
    .then(res => res.data.result);
  const result = await shouyeOrder();
  console.log(result);
  // .page(Object.assign(state.tableQueryParams, state.tableParams))
  // .then(res => res.data.result);
  state.tableParams.total = result?.total;
  state.tableData = result?.items ?? [];
  state.tableLoading = false;
@@ -91,46 +96,6 @@
    })
    .catch(() => {});
};
// 导出数据
const exportProcurementComplaintCommand = async (command: string) => {
  try {
    state.exportLoading = true;
    if (command === "select") {
      const params = Object.assign(
        {},
        state.tableQueryParams,
        state.tableParams,
        { selectKeyList: state.selectData.map(u => u.id) }
      );
      await procurementComplaintApi
        .exportData(params)
        .then(res => downloadStreamFile(res));
    } else if (command === "current") {
      const params = Object.assign(
        {},
        state.tableQueryParams,
        state.tableParams
      );
      await procurementComplaintApi
        .exportData(params)
        .then(res => downloadStreamFile(res));
    } else if (command === "all") {
      const params = Object.assign(
        {},
        state.tableQueryParams,
        state.tableParams,
        { page: 1, pageSize: 99999999 }
      );
      await procurementComplaintApi
        .exportData(params)
        .then(res => downloadStreamFile(res));
    }
  } finally {
    state.exportLoading = false;
  }
};
handleQuery();
</script>
<template>
@@ -304,7 +269,7 @@
                <el-button
                  v-reclick="1000"
                  type="primary"
                  icon="ele-Search"
                  icon="Search"
                  @click="handleQuery"
                >
                  查询
@@ -315,14 +280,14 @@
                >
                  重置
                </el-button>
                <el-button
                <!-- <el-button
                  v-if="!state.showAdvanceQueryUI"
                  icon="ele-ZoomIn"
                  style="margin-left: 5px"
                  @click="() => (state.showAdvanceQueryUI = true)"
                >
                  高级查询
                </el-button>
                </el-button> -->
                <el-button
                  v-if="state.showAdvanceQueryUI"
                  icon="ele-ZoomOut"
@@ -334,7 +299,7 @@
                <el-button
                  type="danger"
                  style="margin-left: 5px"
                  icon="ele-Delete"
                  icon="Delete"
                  :disabled="state.selectData.length == 0"
                  @click="batchDelProcurementComplaint"
                >
@@ -396,7 +361,7 @@
          sortable
        >
          <template #default="{ row }">
            <span>{{ dateFormatYMD(null, null, row.decisionDate) }}</span>
            <span>{{ row.decisionDate }}</span>
          </template>
        </el-table-column>
        <el-table-column
@@ -482,12 +447,7 @@
        @size-change="(val: any) => handleQuery({ pageSize: val })"
        @current-change="(val: any) => handleQuery({ page: val })"
      />
      <ImportData
        ref="importDataRef"
        :import="procurementComplaintApi.importData"
        :download="procurementComplaintApi.downloadTemplate"
        @refresh="handleQuery"
      />
      <printDialog
        ref="printDialogRef"
        :title="'打印政府采购投诉数据处理'"