123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <template>
- <view class="content">
- <view class="title">
- <view class="item" :class="active_item == 0?'active':''" @click="click_btn(0)">全部</view>
- <view class="item" :class="active_item == 1?'active':''" @click="click_btn(1)">待审核</view>
- <view class="item" :class="active_item == 2?'active':''" @click="click_btn(2)">已通过</view>
- <view class="item" :class="active_item == 3?'active':''" @click="click_btn(3)">被驳回</view>
- </view>
- <view class="list">
- <view class="item" v-for="(item,index) in list" :key="index" v-if="active_item == 0" :style="item.state == 3?'border-top-color: red;':''">
- <view class="top">
- <view class="user">
- <view class="img" v-if="item.staff_avatar">
- <image :src="item.staff_avatar" mode="aspectFill"></image>
- </view>
- <view class="info">
- <view class="text">{{item.section}}{{item.staff}}</view>
- <view class="text">编号:#{{item.id}} {{item.created_at}}</view>
- </view>
- </view>
- <view class="state" v-if="item.state == 1">{{item.status}}</view>
- <view class="state" v-if="item.state == 2">{{item.status}}</view>
- <view class="state" v-if="item.state == 3" style="color: red;">{{item.status}}</view>
- </view>
- <view class="inner">
- <view class="class_name">{{item.classify}} : </view>
- <view class="name">{{item.title}}</view>
- <view class="tip">{{item.introduce}}</view>
- </view>
- <view class="bottom">
- <view class="btn" style="background-color: #FDDD9B; margin-right: 10px;" v-if="item.state == 1" @click="del_btn(item.id,item.title)">撤回</view>
- <view class="btn" @click="go_chakan(item.id,item.title)">查看</view>
- </view>
- </view>
- <view class="item" v-for="(item,index) in list" :key="index" v-if="active_item == 1 && item.state == 1">
- <view class="top">
- <view class="user">
- <!-- <view class="img">
- <image :src="item.staff_avatar" mode="aspectFill"></image>
- </view> -->
- <view class="info">
- <view class="text">{{item.section}}{{item.staff}}</view>
- <view class="text">编号:#{{item.id}} {{item.created_at}}</view>
- </view>
- </view>
- <view class="state" v-if="item.state == 1">{{item.status}}</view>
- </view>
- <view class="inner">
- <view class="class_name">{{item.classify}} : </view>
- <view class="name">{{item.title}}</view>
- <view class="tip">{{item.introduce}}</view>
- </view>
- <view class="bottom">
- <view class="btn" style="background-color: #FDDD9B; margin-right: 10px;" v-if="item.state == 1" @click="del_btn(item.id,item.title)">撤回</view>
- <view class="btn" @click="go_chakan(item.id,item.title)">查看</view>
- </view>
- </view>
- <view class="item" v-for="(item,index) in list" :key="index" v-if="active_item == 2 && item.state == 2">
- <view class="top">
- <view class="user">
- <!-- <view class="img">
- <image :src="item.staff_avatar" mode="aspectFill"></image>
- </view> -->
- <view class="info">
- <view class="text">{{item.section}}{{item.staff}}</view>
- <view class="text">编号:#{{item.id}} {{item.created_at}}</view>
- </view>
- </view>
-
- <view class="state" v-if="item.state == 2">{{item.status}}</view>
- </view>
- <view class="inner">
- <view class="class_name">{{item.classify}} : </view>
- <view class="name">{{item.title}}</view>
- <view class="tip">{{item.introduce}}</view>
- </view>
- <view class="bottom">
- <view class="btn" @click="go_chakan(item.id,item.title)">查看</view>
- </view>
- </view>
- <view class="item" v-for="(item,index) in list" :key="index" v-if="active_item == 3 && item.state == 3" style="border-top-color: red;">
- <view class="top">
- <view class="user">
- <!-- <view class="img">
- <image :src="item.staff_avatar" mode="aspectFill"></image>
- </view> -->
- <view class="info">
- <view class="text">{{item.section}}{{item.staff}}</view>
- <view class="text">编号:#{{item.id}} {{item.created_at}}</view>
- </view>
- </view>
-
- <view class="state" v-if="item.state == 3" style="color: red;">{{item.status}}</view>
- </view>
- <view class="inner">
- <view class="class_name">{{item.classify}} : </view>
- <view class="name">{{item.title}}</view>
- <view class="tip">{{item.introduce}}</view>
- </view>
- <view class="bottom">
- <view class="btn" @click="go_chakan(item.id,item.title)">查看</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- active_item:0,
- list:[],
-
-
- page:1,
- page_size:10,
- state:0
- };
- },
- onLoad() {
- this.get_worksheet_apply_listmei()
- },
- onReachBottom(){
- console.log("++")
- this.page++
- this.get_worksheet_apply_listmei()
- },
- methods:{
- // 切换列表
- click_btn(item){
- this.active_item = item
- this.state = item
- this.page = 1
- this.list = []
- // 刷新数据
- this.get_worksheet_apply_listmei()
- },
- go_chakan(id,title){
- console.log(id,title)
-
- uni.navigateTo({
- url:"chakan/chakan?id=" + id + "&title=" + title
- })
- },
- get_worksheet_apply_listmei(){
- uni.showLoading()
-
- this.$api.worksheet_apply_listmei({
- page:this.page,
- size:this.page_size,
- state:this.state,
- }).then((res)=>{
- // console.log(res.data.data)
- if(this.page == 1 && res.data.data == 0){
- this.list = []
- }else{
- this.list = this.list.concat(res.data.data)
- }
-
- uni.hideLoading()
- })
- },
-
- // 撤回
- del_btn(id,title){
- console.log(id,title)
-
- uni.showModal({
- title: '撤回提醒',
- content: '是否撤回' + title + '?',
- success: (res) => {
- if (res.confirm) {
- // console.log('用户点击确定');
- this.$api.worksheet_orderdel({
- id:id
- }).then((res)=>{
- // console.log(res)
-
- this.get_worksheet_apply_listmei()
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
-
- }
- }
- }
- </script>
- <style lang="scss">
- .content{
- width: 749rpx;
- }
-
- .title{
- height: 43px;
- display: flex;
-
- border-bottom: 1px solid #E4E4E4;
- .item{
- width: 249rpx;
- line-height: 43px;
- text-align: center;
- font-size: 16px;
- color: #BDC3C7;
- }
- .active{
- border-bottom: 2px solid #16A085;
- color: #16A085;
- }
- }
-
- .list{
- box-sizing: border-box;
- padding: 24rpx;
- .item{
- width: 700rpx;
- border-radius: 6px;
- border: 1px solid #EDEFF9;
- border-top: 2px solid #00D983;
-
- box-sizing: border-box;
- padding: 10px 25rpx;
-
- margin-bottom: 15px;
- .top{
- display: flex;
- justify-content: space-between;
- .user{
- display: flex;
- .img{
- width: 60px;
- height: 60px;
- border-radius: 50%;
- overflow: hidden;
- image{
- width: 60px;
- height: 60px;
- }
- }
- .info{
- margin-left: 10rpx;
- height: 60px;
- .text{
- line-height: 25px;
- font-size: 12px;
- }
- }
- }
- .state{
- width: 150rpx;
- text-align: right;
- line-height: 25px;
- font-size: 12px;
- color: #2ECC71;
- }
-
- }
- .inner{
- margin: 10px auto;
- width: 650rpx;
- border: 1px solid #EDEFF9;
- border-radius: 6px;
- box-sizing: border-box;
- padding: 10px;
- font-size: 12px;
- .class_name{
- line-height: 20px;
- color: #3498DB;
- }
- .name{
- line-height: 20px;
- }
- .tip{
- line-height: 20px;
- text-indent: 2em;
- }
- }
- .bottom{
- text-align: right;
- .btn{
- display: inline-block;
- width: 80px;
- text-align: center;
- line-height: 30px;
- font-size: 12px;
- color: #FFFFFF;
- background-color: #3498DB;
- }
- }
- }
- }
- </style>
|