OA/pages/personneltransfer/index.vue

384 lines
7.1 KiB
Vue
Raw Normal View History

2023-11-05 00:11:08 +08:00
<template>
<view>
<view class="content-middle">
<view class="content-middle-title">
<view class="content-middle-search">
<text class='iconfont icon-sousuo2'></text>
<input type='text' :value='keyword' placeholder='搜索关键字' placeholder-class='placeholder'
@input="setValue"></input>
</view>
<view class="search">
搜索
</view>
</view>
<view class="content-middle-one">
<view class="middle-one" v-for="(item,j) in list" :key='j'>
<liu-swipe-action :index="j" @clickItem="clickItem" :btnList='btnList'>
<view class="middle-onea">
<view class="middle-onea-title">
{{item.name}}
</view>
<view class="middle-onea-time">
{{item.move_time}}
</view>
</view>
<view class="middle-oneb">
<view class="middle-oneb-a">
<view class="threeb-a-b">
<view class="achor">调出部门<text>{{item.adepartment}}</text></view>
<view class="achor">调入部门{{item.bdepartment}}</view>
<view class="achor">调动操作人{{item.admin}}</view>
</view>
</view>
</view>
</liu-swipe-action>
</view>
</view>
</view>
<view class="content-bootom" @click="adddepart">
<view class="content-bootom-one">
<image src="@/static/images/ja.png" mode=""></image>
</view>
<view class="content-bootom-two">添加人事调动记录</view>
</view>
<u-empty v-if="loadConfig.status=='nomore'&& list.length==0" text="没有信息"
icon="/static/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
</template>
<script>
import {
userpersonal,
// deleteuserposition
} from '@/api/oa.js'
import {
Toast
} from '@/libs/uniApi.js'
export default {
data() {
return {
show: false,
btnList: [{
id: '1',
name: '编辑',
width: '100rpx',
height: '100rpx',
bgColor: '#5f92f7',
color: '#FFFFFF',
fontSize: '28rpx'
}, {
id: '2',
name: '删除',
height: '100rpx',
width: '100rpx',
bgColor: '#ed656d',
color: '#FFFFFF',
fontSize: '28rpx'
}],
loadConfig: {
page: 1,
limit: 5,
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
keyword: '',
list: [],
};
},
onLoad() {
},
onShow() {
this.initList()
},
onReachBottom() {
this.getDocumentList()
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
methods: {
//获取人事调动
// async getDocumentList() {
// const res = await userpersonal({
// keyword: this.keyword
// })
// this.list = res.data.data
// console.log(res.data)
// },
async initList() {
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
await this.getDocumentList();
},
async getDocumentList() {
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading"
let res = await userpersonal({
page: this.loadConfig.page,
limit: this.loadConfig.limit,
keyword: this.keyword
})
this.loadConfig.status = "loadmore"
if (res.data.data.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data?.data]
},
//添加人事调动
adddepart() {
uni.navigateTo({
url: '/pages/addpersonneltransfer/index?type=' + 0
})
},
//删除弹窗
clickItem(data) {
// console.log(e)
if (data.id == 2) {
uni.showModal({
content: '确定要删除吗',
success: (e) => {
if (e.confirm) {
this.deleteDepartment(this.list[data.index].id)
this.initList()
}
}
})
} else {
this.editpart(this.list[data.index])
}
},
//删除
async deleteDepartment(id) {
const res = await deleteuserposition({
id: id
})
if (res.code == 0) {
this.getDocumentList()
}
Toast(res.msg);
},
//编辑人事调动
editpart(item) {
uni.navigateTo({
url: '/pages/addpersonneltransfer/index?type=' + 1 + "&data=" + encodeURIComponent(JSON
.stringify(
item))
})
},
setValue() {
}
}
};
</script>
<style lang="scss" scoped>
page {
position: relative;
}
.content-middle {
.content-middle-title {
width: 100%;
background-color: #FFFFFF;
padding-top: 20rpx;
display: flex;
.search {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
width: 149rpx;
line-height: 63rpx;
height: 63rpx;
background: #FFFFFF;
text-align: center;
border-radius: 35rpx 35rpx;
border: 2rpx solid #E6E5E5;
margin-left: 18rpx;
}
.content-middle-search {
display: flex;
width: 527rpx;
height: 63rpx;
line-height: 63rpx;
padding-left: 30rpx;
background: #F7F7F7;
border-radius: 35rpx 35rpx;
font-size: 25rpx;
input {
width: 527rpx;
height: 63rpx;
line-height: 63rpx;
padding-left: 30rpx;
}
.placeholder {
font-size: 25rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
padding-left: 30rpx;
}
}
}
.content-middle-title {
height: 98rpx;
line-height: 98rpx;
background: #FFFFFF;
font-size: 35rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
padding-left: 28rpx;
color: #3274F9;
}
.content-middle-one {
margin-top: 26rpx;
.middle-one {
background-color: #FFFFFF;
padding: 28rpx 28rpx;
margin: 28rpx 20rpx;
.middle-onea {
display: flex;
justify-content: space-between;
border-bottom: 1rpx solid #CCCCCC;
padding-bottom: 20rpx;
.middle-onea-title {}
.middle-onea-time {}
}
.middle-oneb {
display: flex;
justify-content: space-between;
margin-top: 10rpx;
.middle-oneb-a {
display: flex;
.threeb-a-b {
.achor {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
}
}
.middle-oneb-b {
width: 80rpx;
height: 80rpx;
margin-top: 45rpx;
image {
width: 100%;
height: 100%;
}
}
}
}
}
}
.content-bootom {
width: 485rpx;
height: 88rpx;
text-align: center;
line-height: 88rpx;
background: #3274F9;
border-radius: 60px 60px 60px 60px;
display: flex;
left: 50%;
margin-left: -252.5rpx;
position: absolute;
bottom: 150rpx;
z-index: 9999 !important;
position: fixed;
.content-bootom-one {
margin-left: 92rpx;
margin-top: 5rpx;
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
image {
width: 100%;
height: 100%;
}
}
.content-bootom-two {
font-size: 35rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
}
}
</style>