You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
apply-assistant-v3/root/person/applyManage.vue

113 lines
3.0 KiB
Vue

<template>
<div class="g_pb_32">
<div v-for="(item, index) in applyList">
<div class="g_pb_8 g_pt_16 g_pl_16 g_border_e_b g_c_9">
{{ index == "near" ? "近三天" : "三天前" }}
</div>
<div class="g_flex_row_between flex_center i-items" style="padding: 20px 16px 8px" v-for="i in item" :key="item.id">
<div class="g_mr_12">
<img class="g_w_48 g_h_48 g_radius_50" :src="i.imgSrc || 'https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/APP/default.svg'" alt="" />
</div>
<div class="g_flex_row_between flex_center g_flex_1 g_h_48">
<div>
<div class="g_fs_18">
{{ i.applyUsername }}
</div>
<div class="g_fs_14 g_c_9 g_mt_4">
{{ i.userName }}
</div>
</div>
<div>
<span v-if="i.past && i.status === 0" class="g_fs_14 g_c_9">已过期</span>
<span v-else-if="i.status == 1" class="g_fs_14 g_c_9">已通过</span>
<span v-else-if="i.status == 2" class="g_fs_14 g_c_9">已拒绝</span>
<div class="g_flex_row_end" v-else>
<div class="g_mr_8">
<g-button btnText="拒绝" fontSize="14" color="#000" customBgColor="#d8d8d8" size="height" type="disabled" height="24" width="50" @clickBtn="approve(i, 'reject')"></g-button>
</div>
<div>
<g-button btnText="通过" type="primary" fontSize="14" size="height" height="24" width="50" @clickBtn="approve(i, 'resolve')"></g-button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
applyList: [],
query: { page: 1, size: 30 },
};
},
onShow() {
this.getUserApplyList();
},
created() {},
methods: {
getUserApplyList() {
let that = this;
this.G.Post(this.api.order_getUserApplyList, { pageNum: that.query.page, pageSize: that.query.size }, (res) => {
console.log("order_getUserApplyList", res);
let obj = {
near: [],
far: [],
};
res.forEach((item) => {
let diffTime = new Date().getTime() - item.createTime;
if (diffTime <= 3 * 24 * 60 * 60 * 1000) {
obj.near.push(item);
} else {
if (diffTime > 10 * 24 * 60 * 60 * 1000) {
item.past = true;
} else {
item.past = false;
}
obj.far.push(item);
}
});
that.applyList = obj;
});
},
approve(_item, type) {
console.log(_item);
console.log(type);
// return;
this.G.Post(this.api.order_userApplyApprove, { id: _item.id, status: type == "reject" ? 2 : 1 }, (res) => {
console.log(res);
_item.status = type == "reject" ? 2 : 1;
uni.showToast({
title: "操作成功",
icon: "none",
});
});
},
},
};
</script>
<style lang="scss">
.i-items {
// border-bottom: 1px solid #eee;
position: relative;
&:not(:first-child):after {
content: "";
display: block;
height: 1rpx;
width: calc(100% - 76px);
background: #eee;
position: absolute;
bottom: 0;
right: 0;
}
// &:last-child:after {
// border-bottom: none;
// }
}
</style>