shop-applet/pages/commissionedSales/initiateDelegation/index.vue

1032 lines
22 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<view class="content_top">
<!--选项卡滑动切换-->
<cxNavTitle :tabs="tabs" :activeItem="activeItem" @tabClick="tabClick" :show='false'></cxNavTitle>
</view>
<!-- 审核通过 打折的拒绝同意功能 调货不需要功能 -->
<view class="content-content" v-for="(item,i) in orderList" :key="i">
<view class="content-one">
<view class="content-one-img">
<!-- <image :src="item.mer_info&&item.mer_info.mer_avatar" mode="aspectFit"></image> -->
<image :src="item.entrust_mer_info&&item.entrust_mer_info.mer_avatar" mode="aspectFill"></image>
</view>
<view class="content-text">
<view class="flex" style="justify-content: space-between;">
<view class="one-txt-a">
{{item.title}}
</view>
<block>
<view class="content-two_one" v-if="item.mer_status==0">
<view class="content-two-edita" style="font-weight: bold;">
待处理
</view>
</view>
<view class="content-two_oneq" v-if="item.mer_status==1">
<view class="content-two-editb" @click="accepted" style="font-weight: bold;">
已接受
</view>
</view>
<view class="content-two_one" v-if="item.mer_status==2">
<view class="content-two-editc" @click="declined" style="font-weight: bold;">
已拒绝
</view>
</view>
<view class="content-two_one" v-if="item.type==4" style="font-weight: bold;">
<view class="content-two-editd" @click="soldEdit">
已完成
</view>
</view>
</block>
</view>
<view class="text-bottom">
<view class="one-txt-b">
委托周期:{{item.entrust_day}}天
</view>
<block>
<view class="content-two_one" v-if="item.mer_status==0">
<view class="contentgn">
<view class="contentgn_a" style="margin-left: 10rpx;" @click="Edit(item)">
编辑
</view>
<span></span>
<view class="contentgn_a" style="margin-left: 10rpx;" @click="deleteOrder(item)">
删除
</view>
<span></span>
<view class="contentgn_b" @click="detail(item)">
详情
</view>
</view>
</view>
<view class="content-two_oneq" v-if="item.mer_status==1">
<view class="contentgn">
<view class="contentgn_a" @click="closingorder(item)" v-if="item.entrust_finish==3">
结束委托
</view>
<span v-if="item.entrust_finish==3"></span>
<view class="contentgn_b" @click="detail(item)">
详情
</view>
</view>
</view>
<view class="content-two_one" v-if="item.mer_status==2">
<view class="contentgn">
<!--<view class="contentgn_a" @click="deleteOrder(item)">
删除
</view>
<span></span> -->
<view class="contentgn_b" @click="detail(item)">
详情
</view>
</view>
</view>
<view class="content-two_one" v-if="item.type==4">
<view class="contentgn">
<view class="contentgn_a" @click="deleteOrder(item)">
删除
</view>
<span></span>
<view class="contentgn_b" @click="detail(item)">
详情
</view>
</view>
</view>
</block>
</view>
</view>
</view>
</view>
<view class="adddelegation" @click="addDelegation">
<view class="adddelegation-one">
<image src="@/static/images/delegation.png" mode=""></image>
</view>
<view class="adddelegation-two">
新增委托
</view>
</view>
<view v-if="orderList.length == 0">
<emptyPage title="暂无订单~"></emptyPage>
</view>
<u-loadmore :status="status" v-if="orderList.length >= where.limit" />
<view style="height: 200rpx;"></view>
<uni-popup ref="bindmobile" type="center" @click="close">
<view class="" style="position: relative;">
<view class="entrust">
<view class="entrust_close" @click="close">
<image src="@/static/images/wt_close.png" mode=""></image>
</view>
<view class="entrust_bg">
<view class="entrust_bg-content">
<view class="bg-content-a">
委托申请处理
</view>
<view class="bg-content-b">
结算周期: <span>{{obj.settle_cycle}}天</span>
</view>
<view class="bg-content-c">
利息比例: <span>{{obj.interest_rate}}%</span>
</view>
<view class="entrust_bga_btn">
<view class="cancellation" @click="passDelete(obj)">
拒绝
</view>
<view class="determine" @click="passagree(obj)">
接受
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="bindmobile1" type="center" @click="close">
<view class="" style="position: relative;">
<view class="entrust">
<view class="entrust_close" @click="close">
<image src="@/static/images/wt_close.png" mode=""></image>
</view>
<view class="entrust_bga">
<view class="entrust_bg-content">
<view class="bg-content-a">
确定结束委托?
</view>
<view class="entrust_bga_btn">
<view class="cancellation">
取消
</view>
<view class="determine">
确定
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="bindmobile2" type="center" @click="close">
<view class="" style="position: relative;">
<view class="entrust">
<view class="entrust_close" @click="close">
<image src="@/static/images/wt_close.png" mode=""></image>
</view>
<view class="entrust_bg">
<view class="entrust_bg-content">
<view class="bg-content-a" style="margin-left: 207rpx;">
结束委托申请处理
</view>
<view class="bg-content-b" v-if="obj.mer_info">
结算周期: <span>{{obj.mer_info.settle_cycle}}天</span>
</view>
<view class="bg-content-c" v-if="obj.mer_info">
利息比例: <span>{{obj.mer_info.interest_rate}}%</span>
</view>
<view class="entrust_bga_btn">
<view class="cancellation" @click="refused">
拒绝
</view>
<view class="determine" @click="agree(obj, 1)">
接受
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="bindmobile3" type="center" @click="close">
<view class="" style="position: relative;">
<view class="entrust">
<view class="entrust_close" @click="close">
<image src="@/static/images/wt_close.png" mode=""></image>
</view>
<view class="entrust_bgb">
<view class="entrust_bg-content">
<view class="bg-content-a" style="margin-left: 207rpx;">
结束委托申请处理
</view>
<view class="bg-content-b" v-if="obj.mer_info">
结算周期: <span>{{obj.mer_info.settle_cycle}}天</span>
</view>
<view class="bg-content-c" v-if="obj.mer_info">
利息比例: <span>{{obj.mer_info.interest_rate}}%</span>
</view>
<view class="bg-content-c">
拒绝原因:
<view class="" style="margin-top: 21rpx;">
<textarea v-model="refuseds" placeholder="输入拒绝原因" class="bg-content_textarea" />
</view>
</view>
<view class="entrust_bga_btn" @click="agree(obj)">
<view class="determine">
接受
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import cxNavTitle from '@/components/cx-navTitle.vue'
import emptyPage from '@/components/emptyPage.vue';
import {
entrustlist,
finishchain,
checkchain,
finishentrust
} from '@/api/sale.js'
export default {
components: {
cxNavTitle,
emptyPage,
},
data() {
return {
activeItem: "tabOne",
status: 'loadmore',
tabTitle: "",
orderList: [],
where: {
page: 1,
limit: 10,
type: 1,
status: 0
},
tabs: [{
name: "tabOne",
label: '待处理',
type: 0
},
{
name: "tabTwo",
label: '已接受',
type: 1
},
{
name: "tabThree",
label: '已拒绝',
type: 2
},
],
list: [{
content: '张三生产资料供销供应链',
day: 10,
type: 1
},
{
content: '张三生产资料供销供应链',
day: 10,
type: 2
},
{
content: '张三生产资料供销供应链',
day: 10,
type: 3
},
{
content: '张三生产资料供销供应链',
day: 10,
type: 4
}
],
obj: {},
refuseds: ''
}
},
onLoad() {
this.tabTitle = this.tabs[0].name
//有时进入页面需要获取默认的第一个标签做逻辑判断 -- 如下:
// console.log(this.tabs[0])
},
mounted() {
this.commislist()
},
methods: {
onReachBottom() {
if (this.status == 'nomore') return;
this.status = 'loading';
this.where.page = ++this.where.page;
this.commislist()
},
nav(item) {
// uni.navigateTo({
// url: '/pages/commissionedSales/delegation_details/index'
// })
},
//获取分类数据
commislist() {
entrustlist(this.where).then((res) => {
this.orderList.push(...res.data.list)
if (res.data.list.length < this.where.limit) this.status = 'nomore'
if (this.where.page == 1 && res.data.list.length <= 0) this.emptyShow = true
})
},
//选择
tabClick(e) { //点击获取当前标签数据
this.activeItem = e.name; //当前class类名
this.tabTitle = e.name; //当前选的标签名
this.where.page = 1
this.orderList = []
this.where.status = e.type
this.commislist()
},
//编辑委托
Edit(item) {
uni.navigateTo({
url: '/pages/commissionedSales/addDelegation/index?id=' + item.community_id + '&type=edit'
})
},
//新增委托
addDelegation() {
uni.navigateTo({
url: '/pages/commissionedSales/addDelegation/index'
})
},
//管理弹窗
close() {
this.$refs.bindmobile.close()
this.$refs.bindmobile1.close()
this.$refs.bindmobile2.close()
this.$refs.bindmobile3.close()
},
//提交订单
order(item) {
if (item.mer_status == 0 && entrust_order_id != 0) {
uni.navigateTo({
url: '/pages/commissionedSales/delegation_details/index?id=' + item.community_id
})
} else {
this.$util.Tips({
title: '商家还没同意该订单',
icon: 'err'
})
}
},
//详情
detail(item) {
uni.navigateTo({
url: `/pages/commissionedSales/delegation_details/index?id=${item.community_id}&credit_buy=${item.mer_info.credit_buy}`
})
},
// 待处理
soldEdit(item) {
this.obj = item
console.log(item)
this.$refs.bindmobile.open()
},
//已接受
accepted() {
},
//结束委托
closingorder(item) {
console.log(item)
this.obj = item
this.$refs.bindmobile2.open()
// this.$refs.bindmobile3.open()
},
//拒绝申请委托
refused() {
this.$refs.bindmobile2.close()
setTimeout(() => {
this.$refs.bindmobile3.open()
}, 1000)
},
// 已拒绝
declined() {
// this.$refs.bindmobile2.open()
this.$refs.bindmobile3.open()
},
agree(item, status=2) {
finishentrust(item.community_id, {
status: status,
refusal: this.refuseds
}).then(res => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.orderList = []
this.tabTitle = "tabTwo"
this.$refs.bindmobile2.close()
this.$refs.bindmobile3.close()
this.commislist()
})
},
//删除订单
deleteOrder(item) {
uni.showModal({
title:'警告',
content:'删除后不可恢复, 是否继续删除?',
complete: (e) => {
if(e.confirm){
checkchain(item.community_id, {
status: 3
}).then(res => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.orderList = []
this.tabTitle = "tabOne"
this.commislist()
}).catch((err) => {
console.log(err)
this.$util.Tips({
title: err,
icon: 'error'
})
})
}
}
})
},
// 审核未通过 编辑
auditEdit() {
},
//审核通过 拒绝
passDelete(item) {
checkchain(item.community_id, {
status: 2
}).then((res) => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.orderList = []
this.tabTitle = "tabOne"
this.commislist()
})
},
//审核通过 同意
passagree(item) {
checkchain(item.community_id, {
status: 1
}).then((res) => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.orderList = []
this.tabTitle = "tabOne"
this.commislist()
this.$refs.bindmobile.close()
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
position: relative;
}
.content_top {
background-color: #FFFFFF;
}
.adddelegation {
width: 694rpx;
height: 95rpx;
background: linear-gradient(276deg, #F98649 0%, #F34E45 100%);
box-shadow: 0 5rpx 11rpx 2rpx rgba(136, 20, 7, 0.3);
border-radius: 47rpx 47rpx 47rpx 47rpx;
opacity: 1;
display: flex;
position: fixed;
// position: absolute;
bottom: 84rpx;
left: 50%;
margin-left: -347rpx;
.adddelegation-one {
width: 50rpx;
margin-right: 30rpx;
height: 50rpx;
margin-left: 242rpx;
margin-top: 21rpx;
image {
width: 50rpx;
height: 50rpx;
}
}
.adddelegation-two {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin-top: 25rpx;
}
}
.content_top {
width: 100%;
}
.content-content {
margin-top: 21rpx;
background: #FFFFFF;
padding: 0 28rpx;
padding-top: 28rpx;
background: #FFFFFF;
position: relative;
display: flex;
justify-content: space-between;
.content-one {
width: 100%;
display: flex;
padding-bottom: 23rpx;
.content-one-img {
width: 148rpx;
height: 148rpx;
margin-right: 28rpx;
// border: 1px solid;
border-radius: 10rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.content-one-txt {
.txt-b-a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.one-txt-b {
display: flex;
margin-top: 30rpx;
.txt-b-a {
font-size: 32rpx;
font-family: SF Pro Display-Medium, SF Pro Display;
font-weight: 500;
color: #F84221;
margin-right: 74rpx;
}
.txt-b-b {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333
}
}
}
.content-text{
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
.text-bottom{
display: flex;
justify-content: space-between;
}
.one-txt-a{
flex: 1;
font-size: 30rpx;
display: -webkit-box;
-webkit-line-clamp: 2; /* 限制为三行 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.content-two_oneq {
flex-shrink: 0;
text-align: right;
.content-two-edita {
font-size: 32rpx;
font-weight: 500;
color: #F84221;
}
.content-two-editb {
font-size: 32rpx;
font-weight: 500;
color: #FE9A10;
}
.content-two-editc {
font-size: 32rpx;
font-weight: 500;
color: #20A162;
}
.content-two-editd {
font-size: 32rpx;
font-weight: 500;
color: #999999;
}
.contentgn {
display: flex;
justify-content: space-between;
// margin-top: 47rpx;
.contentgn_a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #F84221;
margin-right: 10rpx;
}
span {
width: 0px;
height: 30rpx;
opacity: 1;
margin-top: 10rpx;
border: 2rpx solid #CCCCCC;
}
.contentgn_b {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 10rpx;
}
}
}
.content-two_one {
flex-shrink: 0;
text-align: right;
.content-two-edita {
font-size: 32rpx;
font-weight: 500;
color: #F84221;
}
.content-two-editb {
font-size: 32rpx;
font-weight: 500;
color: #FE9A10;
}
.content-two-editc {
font-size: 32rpx;
font-weight: 500;
color: #20A162;
}
.content-two-editd {
font-size: 32rpx;
font-weight: 500;
color: #999999;
}
.contentgn {
display: flex;
justify-content: space-between;
// margin-top: 47rpx;
.contentgn_a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #F84221;
margin-right: 10rpx;
}
span {
width: 1px;
height: 30rpx;
opacity: 1;
margin-top: 8rpx;
background-color: #cccccc;
}
.contentgn_b {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 10rpx;
}
}
}
}
.entrust {
.entrust_close {
width: 44rpx;
height: 44rpx;
image {
width: 100%;
height: 100%;
}
z-index: 99999;
position: absolute;
right: 0;
}
.entrust_bg {
width: 694rpx;
height: 676rpx;
background: url('@/static/images/wtbg3.png') no-repeat;
background-size: 100% 100%;
position: relative;
.entrust_bg-content {
position: absolute;
top: 284rpx;
.bg-content-a {
margin-left: 242rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.bg-content-b {
margin-left: 35rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 32rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
}
}
.bg-content-c {
margin-left: 35rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 32rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
}
}
}
.entrust_bga_btn {
display: flex;
margin-top: 53rpx;
.cancellation {
height: 95rpx;
line-height: 95rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 121rpx;
margin-right: 49rpx;
}
.determine {
width: 249rpx;
height: 95rpx;
line-height: 95rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
border-radius: 47rpx 47rpx 47rpx 47rpx;
}
}
}
.entrust_bga {
width: 694rpx;
height: 520rpx;
background: url('@/static/images/wtbg4.png') no-repeat;
background-size: 100% 100%;
position: relative;
.entrust_bg-content {
position: absolute;
top: 284rpx;
.bg-content-a {
margin-left: 242rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.entrust_bga_btn {
display: flex;
margin-top: 53rpx;
.cancellation {
height: 95rpx;
line-height: 95rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 121rpx;
margin-right: 49rpx;
}
.determine {
width: 249rpx;
height: 95rpx;
line-height: 95rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
border-radius: 47rpx 47rpx 47rpx 47rpx;
}
}
}
}
.entrust_bgb {
width: 694rpx;
height: 994rpx;
background: url('@/static/images/wtbg5.png') no-repeat;
background-size: 100% 100%;
position: relative;
.entrust_bg-content {
position: absolute;
top: 304rpx;
.bg-content-a {
margin-left: 242rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.bg-content-b {
margin-left: 35rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 32rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
}
}
.bg-content-c {
margin-left: 35rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 22rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
}
}
.bg-content_textarea {
width: 624rpx;
height: 242rpx;
padding: 25rpx 18rpx;
background: #F5F5F5;
}
}
.entrust_bga_btn {
display: flex;
margin-top: 33rpx;
.determine {
margin-left: 188rpx;
width: 249rpx;
height: 95rpx;
line-height: 95rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
border-radius: 47rpx 47rpx 47rpx 47rpx;
}
}
}
}
</style>