|
@@ -1,54 +1,193 @@
|
|
|
<template>
|
|
<template>
|
|
|
<el-card class="tjm_card_style_custom">
|
|
<el-card class="tjm_card_style_custom">
|
|
|
|
|
+ <div class="tjm_card_title">条件检索</div>
|
|
|
|
|
+ <div class="tjm_card_select">
|
|
|
|
|
+ <el-scrollbar>
|
|
|
|
|
+ <el-form class="tjm_card_select_left" :model="params" label-width="80px" label-position="left">
|
|
|
|
|
+ <el-row :gutter="15">
|
|
|
|
|
+ <el-col :lg="8" :md="12" :xs="24">
|
|
|
|
|
+ <el-form-item label="所属部门">
|
|
|
|
|
+ <el-tree-select v-model="deptQuery.modelValue" :data="deptQuery.data" :props="deptQuery.props" check-strictly filterable clearable placeholder="请选择所属部门" @node-click="nodeClick"></el-tree-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <!-- <el-col :lg="8" :md="12" :xs="24">
|
|
|
|
|
+ <el-form-item label="填报人">
|
|
|
|
|
+ <el-input v-model="params.createName" clearable placeholder="请输入填报人"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col> -->
|
|
|
|
|
+ <el-col :lg="8" :md="12" :xs="24">
|
|
|
|
|
+ <el-form-item label="项目名称">
|
|
|
|
|
+ <el-input v-model="params.name" clearable placeholder="请输入项目名称"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :lg="12" :md="16" :xs="24" class="query-date-col">
|
|
|
|
|
+ <el-form-item label="填报日期">
|
|
|
|
|
+ <el-date-picker v-model="createMonth" type="month" :clearable="false" value-format="YYYY-MM" placeholder="请选择填报月份" @change="monthChange"></el-date-picker>
|
|
|
|
|
+ <el-date-picker v-model="createTime" type="daterange" :disabled-date="disabledDate" :clearable="false" value-format="YYYY-MM-DD" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="tjm_card_select_right">
|
|
|
|
|
+ <el-button type="primary" icon="search" @click="reloadTable">搜索</el-button>
|
|
|
|
|
+ <el-button icon="refresh-right" @click="reset">重置</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-scrollbar>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-divider></el-divider>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="tjm_card_tools">
|
|
|
|
|
+ <div class="tjm_card_tools_right">
|
|
|
|
|
+ <el-button icon="download" @click="table_export">导出</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<div class="tjm_card_table">
|
|
<div class="tjm_card_table">
|
|
|
<el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="table_detail">
|
|
<el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="table_detail">
|
|
|
<el-table-column type="index" label="序号" width="55"></el-table-column>
|
|
<el-table-column type="index" label="序号" width="55"></el-table-column>
|
|
|
|
|
+ <template v-for="(item, index) in columns" :key="index">
|
|
|
|
|
+ <el-table-column :label="item.label" :prop="item.props" :min-width="item.width || 180" show-overflow-tooltip>
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-tag v-if="item.props == 'ytbDate' && !columnFormat(scope.row, item.props)" type="info">未设置</el-tag>
|
|
|
|
|
+ <el-tag v-else-if="item.props == 'isReport' || item.props == 'isDelay'" :type="tagType(columnFormat(scope.row, item.props))">{{ columnFormat(scope.row, item.props) }}</el-tag>
|
|
|
|
|
+ <template v-else>{{ columnFormat(scope.row, item.props) }}</template>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- <el-table-column label="操作" fixed="right" width="100">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-button type="primary" link icon="tickets" @click.stop="table_detail(scope.row)">查看</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column> -->
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="tjm_card_pagination">
|
|
<div class="tjm_card_pagination">
|
|
|
<yh-pagination v-model:pageNo="params.page" v-model:pageSize="params.size" :total="total" @paginationChange="reloadTable"></yh-pagination>
|
|
<yh-pagination v-model:pageNo="params.page" v-model:pageSize="params.size" :total="total" @paginationChange="reloadTable"></yh-pagination>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
+
|
|
|
|
|
+ <policy-explain v-if="dialog" ref="policyExplain" @closed="dialog = false"></policy-explain>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import moment from "moment";
|
|
|
import API from "@/api/policy/progress";
|
|
import API from "@/api/policy/progress";
|
|
|
|
|
+import { getMainList } from "@/api/system/depart";
|
|
|
|
|
+import { share_columns as columns } from "@/views/progress/main";
|
|
|
|
|
+import { exportExcel } from "@/utils/exportExcel";
|
|
|
|
|
+
|
|
|
import yhPagination from "@/components/Pagination/index.vue";
|
|
import yhPagination from "@/components/Pagination/index.vue";
|
|
|
|
|
+import policyExplain from "@/views/policyStrive/explain.vue";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
- yhPagination
|
|
|
|
|
|
|
+ yhPagination,
|
|
|
|
|
+ policyExplain
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ props: {
|
|
|
|
|
+ ytbDate: { type: Number, default: 0 }
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ columns,
|
|
|
|
|
+
|
|
|
|
|
+ deptQuery: {
|
|
|
|
|
+ modelValue: null,
|
|
|
|
|
+ data: [],
|
|
|
|
|
+ props: {
|
|
|
|
|
+ label: "name",
|
|
|
|
|
+ value: "id"
|
|
|
|
|
+ },
|
|
|
|
|
+ paramsFormat: {
|
|
|
|
|
+ 0: "deptId",
|
|
|
|
|
+ 1: "companyId"
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
loading: false,
|
|
loading: false,
|
|
|
|
|
+ createMonth: moment().format("YYYY-MM"),
|
|
|
|
|
+ createTime: [moment().startOf("month").format("YYYY-MM-DD"), moment().endOf("month").format("YYYY-MM-DD")],
|
|
|
params: {
|
|
params: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
size: 10
|
|
size: 10
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
total: 0,
|
|
total: 0,
|
|
|
- tableData: []
|
|
|
|
|
|
|
+ tableData: [],
|
|
|
|
|
+
|
|
|
|
|
+ dialog: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
|
|
|
+ this.getDeptTree();
|
|
|
this.reloadTable();
|
|
this.reloadTable();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ disabledDate(date) {
|
|
|
|
|
+ return moment(date).valueOf() > moment(this.createMonth).endOf("month").valueOf() || moment(date).valueOf() < moment(this.createMonth).startOf("month").valueOf()
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ tagType(value) {
|
|
|
|
|
+ return value == "否" && "danger" || "primary";
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ columnFormat(row, props) {
|
|
|
|
|
+ if (props == "isReport") return row.isLand == 1 && row.sjFinishTime && "是" || "否";
|
|
|
|
|
+ if (props == "isDelay") {
|
|
|
|
|
+ if (!row.ytbDate) return "否";
|
|
|
|
|
+ if (row.isLand == 1 && row.sjFinishTime) return moment(row.ytbDate).diff(row.sjFinishTime) < 0 && "是" || "否";
|
|
|
|
|
+ else return moment().diff(row.ytbDate) > 0 && "是" || "否";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return row[props];
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getDeptTree() {
|
|
|
|
|
+ getMainList().then(res => this.deptQuery.data = res.data);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
reloadTable() {
|
|
reloadTable() {
|
|
|
|
|
+ this.params.beginCreateTime = this.createTime[0] + " 00:00:00";
|
|
|
|
|
+ this.params.endCreateTime = this.createTime[1] + " 23:59:59";
|
|
|
|
|
+
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
API.progress.share(this.params).then(res => {
|
|
API.progress.share(this.params).then(res => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
- this.tableData = res.data.records;
|
|
|
|
|
|
|
+ this.tableData = res.data.records.map(item => {
|
|
|
|
|
+ item.ytbDate = this.ytbDate && (this.createMonth + "-" + this.ytbDate) || "";
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
this.total = res.data.total;
|
|
this.total = res.data.total;
|
|
|
}).catch(() => this.loading = false);
|
|
}).catch(() => this.loading = false);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ nodeClick({ deptType, id }) {
|
|
|
|
|
+ for (const key in this.deptQuery.paramsFormat) {
|
|
|
|
|
+ this.params[this.deptQuery.paramsFormat[key]] = null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.params[this.deptQuery.paramsFormat[deptType]] = id;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ monthChange(e) {
|
|
|
|
|
+ this.createTime = [moment(e).startOf("month").format("YYYY-MM-DD"), moment(e).endOf("month").format("YYYY-MM-DD")];
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ table_export() {
|
|
|
|
|
+ const header = columns.map(c => c.label);
|
|
|
|
|
+ const data = this.tableData.map(v => columns.map(c => c.props).map(j => this.columnFormat(v, j)));
|
|
|
|
|
+
|
|
|
|
|
+ exportExcel(header, data, [], `${this.$route.name}.xlsx`);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
table_detail(row) {
|
|
table_detail(row) {
|
|
|
- // this.$emit("table_detail", );
|
|
|
|
|
|
|
+ this.dialog = true;
|
|
|
|
|
+ nextTick(() => this.$refs.policyExplain.open("detail").setData(row.id));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -58,12 +197,24 @@ export default {
|
|
|
.tjm_card_style_custom {
|
|
.tjm_card_style_custom {
|
|
|
border: none;
|
|
border: none;
|
|
|
box-shadow: 0 0;
|
|
box-shadow: 0 0;
|
|
|
|
|
+ margin-top: 0;
|
|
|
|
|
|
|
|
:deep(.el-card__body) {
|
|
:deep(.el-card__body) {
|
|
|
padding-top: 10px;
|
|
padding-top: 10px;
|
|
|
|
|
|
|
|
- .tjm_card_table {
|
|
|
|
|
- margin-top: 0;
|
|
|
|
|
|
|
+ .query-date-col {
|
|
|
|
|
+ .el-date-editor.el-date-editor--month {
|
|
|
|
|
+ max-width: 110px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .el-date-editor.el-date-editor--month + .el-date-editor {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .tjm_card_tools {
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|