<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form-item label="施工批次" prop="batch">
|
<el-input
|
v-model="queryParams.batch"
|
placeholder="请输入施工批次"
|
clearable
|
size="small"
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<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>
|
|
<el-table v-loading="loading" :data="constructionBatchList" highlight-current-row height="50vh"
|
@current-change="handleCurrentChange">
|
<el-table-column label="序号" type="index" align="center">
|
<template slot-scope="scope">
|
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="施工批次" align="center" prop="batch" />
|
<el-table-column label="施工周期" align="center" width="180">
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') + ' - ' + parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="负责人" align="center" prop="userId_dictText" />
|
<el-table-column label="团队成员" align="center" prop="teamMembers" />
|
<el-table-column label="备注" align="center" prop="remarks" />
|
</el-table>
|
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</div>
|
</template>
|
|
<script>
|
import { listConstructionBatch } from "@/api/oa/constructionBatch";
|
/**
|
* 高校施工批次
|
*/
|
export default {
|
name: "ConstructionBatchForm",
|
props: {
|
schoolId: {
|
type: Number,
|
default: undefined
|
}
|
},
|
data() {
|
return {
|
// 按钮loading
|
buttonLoading: false,
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 施工批次表格数据
|
constructionBatchList: [],
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
batch: undefined
|
},
|
currentRow: undefined
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
/** 查询施工批次列表 */
|
getList() {
|
this.loading = true;
|
listConstructionBatch(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
|
this.constructionBatchList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
handleCurrentChange(v) {
|
this.currentRow = v;
|
}
|
}
|
};
|
</script>
|