添加:供应商申请 - 驳回后修改信息

This commit is contained in:
wuhui_zzw 2024-01-30 18:10:04 +08:00
parent ea8fda7412
commit 9cb3fa95e1
7 changed files with 217 additions and 12 deletions

View File

@ -4,8 +4,14 @@ import request from "@/utils/request.js";
export function supplierApplyJoin(data) {
return request.post(`supplier/apply`, data);
}
// 入驻申请记录
export function supplierApplyRecord(data) {
return request.post(`supplier/apply_record`, data);
}
// 入驻申请记录
export function supplierApplyInfo(data) {
return request.get(`supplier/apply_info`, data);
}

View File

@ -1335,10 +1335,16 @@
"name": "supplier",
"pages": [
{
"path": "apply_join",
"path": "apply/apply_join",
"style": {
"navigationBarTitleText": "申请入驻"
}
},
{
"path": "apply/record",
"style": {
"navigationBarTitleText": "申请记录"
}
}

View File

@ -7,9 +7,9 @@
<!--表单内容-->
<view class='form-main'>
<!--申请记录查看按钮-->
<!--<view class="apply-record">-->
<!-- 申请记录 <text class="iconfont icon-xiangyou"></text>-->
<!--</view>-->
<view class="apply-record" @click="applyRecord">
申请记录 <text class="iconfont icon-xiangyou"></text>
</view>
<!--申请表单-->
<view class="list">
<view class="list-item list-input-item">
@ -148,7 +148,7 @@
import {mapGetters} from "vuex";
import authorize from '@/components/Authorize';
import {getSingleAgentInfo} from "@/api/agent";
import {supplierApplyJoin} from "@/api/supplier";
import {supplierApplyJoin, supplierApplyInfo} from "@/api/supplier";
export default {
name: 'business',
@ -160,6 +160,7 @@ export default {
},
data() {
return {
apply_id: 0,
apply_info:{
invite_agent_id: 0,
winery_name: '',
@ -187,13 +188,15 @@ export default {
onLoad(options) {
let _this = this;
if(options.scene){
console.log('转换前参数:',options.scene)
// console.log('',options.scene)
let scene = _this.$util.getUrlParams(decodeURIComponent(options.scene));
console.log("接收参数",scene)
// console.log("",scene)
this.apply_info.invite_agent_id = scene.agent_id || 0;
}
// ID
this.apply_id = options.apply_id || 0;
//
if(Number(_this.apply_info.invite_agent_id) <= 0){
if(Number(_this.apply_info.invite_agent_id) <= 0 && Number(this.apply_id) <= 0){
_this.$util.Tips({
title: '非法访问,无邀请人!',
},{tab:1,url:'/pages/user/index'});
@ -222,6 +225,7 @@ export default {
},
//
init () {
if(Number(this.apply_id) > 0) this.getApplyInfo();
this.getInviteAgentInfo()
},
//
@ -274,17 +278,37 @@ export default {
submitInfo(){
let _this = this;
supplierApplyJoin(_this.apply_info).then(res => {
console.log("提交结果",res)
if (res.status == 200) {
_this.$util.Tips({
title: '操作成功!',
},{
tab: 5,
url: '/pages/supplier/apply/record'
});
}
}).catch(err => {
this.$util.Tips({title: err});
});
},
//
applyRecord(){
uni.navigateTo({
url: `/pages/supplier/apply/record`
})
},
//
getApplyInfo(){
let _this = this;
supplierApplyInfo({ apply_id: _this.apply_id }).then(res => {
if (res.status == 200) {
let data = res.data || {};
_this.apply_info = data || {};
_this.getInviteAgentInfo();
}
}).catch(err => {
this.$util.Tips({title: err});
});
}

View File

@ -0,0 +1,169 @@
<template>
<view>
<view class="application-record" v-if="Object.values(list).length > 0">
<view class="card-list" v-for="(item,index) in list" :key="index">
<view class="card-top">
<view class="title">{{item.winery_name}}</view>
<view class="time">提交时间{{item.create_time}}</view>
<view v-if="item.reason && item.status == 2" class="reason">原因{{item.reason}}</view>
</view>
<view class="line"></view>
<view class="card-bottom">
<view class="card-status">
<image class="status-icon" v-if="item.status === 0" src="@/static/images/pending.png" mode=""></image>
<image class="status-icon" v-else-if="item.status === 1" src="@/static/images/passed.png" mode=""></image>
<image class="status-icon" v-else-if="item.status === 2" src="@/static/images/not-pass.png" mode=""></image>
<text class="status-text">{{statusText(item.status)}}</text>
</view>
<view class="status-btn" v-if="item.status == 2" @click="jump(item)">修改</view>
</view>
</view>
</view>
<emptyPage v-else title="暂无记录~"></emptyPage>
</view>
</template>
<script>
import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage.vue';
import {supplierApplyRecord} from "@/api/supplier";
export default {
components: {
emptyPage,
},
data() {
return {
list: [],
page: 1,
}
},
computed: {
...mapGetters(['isLogin', 'userInfo', 'viewColor'])
},
onLoad() {
this.getRecordList();
},
//
onReachBottom() {
this.getRecordList();
},
methods: {
//
getRecordList() {
let _this = this;
supplierApplyRecord({page: _this.page}).then(res => {
let list = res.data.list || {};
if (Object.values(list).length > 0) {
_this.list = _this.$util.SplitArray(list, _this.list);
_this.$set(_this, 'list', _this.list);
_this.page++;
}
}).catch(err => {
this.$util.Tips({
title: err
});
});
},
//
statusText(number) {
let statusData = {
0: "审核中",
1: "已通过",
2: "已驳回"
};
return statusData[number]
},
//
jump(item) {
uni.navigateTo({
url: `/pages/supplier/apply/apply_join?apply_id=${item.id}`
})
},
}
}
</script>
<style lang="scss" scoped>
.application-record {
display: flex;
flex-direction: column;
align-items: center;
background-color: #F5F5F5;
padding: 20rpx 30rpx;
.card-list {
width: 100%;
background-color: #fff;
padding: 20rpx 24rpx;
margin: 10rpx 20rpx;
border-radius: 12rpx;
.card-top {
height: 140rpx;
.title {
font-size: 28rpx;
font-weight: bold;
color: #333333;
}
.time {
color: #999999;
font-size: 24rpx;
padding: 5rpx 0;
}
.reason {
color: #E93323;
font-weight: bold;
font-size: 24rpx;
}
}
.line {
height: 2rpx;
margin: 20rpx 0 20rpx 0;
background-color: #EEEEEE;
}
.card-bottom {
display: flex;
justify-content: space-between;
align-items: center;
color: #333;
.card-status {
display: flex;
align-items: center;
.status-icon {
width: 30rpx;
height: 30rpx;
margin: 10rpx;
}
.status-text {
font-size: 28rpx;
font-weight: 500;
}
}
.status-btn {
font-size: 26rpx;
color: #555;
border: 1px solid #999999;
padding: 8rpx 32rpx;
border-radius: 40rpx;
}
}
}
}
.no-shop {
width: 100%;
background-color: #fff;
height: 100vh;
.pictrue {
display: flex;
flex-direction: column;
align-items: center;
color: $uni-nothing-text;
image {
width: 414rpx;
height: 380rpx;
}
}
}
</style>

BIN
static/images/not-pass.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

BIN
static/images/passed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

BIN
static/images/pending.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B