|
@@ -0,0 +1,454 @@
|
|
|
+<template>
|
|
|
+ <div class="yxnaContent">
|
|
|
+ <!-- 操作栏 -->
|
|
|
+ <div style="display: flex;justify-content: space-between;margin-bottom: 10px;height: 40px;">
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" class="add" @click="showAddForm">新增</el-button>
|
|
|
+ </div>
|
|
|
+ <!-- 搜索参数需自行处理 -->
|
|
|
+ <div style="display: flex">
|
|
|
+ <el-form ref="searchForm" :model="searchForm" :inline="true">
|
|
|
+ <el-form-item prop="name" label="">
|
|
|
+ <el-input
|
|
|
+ v-model.trim="searchForm.name"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入名称"
|
|
|
+ style="margin: 0 10px;width: 200px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="status" label="">
|
|
|
+ <el-select v-model="searchForm.status" placeholder="请选择类型" style="margin-right: 10px;width: 200px">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in rectificationState"
|
|
|
+ :key="index"
|
|
|
+ :value="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" class="search" @click="submitSearch">搜索</el-button>
|
|
|
+ <el-button type="primary" class="search" style="margin-left: 5px" @click="resetSearch">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 数据 -->
|
|
|
+ <div class="main-panel-table">
|
|
|
+ <el-table
|
|
|
+ ref="multipleTable"
|
|
|
+ v-loading="table.loading"
|
|
|
+ :data="table.data"
|
|
|
+ border
|
|
|
+ :height="tableH"
|
|
|
+ stripe
|
|
|
+ :header-cell-style="{ background: '#e5e8ed', color: '#666', textAlign: 'center' }"
|
|
|
+ :cell-style="tableStyle"
|
|
|
+ style="cursor: default"
|
|
|
+ >
|
|
|
+ <el-table-column width="50" label="序号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ (sorts.page - 1) * sorts.limit + scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in filteredTableColumns"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ :width="item.width"
|
|
|
+ :min-width="item.minWidth"
|
|
|
+ :align="item.align"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <img v-if="item.img" :src="(scope.row[item.prop])" alt="" width="70" height="70">
|
|
|
+ <span v-else>
|
|
|
+ {{
|
|
|
+ item.transform
|
|
|
+ ? item.transform(scope.row[item.prop], scope.row)
|
|
|
+ : scope.row[item.prop] || ''
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :width="210" label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button class="but" type="primary" @click="showEditForm(scope.row.id)">
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button class="but" type="danger" @click="del(scope.row.id)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- 分页 -->
|
|
|
+ <div class="block">
|
|
|
+ <el-pagination
|
|
|
+ :current-page="sorts.page"
|
|
|
+ :page-sizes="[10, 20, 30, 40, 50]"
|
|
|
+ :page-size="sorts.limit"
|
|
|
+ layout="prev, pager,next,jumper,total,sizes"
|
|
|
+ :total="sorts.total"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <rectification-edit ref="refRectificationEdit" @update-table="getData" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import RectificationEdit from './components/RectificationEdit'
|
|
|
+import rectificationApi from '@/api/rectification'
|
|
|
+import { parseTime, getTypeName } from '@/utils/tool'
|
|
|
+import { rectificationState, questionType, equipmentType } from './constants/codeConsts'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'Rectification',
|
|
|
+ components: {
|
|
|
+ RectificationEdit
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ searchForm: {
|
|
|
+ // 用于同步输入
|
|
|
+ name: '',
|
|
|
+ status: '' // 状态 【0:禁用 1:启用】
|
|
|
+ },
|
|
|
+ rectificationState,
|
|
|
+ tableH: 'calc(100vh - 230px)',
|
|
|
+ tableStyle: {
|
|
|
+ textAlign: 'center'
|
|
|
+ },
|
|
|
+ searchParams: {}, // 用于搜索的数据
|
|
|
+ table: {
|
|
|
+ data: [],
|
|
|
+ loading: false,
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ label: '问题类型',
|
|
|
+ prop: 'questionType',
|
|
|
+ transform(value) {
|
|
|
+ return getTypeName(value, questionType)
|
|
|
+ },
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '问题页面网址',
|
|
|
+ prop: 'errorUrl',
|
|
|
+ width: 130,
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '截图',
|
|
|
+ prop: 'picture',
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '描述',
|
|
|
+ prop: 'questionDescription',
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '办理状态',
|
|
|
+ prop: 'status',
|
|
|
+ transform(value) {
|
|
|
+ return getTypeName(value, rectificationState)
|
|
|
+ },
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '提交人',
|
|
|
+ prop: 'submitter',
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '邮箱',
|
|
|
+ prop: 'mail',
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '手机号',
|
|
|
+ prop: 'phone',
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '设备类型',
|
|
|
+ prop: 'equipment',
|
|
|
+ transform(value) {
|
|
|
+ return getTypeName(value, equipmentType)
|
|
|
+ },
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '创建时间',
|
|
|
+ prop: 'createTime',
|
|
|
+ transform(value) {
|
|
|
+ return parseTime(value)
|
|
|
+ },
|
|
|
+ width: 160,
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '办结时间',
|
|
|
+ prop: 'finishTime',
|
|
|
+ width: 160,
|
|
|
+ checked: true // 动态列
|
|
|
+ },
|
|
|
+
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ sorts: {
|
|
|
+ total: 0, // 条目总数
|
|
|
+ page: 1, // 当前页
|
|
|
+ limit: 10 // 每页条数
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ filteredTableColumns() {
|
|
|
+ return this.table.columns.filter((item) => {
|
|
|
+ return item.checked === true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.submitSearch()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ showAddForm() {
|
|
|
+ this.$refs.refRectificationEdit.showEditForm()
|
|
|
+ },
|
|
|
+ showEditForm(id) {
|
|
|
+ this.$refs.refRectificationEdit.showEditForm(id)
|
|
|
+ },
|
|
|
+ del(id) {
|
|
|
+ const message = '您确定要删除该数据吗'
|
|
|
+ this.$confirm(message, '提示', {
|
|
|
+ cancelButtonClass: 'btn-custom-cancel',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ rectificationApi.rectificationDelete(id).then(res => {
|
|
|
+ if (res.data.result) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ })
|
|
|
+ this.getData()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '删除失败!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+ submitSearch() {
|
|
|
+ this.searchParams = { ...this.searchForm }
|
|
|
+ this.sorts.page = 1
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ // 切换列表条数
|
|
|
+ handleSizeChange(pageSize) {
|
|
|
+ this.sorts.limit = pageSize
|
|
|
+ this.sorts.page = 1
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ // 切换页码
|
|
|
+ handleCurrentChange(currentPage) {
|
|
|
+ this.$refs.multipleTable.bodyWrapper.scrollTop = 0
|
|
|
+ this.sorts.page = currentPage
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ resetSearch() {
|
|
|
+ this.$refs.searchForm.resetFields()
|
|
|
+ this.submitSearch()
|
|
|
+ },
|
|
|
+ afterPageChange() {
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ this.table.loading = true
|
|
|
+ const params = {
|
|
|
+ page: this.sorts.page,
|
|
|
+ limit: this.sorts.limit,
|
|
|
+ ...this.searchParams
|
|
|
+ }
|
|
|
+ rectificationApi.rectificationPage({ params }).then((data) => {
|
|
|
+ const ret = data.data || []
|
|
|
+ this.table.data = ret.data
|
|
|
+ this.sorts.total = Number(ret.count)
|
|
|
+ }).finally(() => {
|
|
|
+ this.table.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+ /* 全局取消按钮 */
|
|
|
+ .btn-custom-cancel {
|
|
|
+ margin-left: 10px !important;
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<style scoped lang="less">
|
|
|
+ /* 禁用后的勾选*/
|
|
|
+ /deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
|
|
|
+ border-color: #def5cb;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
|
|
|
+ background-color: #157de9;
|
|
|
+ border-color: #DCDFE6;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-dialog__body {
|
|
|
+ // padding: 0 0 30px 20px;
|
|
|
+ color: #606266;
|
|
|
+ font-size: 14px;
|
|
|
+ word-break: break-all;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-dialog {
|
|
|
+ margin: 0 auto 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-form-item__label {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .yxnaContent {
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .addTitle {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .add {
|
|
|
+ width: 66px;
|
|
|
+ height: 38px;
|
|
|
+ margin-left: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-col-12 {
|
|
|
+ width: 50%;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+
|
|
|
+ .search {
|
|
|
+ width: 66px;
|
|
|
+ height: 38px;
|
|
|
+ margin-left: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-form-item__label {
|
|
|
+ // height: 40px;
|
|
|
+ // width: 110px;
|
|
|
+ // background-color: #FAFAFA;
|
|
|
+ text-align: center;
|
|
|
+ // border: 1px solid #DCDFE6;
|
|
|
+ // border-radius: 2px 0 0 2px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-button.is-disabled {
|
|
|
+ color: #C0C4CC !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/.el-button--primary.is-disabled {
|
|
|
+ color: #FFF !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-input__inner {
|
|
|
+ border-radius: 2px 0 0 2px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-select>.el-input {
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-textarea__inner {
|
|
|
+ height: 100px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-dialog__title {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-pagination__total {
|
|
|
+ margin-left: 10px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-pagination {
|
|
|
+ margin: 0;
|
|
|
+ margin-top: 10px;
|
|
|
+ /* position: fixed;
|
|
|
+ left: 13rem; */
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-table--scrollable-x .el-table__body-wrapper {
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ .but {
|
|
|
+ width: 36px;
|
|
|
+ height: 22px;
|
|
|
+ padding: 0;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-checkbox {
|
|
|
+ margin: 0;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .bewrite>.el-form-item__label {
|
|
|
+ width: 100%;
|
|
|
+ text-align: left;
|
|
|
+ padding-left: 21px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-form--inline .el-form-item {
|
|
|
+ margin-right: 0px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ [data-v-2cde7735] .el-form-item__label {
|
|
|
+ border: 1px solid #DCDFE6;
|
|
|
+ /*border-right: transparent;*/
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 空白框*/
|
|
|
+ /deep/ .formTempBox {
|
|
|
+ height: 38px;
|
|
|
+ border: 1px solid #DCDFE6;
|
|
|
+ width: 100%;
|
|
|
+ border-left: transparent;
|
|
|
+ background-color: #FAFAFA;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .input-star>.el-form-item__label:before {
|
|
|
+ content: "*";
|
|
|
+ color: #f56c6c;
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 去除上传组件动画过渡效果
|
|
|
+ /deep/ .el-upload-list__item {
|
|
|
+ transition: none !important;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+
|