¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="120px"> |
| | | <el-form-item label="æ»ä½è®¡å"> |
| | | <el-input v-model="queryParams.plan" placeholder="请è¾å
¥æ»ä½è®¡å" /> |
| | | </el-form-item> |
| | | <el-form-item label="è´è´£äºº"> |
| | | <el-input v-model="queryParams.liablePerson" placeholder="请è¾å
¥è´è´£äºº" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.value2" |
| | | type="daterange" |
| | | start-placeholder="éæ©å¼å§æ¶é´" |
| | | end-placeholder="éæ©ç»ææ¶é´" |
| | | format="YYYY-MM-DD" |
| | | date-format="YYYY/MM/DD" |
| | | /> |
| | | </el-form-item> --> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table-box"> |
| | | <div class="mt20 mb20"> |
| | | <el-button type="primary" icon="plus" @click="handleAdd">æ°å¢</el-button> |
| | | <!-- <el-button type="primary" icon="Download" @click="handleAdd"> å¯¼åº </el-button> --> |
| | | </div> |
| | | <el-table :data="tableData" v-loading="loading"> |
| | | <el-table-column prop="plan" label="æ»ä½è®¡å" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="implementationPlan" label="宿½è®¡å" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="savingAmount" label="è约é" show-overflow-tooltip align="center" /> |
| | | <!-- <el-table-column prop="value4" label="å¼å§æ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="value5" label="ç»ææ¶é´" show-overflow-tooltip align="center" /> --> |
| | | <el-table-column prop="currentWork" label="å½åå·¥ä½" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="liablePerson" label="è´è´£äºº" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="completionTime" label="宿æ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" show-overflow-tooltip align="center" /> |
| | | <el-table-column prop="remark" label="夿³¨" show-overflow-tooltip align="center" /> |
| | | |
| | | <el-table-column label="æä½" width="300" align="center"> |
| | | <template #default="scope"> |
| | | <!-- <el-button link type="primary" icon="Files" @click=""> éä»¶ </el-button> --> |
| | | <el-button link type="primary" icon="Edit" @click="handleAdd(scope.row)"> ä¿®æ¹ </el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDel(scope.row)"> å é¤ </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | <edit-modal ref="EditModalRef" @getList="getList" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import EditModal from "./components/EditModal.vue" |
| | | import { projectPage, projectDel } from "@/api/policy/project" |
| | | |
| | | let { proxy } = getCurrentInstance() |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let tableData = ref([]) |
| | | let queryParams = ref({ |
| | | value1: "", |
| | | value2: [], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | }) |
| | | |
| | | function getList() { |
| | | loading.value = true |
| | | projectPage(queryParams.value).then((res) => { |
| | | console.log(res.rows) |
| | | tableData.value = res.rows |
| | | total.value = res.total |
| | | loading.value = false |
| | | }) |
| | | } |
| | | |
| | | getList() |
| | | |
| | | let EditModalRef = ref("") |
| | | function handleAdd(row) { |
| | | if (EditModalRef.value) { |
| | | EditModalRef.value.handleOpen(row) |
| | | } |
| | | } |
| | | |
| | | function handleDel(row) { |
| | | proxy.$modal |
| | | .confirm("æ¯å¦ç¡®è®¤å 餿°æ®é¡¹?") |
| | | .then(function () { |
| | | return projectDel(row.id) |
| | | }) |
| | | .then(() => { |
| | | getList() |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | value1: "", |
| | | value2: [], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | } |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | </style> |