增加我的访客库/我的相关方人员库

This commit is contained in:
caoqianming 2022-10-28 16:33:07 +08:00
parent be7db35cc3
commit 2d1c3de1ef
10 changed files with 437 additions and 22 deletions

View File

@ -79,6 +79,8 @@ const install = (Vue, vm) => {
let rpartyList = (data = {}) => vm.$u.get(`/rpm/rparty/`, data); //相关方列表
let remployee = (data = {}) => vm.$u.get(`/rpm/remployee/`, data); //相关方人员表
let remployeeCreate = (data = {}) => vm.$u.post(`/rpm/remployee/`, data); //相关方人员表
let remployeeDetail = (id, data = {}) => vm.$u.get(`/rpm/remployee/${id}/`, data); //人员详情
let remployeeUpdate = (id, data = {}) => vm.$u.put(`/rpm/remployee/${id}/`, data); //人员编辑
let rcertificate = (data = {}) => vm.$u.get(`/rpm/rcertificate/`, data); //相关方证书
let rpjFileList = (data = {}) => vm.$u.get(`/rpm/rpj_file/`, data); //相关方wenjian
let rpjList = (data = {}) => vm.$u.get(`/rpm/rpj/`, data); //rpj查询
@ -100,8 +102,10 @@ const install = (Vue, vm) => {
let vmVisitor = (data = {}) => vm.$u.get(`/vm/visitor/`, data); //来访人员列表
let visitorRegister = (data = {}) => vm.$u.post(`/vm/visitor/register/`, data); //来访人员/司机注册
let visitSubmit = (data = {}) => vm.$u.post(`/vm/visit/${id}/submit/`, data); //司机直接提交不走工单
let visitorList = (data = {}) => vm.$u.get(`/vm/visitor/`, data);
let visitorDetail = (id, data = {}) => vm.$u.get(`/vm/visitor/${id}/`, data); //来访人员详情
let visitorCreate = (data = {}) => vm.$u.post(`/vm/visitor/`, data); //来访人员添加
let visitorUpdate = (data = {}) => vm.$u.put(`/vm/visitor/${id}/`, data); //来访人员编辑
let visitorUpdate = (id, data = {}) => vm.$u.put(`/vm/visitor/${id}/`, data); //来访人员编辑
let vmVpeople = (data = {}) => vm.$u.get(`/vm/vpeople/`, data); //来访人员列表
let vpeopleCreate = (data = {}) => vm.$u.post(`/vm/vpeople/`, data); //来访人员添加
let vpeopleUpdate = (data = {}) => vm.$u.put(`/vm/vpeople/${id}/`, data); //来访人员编辑
@ -149,6 +153,8 @@ const install = (Vue, vm) => {
visitUpdate,
visitSubmit,
vmVisitor,
visitorList,
visitorDetail,
visitorCreate,
visitorUpdate,
visitDelete,
@ -161,6 +167,8 @@ const install = (Vue, vm) => {
rpartyList,
remployee,
remployeeCreate,
remployeeDetail,
remployeeUpdate,
rcertificate,
rpjItem,
rpjList,

View File

@ -377,6 +377,22 @@
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/workSpace/visit/visitor",
"style": {
"navigationBarTitleText": "我的访客库",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/workSpace/rpj/remployee",
"style": {
"navigationBarTitleText": "我的人员库",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {

View File

@ -151,18 +151,18 @@
this.preImgSrc = '';
},
//preview
/* preView(srcImg){
preView(srcImg){
let imgs = [];
imgs.push(srcImg)
uni.previewImage({
urls: imgs,
current: 0,
});
}, */
preView(srcImg){
this.preImgSrc = srcImg;
this.$refs.imgPreView.open();
},
// preView(srcImg){
// this.preImgSrc = srcImg;
// this.$refs.imgPreView.open();
// },
cancelPreImg(){
this.preImg = false;
},

View File

@ -35,23 +35,29 @@
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
<view class="enter-item" @click="goInto('myData')">
<image style="width: 34rpx;height: 30rpx;" class="left-icon" src="../../static/my/wodeziliao.png"
<image style="width: 34rpx;height: 30rpx;" class="left-icon" src="../../static/my/wodeshenqing.png"
mode=""></image>
<text class="title-text">我的资料</text>
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
<view class="enter-item" @click="goInto('clockIn')">
<image style="width: 34rpx;height: 30rpx;" class="left-icon" src="../../static/my/wodeziliao.png"
<image style="width: 34rpx;height: 30rpx;" class="left-icon" src="../../static/my/wodeshenqing.png"
mode=""></image>
<text class="title-text">我的打卡记录</text>
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
<view class="enter-item">
<view class="enter-item" @click="goInto('visitor')">
<image style="width: 34rpx;height: 30rpx;" class="left-icon" src="../../static/my/wodeziliao.png"
mode=""></image>
<text class="title-text">我的访客库</text>
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
<view class="enter-item" @click="goInto('remployee')" v-if="vuex_user.type=='remployee'">
<image style="width: 34rpx;height: 30rpx;" class="left-icon" src="../../static/my/wodeziliao.png"
mode=""></image>
<text class="title-text">我的人员库</text>
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
</view>
<view class="sign-out">
<button type="default" @click="signoutFn" class="sign-out-btn">退出账号</button>
@ -88,21 +94,31 @@
url: '/pages/my/myCertificates'
})
}
if (type == "myData") {
else if (type == "myData") {
uni.navigateTo({
url: '/pages/my/myInfo'
})
}
if (type == "myDataChange") {
else if (type == "myDataChange") {
uni.navigateTo({
url: '/pages/my/myInfoChange'
})
}
if (type == "clockIn") {
else if (type == "clockIn") {
uni.navigateTo({
url: '/pages/my/clock_in'
})
}
else if (type == "visitor") {
uni.navigateTo({
url: '/pages/workSpace/visit/visitor'
})
}
else if (type == "remployee") {
uni.navigateTo({
url: '/pages/workSpace/rpj/remployee'
})
}
},
getUserInfo() {
var promise;

View File

@ -1,28 +1,32 @@
<template>
<view class="my-data">
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="200rpx" leftText="添加人员"
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="200rpx" :leftText="leftText"
leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<view class="wrap-view">
<view class="item">
<text class="star">*</text>
<view class="title">姓名</view>
<view class="content">
<input type="text" v-model="formData.name" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item">
<text class="star">*</text>
<view class="title">手机号</view>
<view class="content">
<input type="text" v-model="formData.phone" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item">
<text class="star">*</text>
<view class="title">身份证号</view>
<view class="content">
<input type="text" v-model="formData.id_number" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item" style="height: fit-content;">
<text class="star">*</text>
<view class="title">证件照</view>
<view style="flex: 3;">
<u-upload :action="vuex_apifile" :header="upHeader" ref="uUpload"
@ -48,36 +52,93 @@
phone: "",
id_number: ""
},
leftText: '添加人员',
rparty:'',
upHeader:'',
fileList:[]
}
},
onLoad(params) {
if(params.type == 'edit'){
this.leftText = '编辑人员';
this.formData.id = params.id;
}
if(params.rparty){
this.rparty = params.rparty;
}
if(this.rparty && this.formData.id){
this.getRemployee()
}
else if(this.formData.id){
this.getVisitor()
}
this.getHeader();
},
methods: {
getHeader(){
this.upHeader = {Authorization: "Bearer " + this.vuex_token}
},
getRemployee(){
this.$u.api.remployeeDetail(this.formData.id).then(res=>{
this.formData = res
this.fileList = [this.vuex_host+res.photo]
})
},
getVisitor(){
this.$u.api.visitorDetail(this.formData.id).then(res=>{
this.formData = res
this.fileList = [this.vuex_host+res.photo]
})
},
saveVisitor(){
if(this.rparty!==''){
let obj = {...this.formData};
obj.rparty = this.rparty;
this.$u.api.remployeeCreate(obj).then(res=>{
uni.navigateBack({
delta: 1
if(this.formData.id){
this.$u.api.remployeeUpdate(obj.id, obj).then(res=>{
uni.showToast({
title:'保存成功',
icon: 'none'
})
uni.navigateBack({
delta: 1
})
})
})
}else{
this.$u.api.remployeeCreate(obj).then(res=>{
uni.showToast({
title:'保存成功',
icon: 'none'
})
uni.navigateBack({
delta: 1
})
})
}
}else{
this.$u.api.visitorCreate(this.formData).then(res=>{
if(this.formData.id){
this.$u.api.visitorUpdate(this.formData.id, this.formData).then(res=>{
uni.showToast({
title:'保存成功',
icon: 'none'
})
uni.navigateBack({
delta: 1
})
})
}
else{this.$u.api.visitorCreate(this.formData).then(res=>{
uni.showToast({
title:'创建成功',
icon: 'none'
})
uni.navigateBack({
delta: 1
})
})
}
}
},
goBack() {

View File

@ -92,8 +92,8 @@
<text class="visitorCell">{{item.duty}}</text>
<text class="visitorCell">{{item.certificates.length}}</text>
<view class="visitorCell">
<text class="bindBtn" @click="bindBtl(item,10)" v-if="item.worker_.blt_===null||item.worker_.blt_===undefined">绑卡</text>
<text class="bindBtn" @click="bindBtl(item,20)" v-else>解绑</text>
<!-- <text class="bindBtn" @click="bindBtl(item,10)" v-if="item.worker_.blt_===null||item.worker_.blt_===undefined">绑卡</text>
<text class="bindBtn" @click="bindBtl(item,20)" v-else>解绑</text> -->
</view>
</view>
</view>

View File

@ -0,0 +1,153 @@
<template>
<view class="clockInContainer">
<uni-nav-bar @clickLeft="goBack()" height="110rpx" leftWidth="200rpx" leftText="相关方人员" leftIcon="left" border
backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<!-- <view class="tabbar-title">
<view :class="{'text-title':true, 'active':activeIndex}" @click="changeList(1)">本月</view>
<view style="display: flex;">
<view>选择月份</view>
<picker mode="date" :value="date" fields="month" @change="bindDateChange">
<view class="uni-input">{{date}}</view>
</picker>
</view>
</view> -->
<view class="content">
<view class="item-wrap" v-for="(val,index) in lists" :key="val.id">
<view class="clock_in_-item">
<view class="center-info">
<view class="info-details">姓名{{val.name}}</view>
<view class="info-details">手机号{{val.phone}}</view>
<view class="info-details">创建时间{{val.create_time}}</view>
</view>
<view class="bottom-btns">
<view class="shenhezhong shenhe-status" @click="remployeeHandle(val,'edit')">
<image src="../../../static/my/my_apply/blue-time.png" mode=""></image>
编辑
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'visitor',
data() {
return {
totalNum: 0,
activeIndex:true,//
lists: [],
currentMonth:'',
currentYear:'',
date:'选择其他月',
}
},
onShow() {
let that = this;
that.getLists();
},
methods: {
getLists() {
let that = this;
that.$u.api.remployee({'page':0}).then(res => {
that.lists = res
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
remployeeHandle(val, type) {
if(type=='edit'){
uni.navigateTo({
url:`/pages/workSpace/newWork/addUser?id=${val.id}&type=edit&rparty=${val.rparty}`
})
}
}
}
}
</script>
<style scoped>
.empty-view {
height: 120rpx;
}
>>>.uni-navbar__header,
>>>.uni-status-bar,
.search-wrap {
background-image: linear-gradient(270deg,
#0ca7ee 0%,
#005aff 100%,
#2a8cff 100%,
#54bdff 100%),
linear-gradient(#e60012,
#e60012);
}
.tabbar-title{
display: flex;
justify-content: space-between;
}
.clockInContainer {
background-color: #f3fbff;
}
.clockInContainer>>>.uni-navbar-btn-text text {
font-size: 32rpx !important;
}
.content {
padding: 14rpx;
padding-top: 10upx;
}
.item-wrap {
margin-bottom: 14rpx;
}
.clock_in_-item {
width: 720rpx;
background-color: #ffffff;
border-radius: 10rpx;
margin: 0 auto;
padding: 24rpx 21rpx;
box-sizing: border-box;
}
.center-info {
padding-bottom: 30rpx;
border-bottom: 1rpx solid #eeeeee;
}
.info-details {
font-size: 28rpx;
line-height: 40rpx;
color: #5b5b5b;
}
.bottom-btns {
text-align: center;
font-family: PingFang-SC-Medium;
font-size: 28rpx;
line-height: 83rpx;
display: flex;
}
.shenhezhong {
flex: 1;
color: #2c6fd9;
}
.shenhezhong image {
width: 26rpx;
height: 26rpx;
margin-right: 10rpx;
vertical-align: middle;
}
</style>

View File

@ -90,8 +90,10 @@
<text class="visitorCell">{{item.duty}}</text>
<text class="visitorCell">{{item.rcertificates.length}}</text>
<view class="visitorCell">
<view v-if="formData.state == 40">
<text class="bindBtn" @click="bindBtl(item,10)" v-if="item.remployee_.blt_===null||item.worker_.blt_===undefined">绑卡</text>
<text class="bindBtn" @click="bindBtl(item,20)" v-else>解绑</text>
</view>
</view>
</view>
</view>

View File

@ -79,8 +79,10 @@
<span v-if="item.is_main"></span>
</text>
<view class="visitorCell">
<view v-if="formData.state == 40">
<text class="bindBtn" @click="bindBtl(item,10)" v-if="item.visitor_.blt_===null">绑卡</text>
<text class="bindBtn" @click="bindBtl(item,20)" v-else>解绑</text>
</view>
</view>
</view>
</view>
@ -238,8 +240,12 @@
this.visitorItem = null;
},
preView(srcImg){
this.preImgSrc = srcImg;
this.$refs.imgPreView.open();
let imgs = [];
imgs.push(srcImg)
uni.previewImage({
urls: imgs,
current: 0,
});
},
cancelPreView(){
this.preImgSrc = '';

View File

@ -0,0 +1,153 @@
<template>
<view class="clockInContainer">
<uni-nav-bar @clickLeft="goBack()" height="110rpx" leftWidth="200rpx" leftText="访客库" leftIcon="left" border
backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<!-- <view class="tabbar-title">
<view :class="{'text-title':true, 'active':activeIndex}" @click="changeList(1)">本月</view>
<view style="display: flex;">
<view>选择月份</view>
<picker mode="date" :value="date" fields="month" @change="bindDateChange">
<view class="uni-input">{{date}}</view>
</picker>
</view>
</view> -->
<view class="content">
<view class="item-wrap" v-for="(val,index) in lists" :key="val.id">
<view class="clock_in_-item">
<view class="center-info">
<view class="info-details">姓名{{val.name}}</view>
<view class="info-details">手机号{{val.phone}}</view>
<view class="info-details">创建时间{{val.create_time}}</view>
</view>
<view class="bottom-btns">
<view class="shenhezhong shenhe-status" @click="visitorHandle(val,'edit')">
<image src="../../../static/my/my_apply/blue-time.png" mode=""></image>
编辑
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'visitor',
data() {
return {
totalNum: 0,
activeIndex:true,//
lists: [],
currentMonth:'',
currentYear:'',
date:'选择其他月',
}
},
onShow() {
let that = this;
that.getLists();
},
methods: {
getLists() {
let that = this;
that.$u.api.visitorList({'page':0}).then(res => {
that.lists = res
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
visitorHandle(val, type) {
if(type=='edit'){
uni.navigateTo({
url:`/pages/workSpace/newWork/addUser?id=${val.id}&type=edit`
})
}
}
}
}
</script>
<style scoped>
.empty-view {
height: 120rpx;
}
>>>.uni-navbar__header,
>>>.uni-status-bar,
.search-wrap {
background-image: linear-gradient(270deg,
#0ca7ee 0%,
#005aff 100%,
#2a8cff 100%,
#54bdff 100%),
linear-gradient(#e60012,
#e60012);
}
.tabbar-title{
display: flex;
justify-content: space-between;
}
.clockInContainer {
background-color: #f3fbff;
}
.clockInContainer>>>.uni-navbar-btn-text text {
font-size: 32rpx !important;
}
.content {
padding: 14rpx;
padding-top: 10upx;
}
.item-wrap {
margin-bottom: 14rpx;
}
.clock_in_-item {
width: 720rpx;
background-color: #ffffff;
border-radius: 10rpx;
margin: 0 auto;
padding: 24rpx 21rpx;
box-sizing: border-box;
}
.center-info {
padding-bottom: 30rpx;
border-bottom: 1rpx solid #eeeeee;
}
.info-details {
font-size: 28rpx;
line-height: 40rpx;
color: #5b5b5b;
}
.bottom-btns {
text-align: center;
font-family: PingFang-SC-Medium;
font-size: 28rpx;
line-height: 83rpx;
display: flex;
}
.shenhezhong {
flex: 1;
color: #2c6fd9;
}
.shenhezhong image {
width: 26rpx;
height: 26rpx;
margin-right: 10rpx;
vertical-align: middle;
}
</style>