Commit 80cd3d9e authored by p-wanping.song's avatar p-wanping.song

修改筛选所属区域类型

parent 4d8ee4ad
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input <el-input
v-model="queryParams.projectName" v-model="queryParams.projectName"
...@@ -9,7 +16,7 @@ ...@@ -9,7 +16,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="楼宇名称" prop="name"> <el-form-item label="楼宇名称" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
...@@ -19,11 +26,12 @@ ...@@ -19,11 +26,12 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId">
<el-input <treeselect
v-model="queryParams.deptId" v-model="queryParams.deptId"
placeholder="请输入所属区域" :options="deptOptions"
clearable :show-count="true"
@keyup.enter.native="handleQuery" placeholder="请选择所属区域"
style="width: 250px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="用途" prop="useto"> <el-form-item label="用途" prop="useto">
...@@ -43,7 +51,11 @@ ...@@ -43,7 +51,11 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
>
<el-option <el-option
v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable"
:key="dict.value" :key="dict.value"
...@@ -53,8 +65,16 @@ ...@@ -53,8 +65,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -67,7 +87,8 @@ ...@@ -67,7 +87,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:ledgerBuilding:add']" v-hasPermi="['system:ledgerBuilding:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -78,7 +99,8 @@ ...@@ -78,7 +99,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:ledgerBuilding:edit']" v-hasPermi="['system:ledgerBuilding:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -89,7 +111,8 @@ ...@@ -89,7 +111,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:ledgerBuilding:remove']" v-hasPermi="['system:ledgerBuilding:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -99,12 +122,20 @@ ...@@ -99,12 +122,20 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:ledgerBuilding:export']" v-hasPermi="['system:ledgerBuilding:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="buildingList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="buildingList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center"> <el-table-column label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -121,10 +152,17 @@ ...@@ -121,10 +152,17 @@
<el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="详细地址" align="center" prop="address" />
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> <dict-tag
:options="dict.type.sys_normal_disable"
:value="scope.row.status"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
...@@ -132,20 +170,22 @@ ...@@ -132,20 +170,22 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:ledgerBuilding:edit']" v-hasPermi="['system:ledgerBuilding:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:ledgerBuilding:remove']" v-hasPermi="['system:ledgerBuilding:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
...@@ -168,7 +208,10 @@ ...@@ -168,7 +208,10 @@
<el-input v-model="form.groundFloor" placeholder="请输入地上楼层数" /> <el-input v-model="form.groundFloor" placeholder="请输入地上楼层数" />
</el-form-item> </el-form-item>
<el-form-item label="地下楼层数(层)" prop="undergroundFloor"> <el-form-item label="地下楼层数(层)" prop="undergroundFloor">
<el-input v-model="form.undergroundFloor" placeholder="请输入地下楼层数" /> <el-input
v-model="form.undergroundFloor"
placeholder="请输入地下楼层数"
/>
</el-form-item> </el-form-item>
<el-form-item label="用途" prop="useto"> <el-form-item label="用途" prop="useto">
<el-input v-model="form.useto" placeholder="请输入用途" /> <el-input v-model="form.useto" placeholder="请输入用途" />
...@@ -186,7 +229,6 @@ ...@@ -186,7 +229,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
...@@ -197,11 +239,22 @@ ...@@ -197,11 +239,22 @@
</template> </template>
<script> <script>
import { listBuilding, getBuilding, delBuilding, addBuilding, updateBuilding } from "@/api/ledger/building"; import {
listBuilding,
getBuilding,
delBuilding,
addBuilding,
updateBuilding,
} from "@/api/ledger/building";
import { deptTreeSelect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "Building", name: "Building",
dicts: ['sys_normal_disable', 'data_source'], dicts: ["sys_normal_disable", "data_source"],
components: {
Treeselect,
},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -240,18 +293,25 @@ export default { ...@@ -240,18 +293,25 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {},
} deptOptions: [],
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDeptTree();
}, },
methods: { methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
/** 查询基础数据-楼宇列表 */ /** 查询基础数据-楼宇列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listBuilding(this.queryParams).then(response => { listBuilding(this.queryParams).then((response) => {
this.buildingList = response.rows; this.buildingList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -280,7 +340,7 @@ export default { ...@@ -280,7 +340,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -296,9 +356,9 @@ export default { ...@@ -296,9 +356,9 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
...@@ -309,8 +369,8 @@ export default { ...@@ -309,8 +369,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getBuilding(id).then(response => { getBuilding(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改基础数据-楼宇"; this.title = "修改基础数据-楼宇";
...@@ -318,16 +378,16 @@ export default { ...@@ -318,16 +378,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateBuilding(this.form).then(response => { updateBuilding(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addBuilding(this.form).then(response => { addBuilding(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -339,19 +399,27 @@ export default { ...@@ -339,19 +399,27 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除基础数据-楼宇编号为"' + ids + '"的数据项?').then(function() { this.$modal
return delBuilding(ids); .confirm('是否确认删除基础数据-楼宇编号为"' + ids + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return delBuilding(ids);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('/system/ledger/building/export', { this.download(
...this.queryParams "/system/ledger/building/export",
}, `building_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`building_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="name"> <el-form-item label="项目名称" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
...@@ -18,7 +25,11 @@ ...@@ -18,7 +25,11 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="项目业态" prop="business"> <el-form-item label="项目业态" prop="business">
<el-select v-model="queryParams.business" placeholder="请选择项目业态" clearable> <el-select
v-model="queryParams.business"
placeholder="请选择项目业态"
clearable
>
<el-option <el-option
v-for="dict in dict.type.risk_project_business" v-for="dict in dict.type.risk_project_business"
:key="dict.value" :key="dict.value"
...@@ -29,11 +40,12 @@ ...@@ -29,11 +40,12 @@
</el-form-item> </el-form-item>
<el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId">
<el-input <treeselect
v-model="queryParams.deptId" v-model="queryParams.deptId"
placeholder="请输入所属区域" :options="deptOptions"
clearable :show-count="true"
@keyup.enter.native="handleQuery" placeholder="请选择所属区域"
style="width: 250px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="所在城市" prop="city"> <el-form-item label="所在城市" prop="city">
...@@ -53,7 +65,11 @@ ...@@ -53,7 +65,11 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
>
<el-option <el-option
v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable"
:key="dict.value" :key="dict.value"
...@@ -63,8 +79,16 @@ ...@@ -63,8 +79,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -77,7 +101,8 @@ ...@@ -77,7 +101,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:ledgerProject:add']" v-hasPermi="['system:ledgerProject:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -88,7 +113,8 @@ ...@@ -88,7 +113,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:ledgerProject:edit']" v-hasPermi="['system:ledgerProject:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -99,7 +125,8 @@ ...@@ -99,7 +125,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:ledgerProject:remove']" v-hasPermi="['system:ledgerProject:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -109,18 +136,26 @@ ...@@ -109,18 +136,26 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:ledgerProject:export']" v-hasPermi="['system:ledgerProject:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="projectList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center"> <el-table-column label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="项目名称" align="center" prop="name" /> <el-table-column label="项目名称" align="center" prop="name" />
<el-table-column label="项目类型" align="center" prop="type" /> <el-table-column label="项目类型" align="center" prop="type" />
<el-table-column label="项目业态" align="center" prop="business" /> <el-table-column label="项目业态" align="center" prop="business" />
...@@ -129,10 +164,17 @@ ...@@ -129,10 +164,17 @@
<el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="详细地址" align="center" prop="address" />
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> <dict-tag
:options="dict.type.sys_normal_disable"
:value="scope.row.status"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
...@@ -140,20 +182,22 @@ ...@@ -140,20 +182,22 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:ledgerProject:edit']" v-hasPermi="['system:ledgerProject:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:ledgerProject:remove']" v-hasPermi="['system:ledgerProject:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
...@@ -180,7 +224,12 @@ ...@@ -180,7 +224,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId">
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属区域" /> <treeselect
v-model="form.deptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择所属区域"
/>
</el-form-item> </el-form-item>
<el-form-item label="所在城市" prop="city"> <el-form-item label="所在城市" prop="city">
<el-input v-model="form.city" placeholder="请输入所在城市" /> <el-input v-model="form.city" placeholder="请输入所在城市" />
...@@ -198,7 +247,6 @@ ...@@ -198,7 +247,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
...@@ -209,14 +257,29 @@ ...@@ -209,14 +257,29 @@
</template> </template>
<script> <script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user"; import {
import { listProject, getProject, delProject, addProject, updateProject } from "@/api/ledger/project/"; listUser,
getUser,
delUser,
addUser,
updateUser,
resetUserPwd,
changeUserStatus,
deptTreeSelect,
} from "@/api/system/user";
import {
listProject,
getProject,
delProject,
addProject,
updateProject,
} from "@/api/ledger/project/";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "Project", name: "Project",
dicts: ['sys_normal_disable', 'data_source', 'risk_project_business'], dicts: ["sys_normal_disable", "data_source", "risk_project_business"],
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
...@@ -255,15 +318,14 @@ export default { ...@@ -255,15 +318,14 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {},
}
}; };
}, },
watch: { watch: {
// 根据名称筛选部门树 // 根据名称筛选部门树
deptName(val) { deptName(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
} },
}, },
created() { created() {
this.getList(); this.getList();
...@@ -273,7 +335,7 @@ export default { ...@@ -273,7 +335,7 @@ export default {
/** 查询基础数据-项目列表 */ /** 查询基础数据-项目列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listProject(this.queryParams).then(response => { listProject(this.queryParams).then((response) => {
this.projectList = response.rows; this.projectList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -281,7 +343,7 @@ export default { ...@@ -281,7 +343,7 @@ export default {
}, },
/** 查询部门下拉树结构 */ /** 查询部门下拉树结构 */
getDeptTree() { getDeptTree() {
deptTreeSelect().then(response => { deptTreeSelect().then((response) => {
this.deptOptions = response.data; this.deptOptions = response.data;
}); });
}, },
...@@ -315,7 +377,7 @@ export default { ...@@ -315,7 +377,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -331,9 +393,9 @@ export default { ...@@ -331,9 +393,9 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
...@@ -344,8 +406,8 @@ export default { ...@@ -344,8 +406,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getProject(id).then(response => { getProject(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改基础数据-项目"; this.title = "修改基础数据-项目";
...@@ -353,16 +415,16 @@ export default { ...@@ -353,16 +415,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateProject(this.form).then(response => { updateProject(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addProject(this.form).then(response => { addProject(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -374,19 +436,27 @@ export default { ...@@ -374,19 +436,27 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除基础数据-项目编号为"' + ids + '"的数据项?').then(function() { this.$modal
return delProject(ids); .confirm('是否确认删除基础数据-项目编号为"' + ids + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return delProject(ids);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('system/ledger/project/export', { this.download(
...this.queryParams "system/ledger/project/export",
}, `project_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`project_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment