|
|
|
@ -1,20 +1,37 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div style="display: flex;white-space: nowrap; padding: 30px 0 0 0 ;" > |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="调整类型" prop="type" required> |
|
|
|
<el-select v-model.trim="formData.type" placeholder="请选择" clearable style="width: 280px"> |
|
|
|
<div style="display: flex;white-space: nowrap; padding: 30px ;" > |
|
|
|
<el-form :rules="rules" :model="formData" > |
|
|
|
<el-row><el-col :span="12"> |
|
|
|
<el-form-item label="调整类型" prop="type" > |
|
|
|
<el-select v-model.trim="formData.type" placeholder="请选择" clearable style="width: 200px"> |
|
|
|
<el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="活动积分" prop="points"> |
|
|
|
<el-input-number v-model="formData.points" label="描述文字" :step="0.1" :precision="1" ></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="调整原因" prop="description"> |
|
|
|
<el-input type="textarea" placeholder="请输入活动标题,不超过50子" :height="150" v-model="formData.description" |
|
|
|
maxlength="200" show-word-limit style="width: 555px;"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="div_btn"> |
|
|
|
|
|
|
|
<el-button size="small" @click="handleCancle">取 消</el-button> |
|
|
|
<el-button size="small" v-if="formType != 'detail'" type="primary" :disabled="btnDisable" |
|
|
|
@click="handleComfirm">确 定</el-button> |
|
|
|
@click="getTableData">确 定</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -25,61 +42,144 @@ export default { |
|
|
|
name: "see", |
|
|
|
data() { |
|
|
|
return { |
|
|
|
formData:{ |
|
|
|
type:"", |
|
|
|
points:'', |
|
|
|
description:"",//调整原因 |
|
|
|
}, |
|
|
|
typeList:[ |
|
|
|
{ |
|
|
|
id:"0", |
|
|
|
name:"增积分" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:"1", |
|
|
|
name:"减积分" |
|
|
|
} |
|
|
|
], |
|
|
|
Positive:'', |
|
|
|
radio:'1', |
|
|
|
stockQty:"", |
|
|
|
labelPosition: 'right', |
|
|
|
tableData: [], |
|
|
|
awardId:"" |
|
|
|
awardId:"", |
|
|
|
rules: { |
|
|
|
// linkMobile: [ |
|
|
|
// { required: true, message: '联系电话不能为空', trigger: 'blur' }, |
|
|
|
// { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' } |
|
|
|
// ], |
|
|
|
// title: [ |
|
|
|
// { required: true, message: '活动标题不能为空', trigger: 'blur' }, |
|
|
|
// ], |
|
|
|
// content: [ |
|
|
|
// { required: true, message: '活动详情不能为空', trigger: 'blur' }, |
|
|
|
// ], |
|
|
|
|
|
|
|
type: [ |
|
|
|
{ required: true, message: '调整类型不能为空', trigger: 'blur' }, |
|
|
|
], |
|
|
|
points: [ |
|
|
|
{ required: true, message: '积分修改不能为空', trigger: 'blur' }, |
|
|
|
], |
|
|
|
// signInTime: [ |
|
|
|
// { required: true, message: '签到时间不能为空', trigger: 'blur' }, |
|
|
|
// ], |
|
|
|
// deadline: [ |
|
|
|
// { required: true, message: '活动报名时间不能为空', trigger: 'blur' }, |
|
|
|
// ], |
|
|
|
// serviceTime: [ |
|
|
|
// { required: true, message: '服务时长不能为空', trigger: 'blur' }, |
|
|
|
// ], |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
props:{ |
|
|
|
VolunteerList:{ |
|
|
|
type: Object, |
|
|
|
default: () => {} |
|
|
|
} |
|
|
|
}, |
|
|
|
listL:{ |
|
|
|
type: Object, |
|
|
|
default: () => {} |
|
|
|
}, |
|
|
|
}, |
|
|
|
comments: { |
|
|
|
|
|
|
|
}, |
|
|
|
created() { |
|
|
|
console.log(this.listL,"list"); |
|
|
|
console.log(this.VolunteerList,"list"); |
|
|
|
this.tableData=this.VolunteerList |
|
|
|
// this.awardId=this.list.id |
|
|
|
// this.getTableData() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 调整积分 |
|
|
|
async getTableData() { |
|
|
|
const url = "/voluntary/points/adjustVolunteerPoints/commit"; |
|
|
|
// this.Positive = this.formData.type === 0 ? 1 : -1; // 使用数字表示正 |
|
|
|
// console.log(this.Positive,"this.Positive"); |
|
|
|
// console.log(this.formData.points,this.formData.type,"this.formData.points"); |
|
|
|
// let pointsDelta = this.Positive * parseFloat(this.formData.points); |
|
|
|
let params={ |
|
|
|
id:this.VolunteerList.id, |
|
|
|
description:this.formData.description, |
|
|
|
pointsDelta:this.formData.points, |
|
|
|
primaryPoints:this.listL.points |
|
|
|
// volunteerId:this.list.id, |
|
|
|
// mobile:this.formData.phone, |
|
|
|
// name:this.formData.name |
|
|
|
} |
|
|
|
console.log(params,"params"); |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url,params); |
|
|
|
if (code === 0) { |
|
|
|
console.log("列表请求成功!!!!!!!!!!!!!!"); |
|
|
|
this.$message({ |
|
|
|
message: "调整成功", |
|
|
|
type: "success", |
|
|
|
}); |
|
|
|
this.$emit('summDetailClose') |
|
|
|
} else { |
|
|
|
} |
|
|
|
}, |
|
|
|
//取消审查 |
|
|
|
handleCancle(){ |
|
|
|
this.$emit('handleprocesslClose') |
|
|
|
this.$emit('handleAdjustClose') |
|
|
|
}, |
|
|
|
//确认审查 |
|
|
|
handleComfirm(){ |
|
|
|
this.$emit('handleprocesslClose') |
|
|
|
this.$emit('handleAdjustClose') |
|
|
|
}, |
|
|
|
getTableData() { |
|
|
|
console.log(this.formData); |
|
|
|
const url = "/voluntary/pointsAward/admin/detail"; |
|
|
|
let params = { |
|
|
|
id:this.awardId |
|
|
|
} |
|
|
|
requestGet(url, params).then((res) =>{ |
|
|
|
console.log(res,"res"); |
|
|
|
if(res.code===0){ |
|
|
|
console.log("列表请求成功!!!!!!!!!!!!!!"); |
|
|
|
console.log(res.data, "data"); |
|
|
|
this.tableData = res.data |
|
|
|
console.log(this.tableData, "this.tableData"); |
|
|
|
} |
|
|
|
}) |
|
|
|
// const { data, code, msg } = requestGet(url, params) |
|
|
|
// console.log(data,"data"); |
|
|
|
// if (code === 0) { |
|
|
|
// console.log("列表请求成功!!!!!!!!!!!!!!"); |
|
|
|
// console.log(data,"data"); |
|
|
|
// this.tableData = data |
|
|
|
// console.log(this.tableData,"this.tableData"); |
|
|
|
// getTableData() { |
|
|
|
// console.log(this.formData); |
|
|
|
// const url = "/voluntary/pointsAward/admin/detail"; |
|
|
|
// let params = { |
|
|
|
// id:this.awardId |
|
|
|
// } |
|
|
|
// requestGet(url, params).then((res) =>{ |
|
|
|
// console.log(res,"res"); |
|
|
|
// if(res.code===0){ |
|
|
|
// console.log("列表请求成功!!!!!!!!!!!!!!"); |
|
|
|
// console.log(res.data, "data"); |
|
|
|
// this.tableData = res.data |
|
|
|
// console.log(this.tableData, "this.tableData"); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// // const { data, code, msg } = requestGet(url, params) |
|
|
|
// // console.log(data,"data"); |
|
|
|
// // if (code === 0) { |
|
|
|
// // console.log("列表请求成功!!!!!!!!!!!!!!"); |
|
|
|
// // console.log(data,"data"); |
|
|
|
// // this.tableData = data |
|
|
|
// // console.log(this.tableData,"this.tableData"); |
|
|
|
|
|
|
|
|
|
|
|
// } else { |
|
|
|
// } |
|
|
|
}, |
|
|
|
// // } else { |
|
|
|
// // } |
|
|
|
// }, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|