|
@@ -0,0 +1,160 @@
|
|
|
+<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" placeholder="请输入内容">
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="getData()" />
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" @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="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="handleUpdate(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="checklist" @formSuccess="formSuccess" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Checklist from './components/Checklist'
|
|
|
+import { deleteChecklistById, getChecklistByPage } from '@/api/goaf/check'
|
|
|
+import { Pagination } from '@/components'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'ChecklistIndex',
|
|
|
+ components: {
|
|
|
+ Pagination,
|
|
|
+ Checklist
|
|
|
+ },
|
|
|
+ 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() {
|
|
|
+ const items = []
|
|
|
+ for (let i = 0; i < 10; i++) {
|
|
|
+ items.push({
|
|
|
+ 'checklistId': 109,
|
|
|
+ 'ocId': 341,
|
|
|
+ 'checklistTitle': '3gata5',
|
|
|
+ 'checklistDesc': 'g3868q',
|
|
|
+ 'checklistItemId': 784,
|
|
|
+ 'checklistItemContent': 'mrxs6p'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.dataList = items
|
|
|
+ getChecklistByPage(this.conditions).then((resp) => {
|
|
|
+ const { code, msg, data, total } = resp
|
|
|
+ if (code === 0) {
|
|
|
+ this.dataList = data
|
|
|
+ this.total = total
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ formSuccess(data) {
|
|
|
+ this.getData()
|
|
|
+ this.handleDetails(data)
|
|
|
+ },
|
|
|
+ handleAdd() {
|
|
|
+ this.$refs['checklist'].showAddModel()
|
|
|
+ },
|
|
|
+ handleUpdate(data) {
|
|
|
+ this.$refs['checklist'].showEditModel(data.checklistId)
|
|
|
+ },
|
|
|
+ handleDelete(data) {
|
|
|
+ const { checklistId, checklistTitle } = data
|
|
|
+ this.$confirm(`此操作将删除该数据${checklistTitle}, 是否继续?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ deleteChecklistById(checklistId).then((resp) => {
|
|
|
+ const { code, msg } = resp
|
|
|
+ if (code === 0) {
|
|
|
+ this.getData()
|
|
|
+ this.$message.success(msg)
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg)
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({ type: 'info', message: '已取消删除' })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss">
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+
|
|
|
+</style>
|
|
|
+
|