feat:计划管理计划借调管理页面导出功能

This commit is contained in:
jackal 2024-04-12 14:25:41 +08:00
parent 3fea17aa5e
commit 02d80977fe
2 changed files with 78 additions and 41 deletions

View File

@ -1,9 +1,22 @@
<template>
<div class="app-container" id="plan">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable maxlength="50" style="width: 240px"
@keyup.enter.native="handleQuery" />
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
@ -17,20 +30,35 @@
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini">导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table v-loading="loading" :data="planList">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="基层单位" align="center" prop="lenderCompany" :show-overflow-tooltip="true" />
<el-table-column
label="基层单位"
align="center"
prop="lenderCompany"
:show-overflow-tooltip="true"
/>
<el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column
label="规格型号"
align="center"
prop="typeModelName"
:show-overflow-tooltip="true"
/>
<el-table-column label="单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="计划数" align="center" prop="lenderOrigPlanNum" :show-overflow-tooltip="true" />
<el-table-column
label="计划数"
align="center"
prop="lenderOrigPlanNum"
:show-overflow-tooltip="true"
/>
<el-table-column label="计划单价" align="center" prop="planPrice" :show-overflow-tooltip="true" />
<el-table-column label="计划总价" align="center" prop="planCost" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
@ -41,23 +69,26 @@
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['store:labelType:remove']">删除</el-button>
</template>
</el-table-column> -->
</el-table-column>-->
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listType } from "@/api/system/dict/type";
import { getPlanList } from "@/api/store/newBuy";
import { getPlanList, planExport } from "@/api/store/newBuy";
export default {
name: "Plan",
dicts: ['sys_normal_disable'],
dicts: ["sys_normal_disable"],
data() {
return {
//
@ -80,7 +111,7 @@ export default {
pageSize: 10,
dictType: undefined,
status: undefined
},
}
};
},
created() {
@ -94,8 +125,7 @@ export default {
this.planList = response.rows;
this.total = response.total;
this.loading = false;
}
);
});
},
/** 搜索按钮操作 */
handleQuery() {
@ -110,20 +140,19 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.$tab.closeOpenPage({
path: "/store/plan/planAdd",
path: "/store/plan/planAdd"
});
// console.log(this.$router);
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item)
this.single = selection.length != 1
this.multiple = !selection.length
},
// handleSelectionChange(selection) {
// this.ids = selection.map(item => item);
// this.single = selection.length != 1;
// this.multiple = !selection.length;
// },
/** 修改按钮操作 */
handleUpdate(row) {
let query = { taskId: row.taskId }
let query = { taskId: row.taskId };
this.$tab.closeOpenPage({ path: "/store/plan/planAdd", query });
},
@ -139,10 +168,14 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
},
this.download(
"/material/planManagement/export",
{
...this.queryParams
},
`type_${new Date().getTime()}.xlsx`
);
}
}
};
</script>

View File

@ -50,8 +50,8 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table v-loading="loading" :data="typeList">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
@ -396,11 +396,11 @@ export default {
this.getunitInfoAll();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
// handleSelectionChange(selection) {
// this.ids = selection.map(item => item);
// this.single = selection.length != 1;
// this.multiple = !selection.length;
// },
/** 借调单位数据 */
getunitInfoAll() {
getunitInfoAll().then(response => {
@ -492,9 +492,13 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
this.download(
"/material/planManagement/exportManage",
{
...this.queryParams
},
`type_${new Date().getTime()}.xlsx`
);
}
}
};