Browse Source

意见反馈,协议

dev
0.0 3 years ago
parent
commit
7369994f54
  1. 113
      src/views/wjnft/agreement/index.vue
  2. 5
      src/views/wjnft/feedback/index.vue
  3. 3
      src/views/wjnft/shufflingfigure/index.vue

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;
});

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

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

Loading…
Cancel
Save