5 changed files with 929 additions and 137 deletions
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request' |
||||
|
||||
// 查询作品申请列表
|
||||
export function listApplication(query) { |
||||
return request({ |
||||
url: '/wjnft/application/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询作品申请详细
|
||||
export function getApplication(id) { |
||||
return request({ |
||||
url: '/wjnft/application/' + id, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增作品申请
|
||||
export function addApplication(data) { |
||||
return request({ |
||||
url: '/wjnft/application', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改作品申请
|
||||
export function updateApplication(data) { |
||||
return request({ |
||||
url: '/wjnft/application', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除作品申请
|
||||
export function delApplication(id) { |
||||
return request({ |
||||
url: '/wjnft/application/' + id, |
||||
method: 'delete' |
||||
}) |
||||
} |
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request' |
||||
|
||||
// 查询意见反馈回复列表
|
||||
export function listDialogue(query) { |
||||
return request({ |
||||
url: '/wjnft/dialogue/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询意见反馈回复详细
|
||||
export function getDialogue(id) { |
||||
return request({ |
||||
url: '/wjnft/dialogue/' + id, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增意见反馈回复
|
||||
export function addDialogue(data) { |
||||
return request({ |
||||
url: '/wjnft/dialogue', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改意见反馈回复
|
||||
export function updateDialogue(data) { |
||||
return request({ |
||||
url: '/wjnft/dialogue', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除意见反馈回复
|
||||
export function delDialogue(id) { |
||||
return request({ |
||||
url: '/wjnft/dialogue/' + id, |
||||
method: 'delete' |
||||
}) |
||||
} |
@ -0,0 +1,535 @@
|
||||
<template> |
||||
<div class="app-container"> |
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
||||
|
||||
<el-form-item label="作品名称" prop="collectionName"> |
||||
<el-input |
||||
v-model="queryParams.collectionName" |
||||
placeholder="请输入作品名称" |
||||
clearable |
||||
size="small" |
||||
@keyup.enter.native="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="审核状态" prop="state"> |
||||
<!-- <el-input--> |
||||
<!-- v-model="queryParams.state"--> |
||||
<!-- placeholder="请输入申请状态1-同意,2-拒绝,3-待审核)"--> |
||||
<!-- clearable--> |
||||
<!-- size="small"--> |
||||
<!-- @keyup.enter.native="handleQuery"--> |
||||
<!-- />--> |
||||
<el-select v-model="queryParams.state" placeholder="请选择审核状态" filterable :filter-method="dataFilter" @keyup.enter.native="handleQuery"> |
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">--> |
||||
<!-- <el-button--> |
||||
<!-- type="primary"--> |
||||
<!-- plain--> |
||||
<!-- icon="el-icon-plus"--> |
||||
<!-- size="mini"--> |
||||
<!-- @click="handleAdd"--> |
||||
<!-- v-hasPermi="['wjnft:application:add']"--> |
||||
<!-- >新增</el-button>--> |
||||
<!-- <el-col :span="1.5">--> |
||||
<!-- <el-button--> |
||||
<!-- type="danger"--> |
||||
<!-- plain--> |
||||
<!-- icon="el-icon-delete"--> |
||||
<!-- size="mini"--> |
||||
<!-- :disabled="multiple"--> |
||||
<!-- @click="handleDelete"--> |
||||
<!-- v-hasPermi="['wjnft:application:remove']"--> |
||||
<!-- >删除</el-button>--> |
||||
<!-- </el-col>--> |
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> |
||||
<!-- </el-row>--> |
||||
|
||||
<el-table v-loading="loading" :data="applicationList" @selection-change="handleSelectionChange"> |
||||
<el-table-column type="selection" width="55" align="center" /> |
||||
<el-table-column label="序号" type="index" width="50"> </el-table-column> |
||||
<el-table-column label="作品名称" align="center" prop="collectionName" /> |
||||
<el-table-column label="价格" align="center" prop="price" /> |
||||
<el-table-column label="数量" align="center" prop="issueNumber" /> |
||||
<el-table-column |
||||
prop="state" |
||||
align="center" |
||||
label="申请状态"> |
||||
<template scope="scope"> |
||||
{{ scope.row.state === 1 ? '已通过': '' }} |
||||
{{ scope.row.state === 2 ? '已拒绝': '' }} |
||||
{{ scope.row.state === 3 ? '待审核': '' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="概念说明" align="center" prop="describes" /> |
||||
<!-- <el-table-column label="作品图片" align="center" prop="imagePath" />--> |
||||
<el-table-column label="作品图片" align="center" prop="thumbnail" > |
||||
<template slot-scope="scope"> |
||||
<div class="demo-image"> |
||||
<div class="block"> |
||||
<el-image |
||||
style=" |
||||
width: 50px; |
||||
height: 51px; |
||||
border-radius: 6px; |
||||
z-index: 2; |
||||
" |
||||
:src="scope.row.thumbnail" |
||||
:preview-src-list="srcLists" |
||||
> |
||||
</el-image> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
</el-table-column> |
||||
<el-table-column label="申请人" align="center" prop="createdBy" /> |
||||
<el-table-column label="申请时间" align="center" prop="createdTime" width="180"> |
||||
<template slot-scope="scope"> |
||||
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
||||
<template slot-scope="scope"> |
||||
<el-button |
||||
size="mini" |
||||
type="text" |
||||
icon="el-icon-edit" |
||||
@click="handleUpdate(scope.row)" |
||||
v-if="scope.row.state==3" |
||||
>审核</el-button> |
||||
<!-- <el-button--> |
||||
<!-- size="mini"--> |
||||
<!-- type="text"--> |
||||
<!-- icon="el-icon-delete"--> |
||||
<!-- @click="handleDelete(scope.row)"--> |
||||
<!-- >删除</el-button>--> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
v-show="total>0" |
||||
:total="total" |
||||
:page.sync="queryParams.pageNum" |
||||
:limit.sync="queryParams.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<!-- 添加或修改作品申请对话框 --> |
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body @close='handleCancle'> |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
||||
<!-- <el-form-item label="艺术家id" prop="artistId">--> |
||||
<!-- <el-input v-model="form.artistId" placeholder="请输入艺术家id" />--> |
||||
<!-- </el-form-item>--> |
||||
<el-form-item label="作品名称" prop="collectionName"> |
||||
<el-input v-model="form.collectionName" placeholder="作品名称" disabled/> |
||||
</el-form-item> |
||||
<el-form-item label="价格" prop="price"> |
||||
<el-input v-model="form.price" placeholder="价格" disabled/> |
||||
</el-form-item> |
||||
<el-form-item label="数量" prop="issueNumber"> |
||||
<el-input v-model="form.issueNumber" placeholder="数量" disabled/> |
||||
</el-form-item> |
||||
<el-form-item label="审核" prop="state"> |
||||
<!-- <el-input v-model="form.state" placeholder="请输入申请状态1-同意,2-拒绝,3-待审核)" />--> |
||||
<el-select v-model="form.state" clearable placeholder="请选择审核是否通过" |
||||
size="small" |
||||
@keyup.enter.native="handleQuery" |
||||
> |
||||
<el-option label="通过" value="1"></el-option> |
||||
<el-option label="不通过" value="2"></el-option> |
||||
<el-option label="待审核" value="3"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
|
||||
<el-form-item label="概念说明" prop="describes"> |
||||
<el-input v-model="form.describes" type="textarea" placeholder="概念说明" disabled/> |
||||
</el-form-item> |
||||
<!-- <el-form-item label="作品图片路径" prop="imagePath">--> |
||||
<!-- <el-input v-model="form.imagePath" placeholder="请输入作品图片路径" />--> |
||||
<!-- </el-form-item>--> |
||||
<el-form-item label="缩量图" prop="thumbnail" > |
||||
<!-- <el-input v-model="form.thumbnail" placeholder="请输入缩量图" />--> |
||||
<el-upload |
||||
ref="upload" |
||||
:action="action" |
||||
:headers="headers" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
list-type="picture-card" |
||||
:on-success="handleSuccess" |
||||
:auto-upload="false" |
||||
:before-upload="beforeUpload" |
||||
:file-list="imgList" |
||||
:disabled="true" |
||||
:multiple="false" |
||||
> |
||||
|
||||
<i slot="default" class="el-icon-plus"></i> |
||||
<div slot="file" slot-scope="{file}"> |
||||
<img |
||||
class="el-upload-list__item-thumbnail" |
||||
:src="file.url" alt="" |
||||
> |
||||
<span class="el-upload-list__item-actions"> |
||||
<span |
||||
class="el-upload-list__item-preview" |
||||
@click="handlePictureCardPreview(file)" |
||||
> |
||||
<i class="el-icon-zoom-in"></i> |
||||
</span> |
||||
<!-- <span--> |
||||
<!-- v-if="!disabled"--> |
||||
<!-- class="el-upload-list__item-delete"--> |
||||
<!-- @click="handleDownload(file)"--> |
||||
<!-- >--> |
||||
<!-- <i class="el-icon-download"></i>--> |
||||
<!-- </span>--> |
||||
<!-- <span--> |
||||
<!-- v-if="!disabled"--> |
||||
<!-- class="el-upload-list__item-delete"--> |
||||
<!-- @click="handleRemove(file)"--> |
||||
<!-- >--> |
||||
<!-- <i class="el-icon-delete"></i>--> |
||||
<!-- </span>--> |
||||
</span> |
||||
</div> |
||||
</el-upload> |
||||
<el-dialog :visible.sync="dialogVisible"> |
||||
<img width="100%" :src="dialogImageUrl" alt=""> |
||||
</el-dialog> |
||||
</el-form-item> |
||||
<el-form-item label="申请人" prop="createdBy"> |
||||
<el-input v-model="form.createdBy" placeholder="申请人" disabled/> |
||||
</el-form-item> |
||||
<el-form-item label="申请时间" prop="createdTime"> |
||||
<el-date-picker clearable size="small" |
||||
v-model="form.createdTime" |
||||
type="date" |
||||
value-format="yyyy-MM-dd" |
||||
placeholder="申请时间" disabled> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<!-- <el-form-item label="更新人" prop="updatedBy">--> |
||||
<!-- <el-input v-model="form.updatedBy" placeholder="请输入更新人" />--> |
||||
<!-- </el-form-item>--> |
||||
<!-- <el-form-item label="更新时间" prop="updatedTime">--> |
||||
<!-- <el-date-picker clearable size="small"--> |
||||
<!-- v-model="form.updatedTime"--> |
||||
<!-- type="date"--> |
||||
<!-- value-format="yyyy-MM-dd"--> |
||||
<!-- placeholder="选择更新时间">--> |
||||
<!-- </el-date-picker>--> |
||||
<!-- </el-form-item>--> |
||||
<!-- <el-form-item label="删除时间" prop="deletedTime">--> |
||||
<!-- <el-date-picker clearable size="small"--> |
||||
<!-- v-model="form.deletedTime"--> |
||||
<!-- type="date"--> |
||||
<!-- value-format="yyyy-MM-dd"--> |
||||
<!-- placeholder="选择删除时间">--> |
||||
<!-- </el-date-picker>--> |
||||
<!-- </el-form-item>--> |
||||
<!-- <el-form-item label="预留A" prop="reservedA">--> |
||||
<!-- <el-input v-model="form.reservedA" placeholder="请输入预留A" />--> |
||||
<!-- </el-form-item>--> |
||||
</el-form> |
||||
<div slot="footer" class="dialog-footer"> |
||||
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
<el-button @click="cancel">取 消</el-button> |
||||
</div> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { listApplication, getApplication, delApplication, addApplication, updateApplication } from "@/api/wjnft/application"; |
||||
import {getToken} from "@/utils/auth"; |
||||
const client = 1 |
||||
export default { |
||||
name: "Application", |
||||
data() { |
||||
return { |
||||
// 遮罩层 |
||||
loading: true, |
||||
// 选中数组 |
||||
ids: [], |
||||
// 非单个禁用 |
||||
single: true, |
||||
// 非多个禁用 |
||||
multiple: true, |
||||
srcLists: [], |
||||
// 显示搜索条件 |
||||
showSearch: true, |
||||
// 总条数 |
||||
total: 0, |
||||
// 作品申请表格数据 |
||||
applicationList: [], |
||||
imgList: [], |
||||
// 弹出层标题 |
||||
title: "", |
||||
// 是否禁用上传 |
||||
isUploading: false, |
||||
// 是否显示弹出层 |
||||
open: false, |
||||
dialogVisible: false, |
||||
dialogImageUrl: '', |
||||
disabled: false, |
||||
// 查询参数 |
||||
queryParams: { |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
artistId: null, |
||||
collectionName: null, |
||||
price: null, |
||||
issueNumber: null, |
||||
state: null, |
||||
describes: null, |
||||
imagePath: null, |
||||
thumbnail: null, |
||||
createdBy: null, |
||||
createdTime: null, |
||||
updatedBy: null, |
||||
updatedTime: null, |
||||
deletedTime: null, |
||||
reservedA: null |
||||
}, |
||||
options: [{ |
||||
value: '1', |
||||
label: '同意' |
||||
}, { |
||||
value: '2', |
||||
label: '拒绝' |
||||
}, { |
||||
value: '3', |
||||
label: '待审核' |
||||
}], |
||||
// 表单参数 |
||||
form: {}, |
||||
// 表单校验 |
||||
rules: { |
||||
} |
||||
}; |
||||
}, |
||||
created() { |
||||
this.getList(); |
||||
}, |
||||
|
||||
computed: { |
||||
headers() { |
||||
return { |
||||
Authorization: 'Bearer ' + getToken() |
||||
} |
||||
}, |
||||
action() { |
||||
return process.env.VUE_APP_BASE_API + '/wjnft/oss/upload/' + client |
||||
} |
||||
}, |
||||
methods: { |
||||
|
||||
//下拉框清空 |
||||
dataFilter(val) { |
||||
this.value = val; |
||||
if (val) { //val存在 |
||||
this.options = this.optionsCopy.filter((item) => { |
||||
if (!!~item.label.indexOf(val) || !!~item.label.toUpperCase().indexOf(val.toUpperCase())) { |
||||
return true |
||||
} |
||||
}) |
||||
} else { //val为空时,还原数组 |
||||
this.options = this.optionsCopy; |
||||
} |
||||
}, |
||||
beforeUpload(file) { |
||||
// 是否禁用上传 |
||||
|
||||
//console.log(file) |
||||
var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1) |
||||
const extension = testmsg === 'png' |
||||
const extension1 = testmsg === 'jpg' |
||||
const extension2 = testmsg === 'jpeg' |
||||
const isLt32M = file.size / 1024 / 1024 < 3 |
||||
if (!extension && !extension2 && !extension1) { |
||||
this.$message.warning('上传文件只能是png,jpeg,jpg格式!') |
||||
} |
||||
if (!isLt32M) { |
||||
this.$message.warning('上传文件大小不能超过3MB!') |
||||
} |
||||
return (extension || extension2 || extension1) && isLt32M |
||||
|
||||
}, |
||||
// 上传的提示 |
||||
handleExceed(files, fileList) { |
||||
this.$message.warning('当前只允许上传一个文件') |
||||
}, |
||||
//上传成功 |
||||
handleSuccess(res, file) { |
||||
this.imagesUrl = res.data |
||||
//图片路径返回给父组件 |
||||
console.log(res) |
||||
this.picture_url = res.url |
||||
return this.imgList |
||||
}, |
||||
handleRemove(file) { |
||||
console.log(file) |
||||
this.$refs.upload.clearFiles() |
||||
// this.$confirm(`确定移除 ${ file.name }?`); |
||||
// this.$modal.confirm('确认移除"' + file.name + '"图片?').then(function() { |
||||
// return this.$refs.upload.clearFiles(); |
||||
// }).then(() => { |
||||
// this.$modal.msgSuccess("删除成功"); |
||||
// }).catch(() => {}); |
||||
}, |
||||
handlePictureCardPreview(file) { |
||||
this.dialogImageUrl = file.url |
||||
this.dialogVisible = true |
||||
}, |
||||
handleDownload(file) { |
||||
console.log(file) |
||||
}, |
||||
|
||||
/** 查询作品申请列表 */ |
||||
getList() { |
||||
this.loading = true; |
||||
listApplication(this.queryParams).then(response => { |
||||
this.applicationList = response.rows; |
||||
response.rows.forEach(item =>{ |
||||
this.srcLists.push(item.thumbnail); |
||||
}); |
||||
this.total = response.total; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
// 取消按钮 |
||||
cancel() { |
||||
this.open = false; |
||||
this.reset(); |
||||
}, |
||||
handleCancle() { |
||||
this.$refs.form.resetFields() |
||||
this.open = false |
||||
this.imgList = [] |
||||
}, |
||||
// 表单重置 |
||||
reset() { |
||||
this.form = { |
||||
id: null, |
||||
artistId: null, |
||||
collectionName: null, |
||||
price: null, |
||||
issueNumber: null, |
||||
state: null, |
||||
describe: null, |
||||
imagePath: null, |
||||
thumbnail: null, |
||||
createdBy: null, |
||||
createdTime: null, |
||||
updatedBy: null, |
||||
updatedTime: null, |
||||
deletedTime: null, |
||||
reservedA: null |
||||
}; |
||||
this.resetForm("form"); |
||||
}, |
||||
/** 搜索按钮操作 */ |
||||
handleQuery() { |
||||
this.queryParams.pageNum = 1; |
||||
this.getList(); |
||||
}, |
||||
/** 重置按钮操作 */ |
||||
resetQuery() { |
||||
this.resetForm("queryForm"); |
||||
this.handleQuery(); |
||||
}, |
||||
// 多选框选中数据 |
||||
handleSelectionChange(selection) { |
||||
this.ids = selection.map(item => item.id) |
||||
this.single = selection.length!==1 |
||||
this.multiple = !selection.length |
||||
}, |
||||
/** 新增按钮操作 */ |
||||
handleAdd() { |
||||
this.reset(); |
||||
this.open = true; |
||||
this.title = "添加作品申请"; |
||||
}, |
||||
/** 修改按钮操作 */ |
||||
handleUpdate(row) { |
||||
this.reset(); |
||||
const id = row.id || this.ids |
||||
getApplication(id).then(response => { |
||||
this.form = response.data; |
||||
this.open = true; |
||||
this.title = "修改作品申请"; |
||||
console.log(this.form.thumbnail) |
||||
let t = this.form.thumbnail |
||||
let obj = {} |
||||
obj.url = t |
||||
this.imgList.push(obj) |
||||
if(this.form.state === 1){ |
||||
this.form.state = "通过" |
||||
} |
||||
if(this.form.state === 2){ |
||||
this.form.state = "不通过" |
||||
} |
||||
if(this.form.state === 3){ |
||||
this.form.state = "待审核" |
||||
} |
||||
}); |
||||
}, |
||||
/** 提交按钮 */ |
||||
submitForm() { |
||||
this.$refs["form"].validate(valid => { |
||||
if (valid) { |
||||
if (this.form.id != null) { |
||||
if (this.form.state === '通过') { |
||||
this.form.state = 1 |
||||
} |
||||
if (this.form.state === '不通过') { |
||||
this.form.state = 2 |
||||
} |
||||
if (this.form.state === '待审核') { |
||||
this.form.state = 3 |
||||
} |
||||
updateApplication(this.form).then(response => { |
||||
this.$modal.msgSuccess("修改成功"); |
||||
this.open = false; |
||||
this.getList(); |
||||
}); |
||||
} else { |
||||
addApplication(this.form).then(response => { |
||||
this.$modal.msgSuccess("新增成功"); |
||||
this.open = false; |
||||
this.getList(); |
||||
}); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
/** 删除按钮操作 */ |
||||
handleDelete(row) { |
||||
const ids = row.id || this.ids; |
||||
this.$modal.confirm('是否确认删除作品申请编号为"' + ids + '"的数据项?').then(function() { |
||||
return delApplication(ids); |
||||
}).then(() => { |
||||
this.getList(); |
||||
this.$modal.msgSuccess("删除成功"); |
||||
}).catch(() => {}); |
||||
}, |
||||
/** 导出按钮操作 */ |
||||
handleExport() { |
||||
this.download('wjnft/application/export', { |
||||
...this.queryParams |
||||
}, `application_${new Date().getTime()}.xlsx`) |
||||
} |
||||
}, |
||||
}; |
||||
</script> |
@ -0,0 +1,304 @@
|
||||
<template> |
||||
<div class="app-container"> |
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
||||
<el-form-item label="意见反馈表ID" prop="feedbackId"> |
||||
<el-input |
||||
v-model="queryParams.feedbackId" |
||||
placeholder="请输入意见反馈表ID" |
||||
clearable |
||||
size="small" |
||||
@keyup.enter.native="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="${comment}" prop="createdTime"> |
||||
<el-date-picker clearable size="small" |
||||
v-model="queryParams.createdTime" |
||||
type="date" |
||||
value-format="yyyy-MM-dd" |
||||
placeholder="选择${comment}"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item label="逻辑" prop="deletedTime"> |
||||
<el-date-picker clearable size="small" |
||||
v-model="queryParams.deletedTime" |
||||
type="date" |
||||
value-format="yyyy-MM-dd" |
||||
placeholder="选择逻辑"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<el-row :gutter="10" class="mb8"> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="primary" |
||||
plain |
||||
icon="el-icon-plus" |
||||
size="mini" |
||||
@click="handleAdd" |
||||
v-hasPermi="['wjnft:dialogue:add']" |
||||
>新增</el-button> |
||||
</el-col> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="success" |
||||
plain |
||||
icon="el-icon-edit" |
||||
size="mini" |
||||
:disabled="single" |
||||
@click="handleUpdate" |
||||
v-hasPermi="['wjnft:dialogue:edit']" |
||||
>修改</el-button> |
||||
</el-col> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="danger" |
||||
plain |
||||
icon="el-icon-delete" |
||||
size="mini" |
||||
:disabled="multiple" |
||||
@click="handleDelete" |
||||
v-hasPermi="['wjnft:dialogue:remove']" |
||||
>删除</el-button> |
||||
</el-col> |
||||
<el-col :span="1.5"> |
||||
<el-button |
||||
type="warning" |
||||
plain |
||||
icon="el-icon-download" |
||||
size="mini" |
||||
@click="handleExport" |
||||
v-hasPermi="['wjnft:dialogue:export']" |
||||
>导出</el-button> |
||||
</el-col> |
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
||||
</el-row> |
||||
|
||||
<el-table v-loading="loading" :data="dialogueList" @selection-change="handleSelectionChange"> |
||||
<el-table-column type="selection" width="55" align="center" /> |
||||
<el-table-column label="${comment}" align="center" prop="id" /> |
||||
<el-table-column label="意见反馈表ID" align="center" prop="feedbackId" /> |
||||
<el-table-column label="管理员回复" align="center" prop="admContent" /> |
||||
<el-table-column label="用户回复" align="center" prop="userContent" /> |
||||
<el-table-column label="${comment}" align="center" prop="createdTime" width="180"> |
||||
<template slot-scope="scope"> |
||||
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="逻辑" align="center" prop="deletedTime" width="180"> |
||||
<template slot-scope="scope"> |
||||
<span>{{ parseTime(scope.row.deletedTime, '{y}-{m}-{d}') }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
||||
<template slot-scope="scope"> |
||||
<el-button |
||||
size="mini" |
||||
type="text" |
||||
icon="el-icon-edit" |
||||
@click="handleUpdate(scope.row)" |
||||
v-hasPermi="['wjnft:dialogue:edit']" |
||||
>修改</el-button> |
||||
<el-button |
||||
size="mini" |
||||
type="text" |
||||
icon="el-icon-delete" |
||||
@click="handleDelete(scope.row)" |
||||
v-hasPermi="['wjnft:dialogue:remove']" |
||||
>删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
v-show="total>0" |
||||
:total="total" |
||||
:page.sync="queryParams.pageNum" |
||||
:limit.sync="queryParams.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<!-- 添加或修改意见反馈回复对话框 --> |
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
||||
<el-form-item label="意见反馈表ID" prop="feedbackId"> |
||||
<el-input v-model="form.feedbackId" placeholder="请输入意见反馈表ID" /> |
||||
</el-form-item> |
||||
<el-form-item label="管理员回复" prop="admContent"> |
||||
<el-input v-model="form.admContent" type="textarea" placeholder="请输入内容" /> |
||||
</el-form-item> |
||||
<el-form-item label="用户回复" prop="userContent"> |
||||
<el-input v-model="form.userContent" type="textarea" placeholder="请输入内容" /> |
||||
</el-form-item> |
||||
<el-form-item label="${comment}" prop="createdTime"> |
||||
<el-date-picker clearable size="small" |
||||
v-model="form.createdTime" |
||||
type="date" |
||||
value-format="yyyy-MM-dd" |
||||
placeholder="选择${comment}"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item label="逻辑" prop="deletedTime"> |
||||
<el-date-picker clearable size="small" |
||||
v-model="form.deletedTime" |
||||
type="date" |
||||
value-format="yyyy-MM-dd" |
||||
placeholder="选择逻辑"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
</el-form> |
||||
<div slot="footer" class="dialog-footer"> |
||||
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
<el-button @click="cancel">取 消</el-button> |
||||
</div> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { listDialogue, getDialogue, delDialogue, addDialogue, updateDialogue } from "@/api/wjnft/dialogue"; |
||||
|
||||
export default { |
||||
name: "Dialogue", |
||||
data() { |
||||
return { |
||||
// 遮罩层 |
||||
loading: true, |
||||
// 选中数组 |
||||
ids: [], |
||||
// 非单个禁用 |
||||
single: true, |
||||
// 非多个禁用 |
||||
multiple: true, |
||||
// 显示搜索条件 |
||||
showSearch: true, |
||||
// 总条数 |
||||
total: 0, |
||||
// 意见反馈回复表格数据 |
||||
dialogueList: [], |
||||
// 弹出层标题 |
||||
title: "", |
||||
// 是否显示弹出层 |
||||
open: false, |
||||
// 查询参数 |
||||
queryParams: { |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
feedbackId: null, |
||||
admContent: null, |
||||
userContent: null, |
||||
createdTime: null, |
||||
deletedTime: null |
||||
}, |
||||
// 表单参数 |
||||
form: {}, |
||||
// 表单校验 |
||||
rules: { |
||||
} |
||||
}; |
||||
}, |
||||
created() { |
||||
this.getList(); |
||||
}, |
||||
methods: { |
||||
/** 查询意见反馈回复列表 */ |
||||
getList() { |
||||
this.loading = true; |
||||
listDialogue(this.queryParams).then(response => { |
||||
this.dialogueList = response.rows; |
||||
this.total = response.total; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
// 取消按钮 |
||||
cancel() { |
||||
this.open = false; |
||||
this.reset(); |
||||
}, |
||||
// 表单重置 |
||||
reset() { |
||||
this.form = { |
||||
id: null, |
||||
feedbackId: null, |
||||
admContent: null, |
||||
userContent: null, |
||||
createdTime: null, |
||||
deletedTime: null |
||||
}; |
||||
this.resetForm("form"); |
||||
}, |
||||
/** 搜索按钮操作 */ |
||||
handleQuery() { |
||||
this.queryParams.pageNum = 1; |
||||
this.getList(); |
||||
}, |
||||
/** 重置按钮操作 */ |
||||
resetQuery() { |
||||
this.resetForm("queryForm"); |
||||
this.handleQuery(); |
||||
}, |
||||
// 多选框选中数据 |
||||
handleSelectionChange(selection) { |
||||
this.ids = selection.map(item => item.id) |
||||
this.single = selection.length!==1 |
||||
this.multiple = !selection.length |
||||
}, |
||||
/** 新增按钮操作 */ |
||||
handleAdd() { |
||||
this.reset(); |
||||
this.open = true; |
||||
this.title = "添加意见反馈回复"; |
||||
}, |
||||
/** 修改按钮操作 */ |
||||
handleUpdate(row) { |
||||
this.reset(); |
||||
const id = row.id || this.ids |
||||
getDialogue(id).then(response => { |
||||
this.form = response.data; |
||||
this.open = true; |
||||
this.title = "修改意见反馈回复"; |
||||
}); |
||||
}, |
||||
/** 提交按钮 */ |
||||
submitForm() { |
||||
this.$refs["form"].validate(valid => { |
||||
if (valid) { |
||||
if (this.form.id != null) { |
||||
updateDialogue(this.form).then(response => { |
||||
this.$modal.msgSuccess("修改成功"); |
||||
this.open = false; |
||||
this.getList(); |
||||
}); |
||||
} else { |
||||
addDialogue(this.form).then(response => { |
||||
this.$modal.msgSuccess("新增成功"); |
||||
this.open = false; |
||||
this.getList(); |
||||
}); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
/** 删除按钮操作 */ |
||||
handleDelete(row) { |
||||
const ids = row.id || this.ids; |
||||
this.$modal.confirm('是否确认删除意见反馈回复编号为"' + ids + '"的数据项?').then(function() { |
||||
return delDialogue(ids); |
||||
}).then(() => { |
||||
this.getList(); |
||||
this.$modal.msgSuccess("删除成功"); |
||||
}).catch(() => {}); |
||||
}, |
||||
/** 导出按钮操作 */ |
||||
handleExport() { |
||||
this.download('wjnft/dialogue/export', { |
||||
...this.queryParams |
||||
}, `dialogue_${new Date().getTime()}.xlsx`) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
Loading…
Reference in new issue