| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <template>
- <div class="content-container">
- <el-row class="tool-bar">
- <el-col :span="12" class="left">
- <div class="content-title">
- {{ title }}
- </div>
- </el-col>
- <el-col :span="12" class="right">
- <el-input v-model="conditions.keywords" class="search-input m-right-15" size="mini" placeholder="请输入内容">
- <el-button slot="append" icon="el-icon-search" size="mini" @click="getData()" />
- </el-input>
- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
- </el-col>
- </el-row>
- <el-row class="content-body">
- <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 220px)">
- <el-table-column type="index" label="序号" header-align="center" align="center" width="80" />
- <el-table-column prop="checklistTitle" label="名称" header-align="left" align="left" width="260">
- <template v-slot="{row}">
- <span><i class="el-icon-tickets" /> {{ row.checklistTitle }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="checklistCatTitle" label="类别" header-align="center" align="center" width="200">
- <template v-slot="{row}">
- <span><el-tag effect="plain" color="rgb(38 69 90)">{{ row.checklistCatTitle }}</el-tag></span>
- </template>
- </el-table-column>
- <el-table-column prop="checklistDesc" label="说明" header-align="left" align="left">
- <template v-slot="{row}">
- <span>{{ row.checklistDesc }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="issuedAt" label="变更人" header-align="center" align="center" width="200">
- <template v-slot="{row}">
- <i class="el-icon-user" />
- <span> {{ row.issuedAccountName }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="issuedAt" label="变更时间" header-align="center" align="center" width="200">
- <template v-slot="{row}">
- <i class="el-icon-time" />
- <span> {{ row.issuedAt | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" header-align="center" align="center" width="180">
- <template v-slot="{row}">
- <el-button size="mini" icon="el-icon-view" type="primary" @click="handleDetails(row)">详情</el-button>
- <el-button v-if="row.isFixed !== 1" size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagination-wrap">
- <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
- </div>
- </el-row>
- <checklist ref="AddChecklist" title="新增" @formSuccess="AddChecklistSuccess" />
- <checklist-details ref="ChecklistDetails" title="详情" @formSuccess="getData" />
- </div>
- </template>
- <script>
- import Checklist from './components/Checklist'
- import ChecklistDetails from './components/Details'
- import { deleteChecklistById, getChecklistByPage } from '@/api/system/checklistApi'
- import { Pagination } from '@/components'
- export default {
- name: 'ChecklistIndex',
- components: {
- Pagination,
- Checklist,
- ChecklistDetails
- },
- data() {
- return {
- title: '清单管理',
- listLoading: false,
- total: 0,
- dataList: [],
- conditions: {
- page: 1,
- limit: 10,
- checklistTypeId: 3, // 同story ID
- keywords: ''
- }
- }
- },
- mounted() {
- this.getData()
- },
- methods: {
- // fetch data
- getData() {
- this.listLoading = true
- getChecklistByPage(this.conditions).then((resp) => {
- this.listLoading = false
- const { data, total } = resp
- this.dataList = data
- this.total = total
- }).catch((error) => {
- console.log(error)
- })
- },
- // 新增
- AddChecklistSuccess(data) {
- this.getData()
- this.handleDetails(data)
- },
- // 修改
- handleAdd() {
- this.$refs['AddChecklist'].showAddModel()
- },
- // 详情
- handleDetails(data) {
- const { checklistId } = data
- this.$refs['ChecklistDetails'].showModel(checklistId)
- },
- // Delete Handling
- handleDelete(data) {
- const { checklistId, checklistTitle } = data
- this.$confirm(`此操作将删除该数据${checklistTitle}, 是否继续?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- deleteChecklistById(checklistId).then((resp) => {
- const { msg } = resp
- this.getData()
- this.$message.success(msg)
- }).catch((error) => {
- console.log(error)
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消删除' })
- })
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
- <style lang="scss" scoped>
- </style>
|