This commit is contained in:
user 2023-11-06 11:53:56 +08:00
parent a0f9d68658
commit c44c43d9bb
3 changed files with 60 additions and 18 deletions

View File

@ -15,6 +15,13 @@ export function getListtj(query) {
params: query
})
}
export function oilDepotConfiguration(query) {
return request({
url: 'business/oilDepotConfiguration',
method: 'put',
data: query
})
}
// 新增列表
export function addList(data) {
return request({

View File

@ -44,8 +44,8 @@
<div class="tj-num">{{tjdata.remaining_amount || 0}}</div>
<div class="tj-siez">剩余额度</div>
</el-card>
<el-card class="kar" >
<div class="tj-num"> <el-tag>启用</el-tag> </div>
<el-card class="kar" style="cursor: pointer" >
<div class="tj-num"> <el-tag v-if="tjdata.exchangeStatus == 0" @click="putStatus(1)">启用</el-tag> <el-tag type="info" v-if="tjdata.exchangeStatus == 1 " @click="putStatus(0)">禁用</el-tag> </div>
<div class="tj-siez">兑换功能状态</div>
</el-card>
</div>
@ -153,9 +153,6 @@
<el-input type="textarea" v-model="ruleForm.remark"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="addBlock()">创建</el-button>
@ -166,7 +163,7 @@
</template>
<script>
import { getList,getListtj,addList,eitList,deleteList } from "@/api/EventMarketing/giftBlock";
import { getList,getListtj,addList,eitList,deleteList,oilDepotConfiguration } from "@/api/EventMarketing/giftBlock";
export default {
name: 'index',
data() {
@ -256,7 +253,19 @@
},
methods:{
putStatus(id){
let data = {
id:1,
exchangeStatus:id,
}
oilDepotConfiguration(data).then(res =>{
if(res.code == 200){
this.$message.success("操作成功")
this.gettj()
}
})
},
getlist(){
this.queryParams.pageNo=this.pageNo
this.queryParams.pageSize=this.pageSize
@ -265,6 +274,7 @@
this.total = res.data.total;
})
},
posteid(data){
eitList(data).then(res=>{
if(res.code == 200){
@ -289,11 +299,16 @@
}
},
addBlock(){
if(this.ruleForm.quantity == '' ||this.ruleForm.cardAmount == '' ||this.ruleForm.status == '' ){
this.$message.error('必填项不能有空')
return
}
let data = this.ruleForm
addList(data).then(res=>{
if(res.code == 200){
this.$message.success('添加成功');
this.gettj()
this.getlist()
}else {
this.$message.error('操作失败请稍后再试');
}

View File

@ -19,7 +19,7 @@
:value="dict.oilName">
</el-option>
</el-select>
<el-select v-model="queryParams.status" placeholder="请选择" style="margin:0px 20px">
<el-select v-model="queryParams.activeStatus" placeholder="请选择" style="margin:0px 20px">
<el-option
v-for="item in option"
:key="item.value"
@ -184,12 +184,12 @@
</el-form-item>
<el-form-item label="锁价单价" prop="lockupPrice">
<el-input v-model="ruleForm.lockupPrice">
<el-input v-model="ruleForm.lockupPrice" min="1">
<template slot="append">/</template>
</el-input>
</el-form-item>
<el-form-item label="充值金额" prop="rechargeBalance">
<el-input v-model="ruleForm.rechargeBalance">
<el-input v-model="ruleForm.rechargeBalance" min="1">
<template slot="append"></template>
</el-input>
</el-form-item>
@ -274,10 +274,10 @@
label: '全部'
},
{
value: 'true',
value: '1',
label: '正常'
}, {
value: 'false',
value: '2',
label: '禁用'
},],
tableData: [],
@ -285,8 +285,8 @@
ruleForm:{
oilType:2,
lockupPrice: 0 ,
rechargeBalance:'',
incomeLitres:'',
rechargeBalance:0,
incomeLitres:0,
points:'',
status:'0',
activeTime:'1',
@ -295,7 +295,7 @@
queryParams:{
type:'柴油',
oilType:'',
status:'',
activeStatus:'',
pageNo:1,
pageSize:10,
},
@ -323,8 +323,28 @@
this.getlist()
},
watch:{
'ruleForm.rechargeBalance':{
handler: function() {
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
},
},
'ruleForm.lockupPrice':{
handler: function() {
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
},
}
},
computed: {
// : ,
// 使, , , ,
// , ,
totalCount () {
console.log('我是 computed 里的求和属性')
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
return this.ruleForm.incomeLitres
}
},
methods:{
radiovalue(){
@ -348,9 +368,9 @@
addoilBlock(){
this.ruleForm = {
type:this.queryParams.type,
lockupPrice: '' ,
rechargeBalance:'',
incomeLitres:'',
lockupPrice: 0 ,
rechargeBalance:0,
incomeLitres:0,
points:'',
activeTime:'1',
activeStatus:'1',