Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
caoyizhong 3 years ago
parent
commit
a48ad6b2c6
  1. 44
      src/api/wjnft/manual.js
  2. 113
      src/views/wjnft/agreement/index.vue
  3. 5
      src/views/wjnft/feedback/index.vue
  4. 329
      src/views/wjnft/manual/index.vue
  5. 3
      src/views/wjnft/shufflingfigure/index.vue

44
src/api/wjnft/manual.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询操作手册列表
export function listManual(query) {
return request({
url: '/wjnft/manual/list',
method: 'get',
params: query
})
}
// 查询操作手册详细
export function getManual(id) {
return request({
url: '/wjnft/manual/' + id,
method: 'get'
})
}
// 新增操作手册
export function addManual(data) {
return request({
url: '/wjnft/manual',
method: 'post',
data: data
})
}
// 修改操作手册
export function updateManual(data) {
return request({
url: '/wjnft/manual',
method: 'put',
data: data
})
}
// 删除操作手册
export function delManual(id) {
return request({
url: '/wjnft/manual/' + id,
method: 'delete'
})
}

113
src/views/wjnft/agreement/index.vue

@ -47,16 +47,16 @@
</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:agreement:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['wjnft:agreement:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
@ -104,11 +104,13 @@
</div>
</template>
</el-table-column>
<el-table-column label="协议类型" align="center" prop="type">
<template slot-scope="scope">
<span v-if="scope.row.type === 1">服务协议</span>
<span v-if="scope.row.type === 2">支付协议</span>
<span v-if="scope.row.type === 3">隐私条款</span>
<span v-if="scope.row.type === 4">权益说明</span>
</template>
</el-table-column>
@ -132,6 +134,16 @@
<span v-else >-</span>
</template>
</el-table-column>
<el-table-column label="是否启用" align="center" prop="state">
<template slot-scope="scope">
<el-switch
v-model="scope.row.state"
@change="test(scope)"
active-text="是"
inactive-text="否">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -171,7 +183,7 @@
</el-form-item>
<el-form-item label="协议类型" prop="type" >
<!-- <el-input v-model="form.state" placeholder="请选择协议状态" />-->
<el-select v-model="form.type" clearable placeholder="请选择协议类型" disabled
<el-select v-model="form.type" clearable placeholder="请选择协议类型" :disabled =YC
size="small"
@keyup.enter.native="handleQuery"
>
@ -205,6 +217,7 @@
<script>
import { listAgreement, getAgreement, delAgreement, addAgreement, updateAgreement } from "@/api/wjnft/agreement";
import {listShufflingfigure, updateShufflingfigure} from "@/api/wjnft/shufflingfigure";
export default {
name: "Agreement",
@ -216,6 +229,8 @@ export default {
ids: [],
//
single: true,
//
YC: true,
//
multiple: true,
//
@ -235,7 +250,6 @@ export default {
name: null,
content: null,
type: null,
state: null,
createdBy: null,
createdTime: null,
updatedBy: null,
@ -260,7 +274,12 @@ export default {
}, {
value: '3',
label: '隐私条款'
}],
},
{
value: '4',
label: '权益说明'
}
],
};
@ -269,6 +288,43 @@ export default {
this.getList();
},
methods: {
/**
*启用状态
* */
test(scope) {
this.reset();
let num = 0;
if(scope.row.state === false){
let id = {id :scope.row.id, state: scope.row.state}
updateAgreement(id).then(response => {
this.$modal.msgSuccess("修改成功");
});
}else{
//
let type ={type : scope.row.type}
listAgreement(type).then(response => {
response.rows.forEach( item => {
if(item.state){
num = num+1;
}
})
if(num<1){
// this.form.id = scope.row.id;
// this.form.state = scope.row.state
let id = {id :scope.row.id, state: scope.row.state}
updateAgreement(id).then(() => {
this.$message.success("修改成功");
});
}else{
this.$message.error("同一类型的协议允许一个展示")
// this.open = false
this.getList();
}
})
}
},
/** 查询协议信息 列表 */
getList() {
this.loading = true;
@ -276,6 +332,7 @@ export default {
this.agreementList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
@ -316,18 +373,20 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.YC = false;
this.reset();
this.open = true;
this.title = "添加协议信息 ";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.YC = true;
this.reset();
const id = row.id || this.ids
getAgreement(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改协议信息 ";
this.title = "修改协议信息";
this.modify(this.form.type,this.form.state);
});
},
@ -342,12 +401,15 @@ export default {
if(type === 3){
this.form.type = "隐私条款";
}
if(state === 1){
this.form.state = "无效";
}
if(state === 2){
this.form.state = "有效";
if(type === 4){
this.form.type = "权益说明";
}
// if(state === 1){
// this.form.state = "";
// }
// if(state === 2){
// this.form.state = "";
// }
},
/** 修改复值*/
restore(type,state){
@ -360,12 +422,15 @@ export default {
if(type === "隐私条款"){
this.form.type = 3;
}
if(state === "无效"){
this.form.state = 1;
}
if(state === "有效"){
this.form.state = 2;
if(type === "权益说明"){
this.form.type = 4;
}
// if(state === ""){
// this.form.state = 1;
// }
// if(state === ""){
// this.form.state = 2;
// }
},
/** 提交按钮 */
submitForm() {

5
src/views/wjnft/feedback/index.vue

@ -335,9 +335,14 @@ export default {
this.loading = true;
listFeedback(this.queryParams).then(response => {
this.feedbackList = response.rows;
console.log(response.rows)
// this.feedbackList.picture
response.rows.forEach(item =>{
this.feedbackList.picture = item.picture.split(',')[0];
console.log(item.picture.split(','))
this.srcLists.push(item.picture);
});
this.total = response.total;
this.loading = false;
});

329
src/views/wjnft/manual/index.vue

@ -0,0 +1,329 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="标题" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入标题"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="创建时间" prop="createdTime">-->
<!-- <el-date-picker clearable size="small"-->
<!-- v-model="queryParams.createdTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="选择创建时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="更新时间" prop="updatedTime">-->
<!-- <el-date-picker clearable size="small"-->
<!-- v-model="queryParams.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="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:manual: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:manual: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:manual: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:manual:export']"-->
<!-- >导出</el-button>-->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="manualList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="id" align="center" prop="id" />-->
<el-table-column label="标题" align="center" prop="title" />
<!-- <el-table-column label="内容" align="center" prop="content" />-->
<el-table-column label="内容" align="center" prop="content" width="700" >
<template slot-scope="scope">
<!-- <div v-html="scope.row.content" style="height:200px;width:100%;overflow:auto"></div>-->
<div class="ql-container ql-snow">
<div class="ql-editor" v-html="scope.row.content" style="height:100px;width:100%;overflow:auto" />
</div>
</template>
</el-table-column>
<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" prop="updatedTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedTime, '{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:manual:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['wjnft:manual: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="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item>
<el-form-item label="内容">
<editor v-model="form.content" :min-height="192"/>
</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="选择创建时间">-->
<!-- </el-date-picker>-->
<!-- </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>
<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 { listManual, getManual, delManual, addManual, updateManual } from "@/api/wjnft/manual";
export default {
name: "Manual",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
manualList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
title: null,
content: null,
createdTime: null,
updatedTime: null,
deletedTime: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询操作手册列表 */
getList() {
this.loading = true;
listManual(this.queryParams).then(response => {
this.manualList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
title: null,
content: null,
createdTime: null,
updatedTime: 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
getManual(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) {
updateManual(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addManual(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 delManual(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('wjnft/manual/export', {
...this.queryParams
}, `manual_${new Date().getTime()}.xlsx`)
}
}
};
</script>

3
src/views/wjnft/shufflingfigure/index.vue

@ -393,9 +393,6 @@ export default {
})
}
},
handleCancle() {
this.$refs.form.resetFields()

Loading…
Cancel
Save