This commit is contained in:
weipengfei 2024-03-21 11:21:29 +08:00
parent b92ef54b5f
commit 6b11dd932c
4 changed files with 125 additions and 12 deletions

View File

@ -363,4 +363,22 @@ export function getSubsidyRecord(merId, data) {
return request.get(`server/${merId}/subsidyRecord`, data, {
login: true
});
}
/*
领取补贴
*/
export function couponReceive(id, data) {
return request.post(`coupon/receive/${id}`, data, {
login: true
});
}
/*
领取补贴
*/
export function couponRefuse(id, data) {
return request.post(`coupon/refuse/{id}`, data, {
login: true
});
}

View File

@ -10,8 +10,8 @@ let wsApi
// 在打包之前请检查当前环境是否正确
// const env = 'dev'; // 开发
const env = 'prod'; // 生产
// const env = 'prew'; // 预上线
// const env = 'prod'; // 生产
const env = 'prew'; // 预上线
switch (env) {
case 'prod':

View File

@ -30,7 +30,7 @@
<view class="body" >
<view class="b-card" v-if="type==1">
<view class="b-top">
<view>春耕采购金额{{info.spring_subsidy_amount}}</view>
<view>春耕采购金额{{info.spring_subsidy}}</view>
<view>剩余金额{{info.balance}}</view>
</view>
<view class="b-bottom">
@ -98,7 +98,7 @@
<view class="b-tips" v-if="type==1">
*春耕采购余额使用完采购金额和销售金额达到后才可获取补贴
</view>
<view class="b-list" v-else>
<view class="b-list">
<view class="list-head"></view>
<view class="list-body">
<view class="list-b-title">
@ -112,9 +112,9 @@
<view class="item2">{{ item.extra.sale_target }}</view>
<view class="item3" v-if="item.status!=1">{{ cPrice(item.coupon_price) }}</view>
<view class="item3" v-else>{{ item.coupon_price }}</view>
<view class="item4">
<view class="item4" @click="showPopup(item.send_status, item.id)">
<!-- send_status 发放状态-1未激活0待审核1待领取2已完成 -->
<text v-if="item.send_status==2" style="color: #FF5E0C;">{{item.send_status_cn}}</text>
<text v-if="item.send_status==2||item.send_status==1" style="color: #FF5E0C;">{{item.send_status_cn}}</text>
<text v-else>{{item.send_status_cn}}</text>
</view>
</view>
@ -123,13 +123,50 @@
</view>
</view>
</view>
<uni-popup type="center" ref="pupRef">
<view style="width: 630rpx;height: 500rpx;position: relative;">
<view style="position: absolute;top: 0;right: 10rpx;" @click="closePopup">
<image style="width: 50rpx;height: 50rpx;" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/c8b19202403201714381681.webp"></image>
</view>
<view style="width: 630rpx;position: absolute;top: 70rpx;right: 0;" :class="[send_status_cn>0?'h430':'h310']">
<image style="width: 100%;" :class="[send_status_cn>0?'h430':'h310']" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/23ad8202403201716417527.webp"></image>
<view style="position: absolute;top: 0;left: 0;width: 100%;height: 100%;padding: 30rpx;display: flex;flex-direction: column;justify-content: center;">
<view style="padding-bottom: 50rpx;font-size: 32rpx;color: #2E2E2E;">
<text v-if="send_status_cn==-1">补贴未激活</text>
<text v-else-if="send_status_cn==0">补贴审核中</text>
<text v-else-if="send_status_cn==1">补贴待领取</text>
<text v-else-if="send_status_cn==10">请填写错误内容</text>
</view>
<view style="color: #7A7A7A;font-size: 28rpx;">
<text v-if="send_status_cn==-1">当前采购目标金额销售目标金额未完成无法提交报审</text>
<text v-else-if="send_status_cn==0">你的补贴申请已提交报审审核周期为3个月内审核完成后将会以短信形式通知</text>
<text v-else-if="send_status_cn==1">
请核对补贴金额是否正确如有疑问请联系工作人员
电话13627640188
</text>
</view>
<view v-if="send_status_cn==10" style="background-color: #fff;border-radius: 20rpx;padding: 20rpx;">
<textarea v-model="reason" placeholder="请填写错误内容" style="height: 100rpx;"/>
</view>
<view v-if="send_status_cn==1" style="display: flex;justify-content: center;margin-top: 30rpx;color: #F98144;">
<view @click="reAudit" style="padding: 9rpx 50rpx 12rpx 50rpx;border-radius: 40rpx;border: 4rpx solid #F98144;margin-right: 100rpx;">错误</view>
<view @click="couponReceive" style="padding: 9rpx 50rpx 12rpx 50rpx;border-radius: 40rpx;border: 4rpx solid #F98144;color: #FFF;background-color: #F98144;">正确</view>
</view>
<view v-else-if="send_status_cn==10" style="display: flex;justify-content: center;margin-top: 30rpx;color: #F98144;">
<view @click="couponRefuse" style="padding: 9rpx 50rpx 12rpx 50rpx;border-radius: 40rpx;border: 4rpx solid #F98144;color: #FFF;background-color: #F98144;">提交</view>
</view>
</view>
</view>
</view>
</uni-popup>
</view>
</view>
</template>
<script>
import { getSubsidy, getSubsidyRecord } from "@/api/admin.js"
import { getSubsidy, getSubsidyRecord, couponReceive, couponRefuse } from "@/api/admin.js"
import { Toast } from "../../libs/uniApi";
export default {
data() {
return {
@ -137,6 +174,9 @@
mer_id: '',
info: {},
list: [],
send_status_cn: '1',
send_id: 0,
reason: '',
where:{
page: 1,
limit: 20,
@ -154,16 +194,28 @@
this.mer_id = user.service.mer_id;
this.getSubsidy();
if(this.type==2)this.getSubsidyRecord();
this.$nextTick(res=>{
this.$refs.pupRef.open();
})
},
onShow() {},
methods: {
showPopup(type, send_id){
this.send_status_cn = type;
this.send_id = send_id;
if(type==2) Toast('已经领取过啦');
else this.$refs.pupRef.open();
},
closePopup(){
this.$refs.pupRef.close();
},
back() {
uni.navigateBack();
},
changeType(type){
this.type = type;
this.getSubsidy();
if(type==2)this.getSubsidyRecord();
this.getSubsidyRecord();
},
getSubsidy(){
if(!this.mer_id) return ;
@ -173,6 +225,36 @@
this.info = res.data;
})
},
couponReceive(){
this.closePopup();
couponReceive(this.send_id).then(res=>{
this.$nextTick(()=>{
Toast('领取成功')
})
}).catch(err=>{
this.$nextTick(()=>{
Toast(err)
})
})
},
reAudit(){
this.send_status_cn = 10;
},
couponRefuse(){
if(this.reason=='') return Toast('错误内容不能为空');
this.closePopup();
couponRefuse(this.send_id, {
reason: this.reason
}).then(res=>{
this.$nextTick(()=>{
Toast('提交成功')
})
}).catch(err=>{
this.$nextTick(()=>{
Toast(err)
})
})
},
getSubsidyRecord(){
getSubsidyRecord(this.mer_id, this.where).then(res=>{
this.list = res.data.record;
@ -345,6 +427,7 @@
.b-tips{
color: #7A7A7A;
font-size: 24rpx;
margin-bottom: 30rpx;
}
.b-list{
.list-head{
@ -392,4 +475,10 @@
}
}
}
.h430{
height: 430rpx;
}
.h310{
height: 310rpx;
}
</style>

View File

@ -490,10 +490,10 @@
name: '本月订单数',
value: 0
}, {
name: '补贴金额',
name: '补贴',
value: 0
}, {
name: '生产资料包余额',
name: '春耕采购余额',
value: 0
}, {
name: '今日订单数',
@ -1334,8 +1334,14 @@
storeActivityTotal().then(res => {
res.data.forEach(item => {
if (item.type == 1) this.list[4].value = item.total_amount;
if (item.type == 2) this.list[3].value = item.total_amount;
if (item.type == 13) {
this.list[4].value = item.total_amount;
this.list[4].name = item.type_cn;
}
if (item.type == 2) {
this.list[3].value = item.total_amount;
this.list[3].name = item.type_cn;
}
})
})
}