Compare commits
No commits in common. "ccfa2f6ce25cedab2af25ebb50b18d6ef14ff5e6" and "93bb48e45d5e763f535b0358ca88c4e7ba2e6226" have entirely different histories.
ccfa2f6ce2
...
93bb48e45d
@ -394,13 +394,6 @@
|
|||||||
"navigationBarTitleText": "个人信息",
|
"navigationBarTitleText": "个人信息",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/staff/StaffInfo",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "员工信息",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@ -318,8 +318,11 @@ export default {
|
|||||||
this.showEducation = false
|
this.showEducation = false
|
||||||
},
|
},
|
||||||
toInfo(item) {
|
toInfo(item) {
|
||||||
uni.navigateTo({
|
request({
|
||||||
url: '/pages/staff/StaffInfo?id=' + item.id
|
url: '/company/staff/getByUserId?id=' + item.id,
|
||||||
|
method: 'get'
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gettel(num) {
|
gettel(num) {
|
||||||
@ -511,7 +514,7 @@ export default {
|
|||||||
}).join(",") : ""
|
}).join(",") : ""
|
||||||
}
|
}
|
||||||
const staffRes = await request({
|
const staffRes = await request({
|
||||||
url: '/company/staff/updateByExistUser',
|
url: '/company/staff/createByExistUser',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: staffData
|
data: staffData
|
||||||
})
|
})
|
||||||
@ -837,6 +840,7 @@ export default {
|
|||||||
padding-right: 1rem
|
padding-right: 1rem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 添加到你的样式文件中 */
|
||||||
.image-container {
|
.image-container {
|
||||||
position: relative; /* 使子元素可以相对于此容器进行绝对定位 */
|
position: relative; /* 使子元素可以相对于此容器进行绝对定位 */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@ -36,10 +36,9 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="m-top">
|
<view class="m-top">
|
||||||
<view class="top-left" style="display: flex;gap: 1.5rem">
|
<view class="top-left">
|
||||||
<view class="dhei">车型:{{ item.goodsName }}</view>
|
<view class="dhei">{{ item.goodsName }}</view>
|
||||||
<view class="dhei">检测类型:{{ item.skuName }}</view>
|
<text class="xhui">施工人员:{{ item.workerName }}</text>
|
||||||
<!-- <text class="xhui">施工人员:{{ item.workerName }}</text>-->
|
|
||||||
</view>
|
</view>
|
||||||
<view @click="callUser(item.buyPhone)" class="top-right">
|
<view @click="callUser(item.buyPhone)" class="top-right">
|
||||||
<image src="../../static/detection/teel.png" mode=""></image>
|
<image src="../../static/detection/teel.png" mode=""></image>
|
||||||
@ -58,22 +57,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<uni-icons type="map" color="#999999" size="16"></uni-icons>
|
<uni-icons type="map" color="#999999" size="16"></uni-icons>
|
||||||
<text>车牌号:</text>
|
<text>订单号:</text>
|
||||||
<text>{{ item.carNum }}</text>
|
<text>{{ item.orderNo }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="on-input">
|
<view class="on-input">
|
||||||
<uni-icons type="more" color="#999999" size="16"></uni-icons>
|
<uni-icons type="more" color="#999999" size="16"></uni-icons>
|
||||||
<text>客户来源:</text>
|
<text>车牌号:</text>
|
||||||
<text>{{ item.customerSource }}</text>
|
<text>{{ item.carNum }}</text>
|
||||||
</view>
|
|
||||||
<view class="on-input" v-if="item.otherPhone">
|
|
||||||
<uni-icons type="more" color="#999999" size="16"></uni-icons>
|
|
||||||
<text>代办人手机号:</text>
|
|
||||||
<text>{{ item.otherPhone }}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-di">
|
<view class="bottom-di">
|
||||||
<text v-if="tapindex === 1">商品原价:</text>
|
|
||||||
<text v-if="tapindex === 1" class="ju" style="margin-right: 0.5rem">{{ item.goodsPrice / 100 }}元</text>
|
|
||||||
<text>实付金额:</text>
|
<text>实付金额:</text>
|
||||||
<text class="ju">{{ item.realPayMoney / 100 }}元</text>
|
<text class="ju">{{ item.realPayMoney / 100 }}元</text>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -1,336 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="c-top">
|
|
||||||
<view class="" @click="getback()">
|
|
||||||
<uni-icons type="left" size="18"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view class="c-title">{{ topName }}</view>
|
|
||||||
<view class=""></view>
|
|
||||||
</view>
|
|
||||||
<view class="ail">
|
|
||||||
<view class="on-input">
|
|
||||||
<view class="s-huix">姓名:</view>
|
|
||||||
<view class=""><input v-model="staff.name" type="text" placeholder="请输入姓名"></view>
|
|
||||||
</view>
|
|
||||||
<view class="on-input">
|
|
||||||
<view class="s-huix">电话:</view>
|
|
||||||
<view class=""><input v-model="staff.tel" type="text" placeholder="请输入手机号"></view>
|
|
||||||
</view>
|
|
||||||
<view class="on-input">
|
|
||||||
<view class="s-huix">学历:</view>
|
|
||||||
<view class="" @click="showEducation = true"><input :value="getEducation" type="text"
|
|
||||||
placeholder="请选择学历"></view>
|
|
||||||
</view>
|
|
||||||
<view class="on-input">
|
|
||||||
<view class="s-huix">身份证号:</view>
|
|
||||||
<view class=""><input v-model="staff.idNumber" type="text" placeholder="请输入身份证号"></view>
|
|
||||||
</view>
|
|
||||||
<view class="on-input">
|
|
||||||
<view class="s-huix">入职时间:</view>
|
|
||||||
<view class="" @click="showJoinedDate = true"><input :value="formattedJoinedDate" type="text"
|
|
||||||
placeholder="请选择入职时间"></view>
|
|
||||||
</view>
|
|
||||||
<view class="on-input">
|
|
||||||
<view class="s-huix">转正时间:</view>
|
|
||||||
<view class="" @click="showFormalDate = true"><input :value="formattedFormalDate" type="text"
|
|
||||||
placeholder="请选择转正时间"></view>
|
|
||||||
</view>
|
|
||||||
<view class="on-input">
|
|
||||||
<view class="s-huix">购买保险时间:</view>
|
|
||||||
<view class="" @click="showSafeDate = true"><input :value="formattedSafeDate" type="text"
|
|
||||||
placeholder="请选择购买保险时间"></view>
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
<view style="display: flex;justify-content: space-between;margin: 1rem auto">
|
|
||||||
<view class="s-huix" style="text-align: left">附件:</view>
|
|
||||||
<view class="" style="color: #3391ff" @click="addFile">添加附件</view>
|
|
||||||
</view>
|
|
||||||
<view v-for="(item, index) in files" style="margin-bottom: 1rem;border-bottom: 1px solid #DAE1F8;">
|
|
||||||
<view class="on-input">
|
|
||||||
<view class="s-huix">名称:</view>
|
|
||||||
<view class=""><input v-model="item.fileName" type="text" placeholder="请输入附件名称"></view>
|
|
||||||
</view>
|
|
||||||
<u-upload v-if="!item.fileUrl"
|
|
||||||
@afterRead="uploadFilePromise($event, index)"
|
|
||||||
name="6"
|
|
||||||
multiple
|
|
||||||
:maxCount="1"
|
|
||||||
width="100%"
|
|
||||||
height="140px"
|
|
||||||
>
|
|
||||||
</u-upload>
|
|
||||||
<view v-else class="image-container">
|
|
||||||
<image :src="item.fileUrl" style="width: 100%;height: 140px;"></image>
|
|
||||||
<view @click="deletedUrl(index)" class="close-button">
|
|
||||||
<text>x</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tjiao" @click="getyadd">
|
|
||||||
<text>保存更改</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<u-picker :show="showEducation" ref="uPicker" :columns="[educations]"
|
|
||||||
@confirm="chooseEducation" @cancel="showEducation = false"
|
|
||||||
keyName="label"></u-picker>
|
|
||||||
|
|
||||||
<u-datetime-picker
|
|
||||||
:show="showJoinedDate"
|
|
||||||
v-model="staff.joinedDate"
|
|
||||||
@cancel="showJoinedDate = false"
|
|
||||||
@confirm="chooseJoinDate"
|
|
||||||
mode="date"
|
|
||||||
return-type='string'
|
|
||||||
></u-datetime-picker>
|
|
||||||
<u-datetime-picker
|
|
||||||
:show="showFormalDate"
|
|
||||||
v-model="staff.formalDate"
|
|
||||||
@cancel="showFormalDate = false"
|
|
||||||
@confirm="chooseFormalDate"
|
|
||||||
mode="date"
|
|
||||||
return-type='string'
|
|
||||||
></u-datetime-picker>
|
|
||||||
<u-datetime-picker
|
|
||||||
:show="showSafeDate"
|
|
||||||
v-model="staff.safeDate"
|
|
||||||
@cancel="showSafeDate = false"
|
|
||||||
@confirm="chooseSafeDate"
|
|
||||||
mode="date"
|
|
||||||
return-type='string'
|
|
||||||
></u-datetime-picker>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import request from "../../utils/request";
|
|
||||||
import {formatDate, getDictDataByType} from "../../utils/utils";
|
|
||||||
import config from '@/config'
|
|
||||||
import upload from '@/utils/upload.js'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "StaffInfo",
|
|
||||||
data(){
|
|
||||||
return{
|
|
||||||
userId: null,
|
|
||||||
staff: {},
|
|
||||||
user: {},
|
|
||||||
educations: [],
|
|
||||||
files: [],
|
|
||||||
showEducation: false,
|
|
||||||
showJoinedDate: false,
|
|
||||||
showFormalDate: false,
|
|
||||||
showSafeDate: false,
|
|
||||||
topName: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(data){
|
|
||||||
if (data.id){
|
|
||||||
this.userId = data.id
|
|
||||||
this.getInfoByUserId()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed:{
|
|
||||||
getEducation(){
|
|
||||||
if (!this.educations || this.educations.length === 0){
|
|
||||||
this.getEducations()
|
|
||||||
}
|
|
||||||
const index = this.educations.findIndex(item => item.value === this.staff.education)
|
|
||||||
if (index !== -1){
|
|
||||||
return this.educations[index].label
|
|
||||||
}
|
|
||||||
return ''
|
|
||||||
},
|
|
||||||
formattedJoinedDate() {
|
|
||||||
if (!this.staff.joinedDate) return '';
|
|
||||||
return formatDate(this.staff.joinedDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
|
||||||
},
|
|
||||||
formattedFormalDate() {
|
|
||||||
if (!this.staff.formalDate) return '';
|
|
||||||
return formatDate(this.staff.formalDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
|
||||||
},
|
|
||||||
formattedSafeDate() {
|
|
||||||
if (!this.staff.safeDate) return '';
|
|
||||||
return formatDate(this.staff.safeDate); // 确保formatDate返回'yyyy-MM-dd'格式
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
getyadd(){
|
|
||||||
if (!this.staff.name || !this.staff.tel) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '姓名和电话不能有空',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const data = {
|
|
||||||
...this.staff,
|
|
||||||
fileNames: this.files.length > 0 ? this.files.map(item => item.fileName).join(",") : null,
|
|
||||||
fileUrls: this.files.length > 0 ? this.files.map(item => {
|
|
||||||
return item.fileUrl.replace(config.baseImageUrl + "/", "")
|
|
||||||
}).join(",") : null
|
|
||||||
}
|
|
||||||
request({
|
|
||||||
url: '/company/staff/updateByExistUser',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
}).then(res => {
|
|
||||||
uni.showToast({
|
|
||||||
title: "保存成功"
|
|
||||||
})
|
|
||||||
this.getInfoByUserId()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
addFile() {
|
|
||||||
if (this.files.length === 0 || this.files[0].fileUrl !== null) {
|
|
||||||
this.files.unshift({
|
|
||||||
fileName: "未命名",
|
|
||||||
fileUrl: null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
uploadFilePromise(event, index) {
|
|
||||||
upload({
|
|
||||||
url: '/common/upload',
|
|
||||||
filePath: event.file[0].url,
|
|
||||||
}).then((res) => {
|
|
||||||
this.files[index].name = event.file[0].name
|
|
||||||
this.files[index].fileUrl = config.baseImageUrl + "/" + res.data.url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deletedUrl(index) {
|
|
||||||
this.files.splice(index, 1)
|
|
||||||
},
|
|
||||||
chooseJoinDate(e) {
|
|
||||||
this.staff.joinedDate = formatDate(e.value)
|
|
||||||
this.showJoinedDate = false
|
|
||||||
},
|
|
||||||
chooseFormalDate(e) {
|
|
||||||
this.staff.formalDate = formatDate(e.value)
|
|
||||||
this.showFormalDate = false
|
|
||||||
},
|
|
||||||
chooseSafeDate(e) {
|
|
||||||
this.staff.safeDate = formatDate(e.value)
|
|
||||||
this.showSafeDate = false
|
|
||||||
},
|
|
||||||
chooseEducation(e) {
|
|
||||||
this.$set(this.staff, 'education', e.value[0].value)
|
|
||||||
// this.staff['education'] = e.value[0].value
|
|
||||||
this.showEducation = false
|
|
||||||
},
|
|
||||||
getEducations(){
|
|
||||||
this.educations = getDictDataByType("company_staff_edu")
|
|
||||||
},
|
|
||||||
async getInfoByUserId(){
|
|
||||||
const res = await request({
|
|
||||||
url: '/company/staff/getByUserId?id=' + this.userId,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
const data = res.data
|
|
||||||
this.staff = data?.staff || this.staff
|
|
||||||
this.user = data?.user
|
|
||||||
this.topName = this.staff?.name || this.user?.nickname || this.user?.username
|
|
||||||
if (!data?.staff){
|
|
||||||
this.staff.name = this.user?.nickname || this.user?.username
|
|
||||||
this.staff.tel = this.user?.username || this.user?.mobile
|
|
||||||
this.staff.userId = this.user.id
|
|
||||||
}
|
|
||||||
if (this?.staff?.fileNames){
|
|
||||||
this.files = []
|
|
||||||
const names = this.staff.fileNames.split(",")
|
|
||||||
const urls = this.staff.fileUrls.split(",")
|
|
||||||
names.forEach((item, index) => {
|
|
||||||
const temp = {
|
|
||||||
fileName: item,
|
|
||||||
fileUrl: config.baseImageUrl + (urls[index][0] === "/" ? urls[index] : "/" + urls[index])
|
|
||||||
}
|
|
||||||
this.files.push(temp)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getback(){
|
|
||||||
uni.navigateBack()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
height: calc(100vh);
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
.c-top{
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 15px;
|
|
||||||
padding-top: 55px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
.c-title{
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold
|
|
||||||
}
|
|
||||||
.ail{
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
.on-input {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
border-bottom: 1px solid #DAE1F8;;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
margin: 10px;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.on-input input {
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 1rem
|
|
||||||
}
|
|
||||||
.s-huix {
|
|
||||||
width: 30%;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.image-container {
|
|
||||||
position: relative; /* 使子元素可以相对于此容器进行绝对定位 */
|
|
||||||
width: 100%;
|
|
||||||
height: 140px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-button {
|
|
||||||
position: absolute;
|
|
||||||
top: 5px; /* 调整距离顶部的距离 */
|
|
||||||
right: 5px; /* 调整距离右侧的距离 */
|
|
||||||
width: 24px; /* 圆的直径 */
|
|
||||||
height: 24px;
|
|
||||||
background-color: #ff0000;
|
|
||||||
color: white;
|
|
||||||
border-radius: 50%; /* 使按钮呈现圆形 */
|
|
||||||
display: flex;
|
|
||||||
//align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: 16px; /* 调整“X”的字体大小 */
|
|
||||||
cursor: pointer; /* 鼠标悬停时显示为指针 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.tjiao {
|
|
||||||
width: 40%;
|
|
||||||
height: 30px;
|
|
||||||
margin: 5px auto;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: #0D2E8D;
|
|
||||||
color: white;
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Loading…
Reference in New Issue
Block a user