更新
63
components/header/headers.vue
Normal file
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
|
||||
<view class="my-header">
|
||||
<view class="my-icons" @click="goback">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<view class="my-text">{{titles}}</view>
|
||||
<view class="my-icons"></view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
props: {
|
||||
titles: String
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
goback(){
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.my-header {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
// background: linear-gradient(180deg, #B2D2FC 0%, rgba(255, 255, 255, 0.84) 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 0px 15px;
|
||||
padding-top: 40px;
|
||||
z-index: 99999;
|
||||
background: linear-gradient( 180deg, #054DF3 0%, #55A3FF 100%);
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
|
||||
.my-icons {
|
||||
width: 20px;
|
||||
|
||||
}
|
||||
|
||||
.my-text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
51
pages.json
@ -36,6 +36,13 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/manage/NewdeviceManage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "设备管理",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/authority/authority",
|
||||
"style": {
|
||||
@ -92,6 +99,13 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/manage/internalManagement",
|
||||
"style": {
|
||||
"navigationBarTitleText": "内部管理",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/manage/deviceAdd",
|
||||
"style": {
|
||||
@ -113,6 +127,20 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/newindex",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新首页",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/addStaff",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加员工",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/xiaoxi/xiaoxi",
|
||||
"style": {
|
||||
@ -190,6 +218,13 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/NewstaffManagement",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新员工列表",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/homecar",
|
||||
"style": {
|
||||
@ -410,6 +445,22 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/manage/workReport/reportList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/manage/workReport/reportDetals",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/manage/workReport/workReportAdd",
|
||||
"style": {
|
||||
|
@ -274,7 +274,7 @@
|
||||
},
|
||||
goselect(){
|
||||
uni.reLaunch({
|
||||
url:'/pages/index/synthesis'
|
||||
url:'/pages/index/newindex'
|
||||
})
|
||||
},
|
||||
// 验证码方法
|
||||
|
492
pages/index/NewstaffManagement.vue
Normal file
@ -0,0 +1,492 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<headersVue :titles="titles"><u-icon name="arrow-left" color="#fff" size="18"></u-icon></headersVue>
|
||||
<view class="content">
|
||||
<view class="top_">
|
||||
<view class="search_box">
|
||||
<u-search placeholder="请输入员工姓名进行搜索" @search="getindex" :showAction="false" searchIconColor="#427FFE" v-model="workName"></u-search>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-x="true" class="tap_box">
|
||||
<view class="tap_list" :class="{ 'acColor': tapIndex == index}" v-for="(item,index) in tabList"
|
||||
:key="index" @click="gettap(index,item.id)">
|
||||
<view class=""> {{item.name}}</view>
|
||||
<view class="gang" :class="{ 'actColor': tapIndex == index}"></view>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="lsit_">
|
||||
<view class="list_box" v-for="(item, index) in goodsList" :key="index">
|
||||
<view class="checkbox_" @click="setIndex(item.id)">
|
||||
<u-icon name="checkmark" color="#2979ff" size="18" v-if="workids.includes(item.id)"></u-icon>
|
||||
</view>
|
||||
<view class="right_box" >
|
||||
<view class="d_s" @click="toInfo(item)">
|
||||
<view class="user_">
|
||||
<image :src="item.avatar" mode="" v-if="item.avatar"></image>
|
||||
<image src="/static/imgs/yh.png" v-else mode=""></image>
|
||||
</view>
|
||||
<view class="name_">{{ item.nickname || item.username }}</view>
|
||||
<view class="icon_"><u-text :lines="1" :text="item.roleNames" /></view>
|
||||
</view>
|
||||
<view class="d_b">
|
||||
<view class="">
|
||||
<text style="color: #8D90A6;">电话:</text>
|
||||
<text>{{ item.mobile || item.username }}</text>
|
||||
</view>
|
||||
<view class="tel_" @click="gettel(item)">
|
||||
<image src="/static/imgs/tel.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%; height: 128rpx; "></view>
|
||||
</view>
|
||||
<view class="bottom_">
|
||||
<view class="bottom_left" @click="getdelete()">删除员工</view>
|
||||
<view class="bottom_right" @click="goAdd()" >添加员工</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headersVue from '../../components/header/headers.vue';
|
||||
import request from "@/utils/request";
|
||||
import config from "@/config";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: "员工管理",
|
||||
keyword:'',
|
||||
List: [],
|
||||
listIndex:[],
|
||||
tapIndex:0,
|
||||
tapList: [],
|
||||
show: false,
|
||||
status: 'loading',
|
||||
msg: '3',
|
||||
goodsList: [],
|
||||
tabList: [],
|
||||
renList: [],
|
||||
baseUrl: "http://192.168.1.4:8080/lanan",
|
||||
partnerId: '',
|
||||
isListing: 1,
|
||||
goodsTitle: "",
|
||||
taplist: [{
|
||||
Text: '已发布',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
Text: '待上架',
|
||||
id: 0
|
||||
},
|
||||
],
|
||||
pageNum: 1, //第几页
|
||||
pageSize: 10, //一页多少张
|
||||
totalPages: 0, //总数
|
||||
realName: "",
|
||||
phoneNum: "",
|
||||
workName: "",
|
||||
workids: [],
|
||||
postid: '',
|
||||
gwindex: 0,
|
||||
gwid: 0,
|
||||
roleId: undefined,
|
||||
addRoleId: undefined,
|
||||
education: null,
|
||||
educationText: null,
|
||||
idCard: null,
|
||||
joinDate: null,
|
||||
probationPeriod: null,
|
||||
socialSecurityBuyDate: null,
|
||||
educations: [],
|
||||
showEducation: false,
|
||||
showJoinedDate: false,
|
||||
showFormalDate: false,
|
||||
showSafeDate: false,
|
||||
files: [],
|
||||
showDriveType: false,
|
||||
driverLicenseType: [],
|
||||
driverLicenseTypeArr: [],
|
||||
driverLicenseTypeArrStr: null
|
||||
}
|
||||
},
|
||||
components:{
|
||||
headersVue
|
||||
},
|
||||
onLoad() {
|
||||
this.getDriveType()
|
||||
this.gettab()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.pageNum >= this.totalPages) {
|
||||
uni.showToast({
|
||||
title: '没有下一页数据',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
} else {
|
||||
this.pageNum++
|
||||
this.gettab()
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
gettap(index, id) {
|
||||
this.tapIndex = index
|
||||
this.roleId = id
|
||||
this.goodsList = []
|
||||
this.pageNum = 1
|
||||
this.getindex()
|
||||
|
||||
|
||||
},
|
||||
setIndex(num){
|
||||
const index = this.workids.indexOf(num); // 查找是否包含此数字
|
||||
if (index === -1) {
|
||||
this.workids.push(num); // 若不存在,
|
||||
} else {
|
||||
this.workids.splice(index, 1); // 存在的话,则删除这个数
|
||||
}
|
||||
console.log(this.workids);
|
||||
},
|
||||
|
||||
gettel(num) {
|
||||
const value = num.mobile || num.username
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: value //仅为示例
|
||||
});
|
||||
},
|
||||
toInfo(data){
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/addStaff?id=' + data.id
|
||||
})
|
||||
},
|
||||
async getdelete() {
|
||||
if (this.workids == '') {
|
||||
uni.showToast({
|
||||
title: '请至少选择一名要删除的员工!',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else {
|
||||
// this.workids = this.workids.join(",")
|
||||
}
|
||||
let res = await request({
|
||||
url: '/system/user/deleteUserByIds',
|
||||
method: 'delete',
|
||||
data: this.workids
|
||||
|
||||
})
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: "操作成功",
|
||||
|
||||
})
|
||||
this.pageNum = 1
|
||||
this.goodsList = []
|
||||
this.getindex()
|
||||
}
|
||||
},
|
||||
getDriveType() {
|
||||
return request({
|
||||
url: '/common/down/getDriverLicenseType',
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
//提取出数组中的id属性
|
||||
this.driverLicenseType = res.data
|
||||
})
|
||||
},
|
||||
goAdd(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/addStaff'
|
||||
})
|
||||
},
|
||||
goManage(num){
|
||||
if(num == 1){
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/staffManagement'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
async gettab() {
|
||||
let res = await request({
|
||||
url: '/system/role/pageByQuery',
|
||||
method: 'get',
|
||||
params: {
|
||||
servicePackageId: 'jiance'
|
||||
}
|
||||
})
|
||||
this.tabList = [{
|
||||
name: '全部',
|
||||
id: undefined
|
||||
}]
|
||||
this.tabList.push(...res.data)
|
||||
this.roleId = this.tabList[0].id
|
||||
this.renList = res.data
|
||||
this.getindex()
|
||||
},
|
||||
async getindex() {
|
||||
if (this.workName != '') {
|
||||
this.pageNum = 1
|
||||
this.goodsList = []
|
||||
}
|
||||
|
||||
let data = {
|
||||
nickname: this.workName,
|
||||
roleId: this.roleId,
|
||||
pageNo: this.pageNum, //第几页
|
||||
pageSize: this.pageSize, //一页多少张
|
||||
}
|
||||
let res = await request({
|
||||
|
||||
url: '/system/role/selectListByRoleId',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
if (res.code == 200) {
|
||||
|
||||
if (this.pageNum != 1) {
|
||||
this.goodsList = this.goodsList.concat(res.rows)
|
||||
} else {
|
||||
this.goodsList = res.rows
|
||||
}
|
||||
this.goodsList.forEach(item => {
|
||||
if (item.avatar && !item.avatar.includes(config.baseImageUrl)){
|
||||
item.avatar = config.baseImageUrl + (item.avatar[0] === '/' ? item.avatar : '/' + item.avatar)
|
||||
}
|
||||
})
|
||||
let total = res.total
|
||||
this.totalPages = Math.ceil(total / this.pageSize);
|
||||
}
|
||||
const newUsers = this.goodsList.filter(item => !item.roleName)
|
||||
if (newUsers && newUsers.length > 0) {
|
||||
const ids = newUsers.map(item => item.id)
|
||||
request({
|
||||
url: '/inspection/util/getRoleNameByIds?ids=' + ids,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.goodsList.filter(item => !item.roleName).map(item => {
|
||||
this.$set(item, "roleName", res.data[item.id])
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.icon_ {
|
||||
background: #eaf2fe;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
padding: 5rpx 10rpx;
|
||||
color: #427FFE;
|
||||
font-size: 14px;
|
||||
max-width: 200rpx; /* 限制最大宽度 */
|
||||
white-space: nowrap; /* 不换行 */
|
||||
overflow: hidden; /* 超出部分隐藏 */
|
||||
text-overflow: ellipsis; /* 超出部分显示省略号 */
|
||||
flex-shrink: 0; /* 禁止挤压 */
|
||||
}
|
||||
|
||||
.user_ {
|
||||
width: 90rpx; /* 固定宽度 */
|
||||
height: 90rpx; /* 固定高度 */
|
||||
border-radius: 4rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 20rpx;
|
||||
flex-shrink: 0; /* 禁止挤压 */
|
||||
}
|
||||
|
||||
.d_s {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
width: 100%; /* 确保宽度占满父容器 */
|
||||
}
|
||||
|
||||
.name_ {
|
||||
font-size: 32rpx;
|
||||
color: #101A3E;
|
||||
margin-right: 20rpx;
|
||||
flex-shrink: 0; /* 禁止挤压 */
|
||||
}
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.container{
|
||||
background: #F1F3F6;
|
||||
height: 100vh;
|
||||
}
|
||||
.content{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
padding-top: 170rpx;
|
||||
}
|
||||
.top_{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
background: #fff;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.tap_box {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
margin: 5px 0px;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 5px;
|
||||
|
||||
}
|
||||
.tap_list {
|
||||
color: #333333;
|
||||
margin: 0px 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.acColor {
|
||||
font-weight: bold;
|
||||
color: #5384fd;
|
||||
}
|
||||
.right_box{
|
||||
width: 88%;
|
||||
}
|
||||
.gang {
|
||||
width: 20px;
|
||||
height: 4px;
|
||||
margin-top: 5px;
|
||||
// background-color: #5384fd;
|
||||
border-radius: 30px;
|
||||
margin: 5px auto;
|
||||
}
|
||||
|
||||
.actColor {
|
||||
background-color: #5384fd;
|
||||
}
|
||||
.search_box{
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 2rpx solid #F5F5F5;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.lsit_{
|
||||
background: #F1F3F6;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.list_box{
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
margin-bottom:30rpx ;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
}
|
||||
.checkbox_{
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #E0E0E0;
|
||||
margin-right: 15rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
//.d_s{
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// margin-bottom: 30rpx;
|
||||
//}
|
||||
.d_b{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
//.user_{
|
||||
// width: 90rpx;
|
||||
// height: 90rpx;
|
||||
// border-radius: 4rpx;
|
||||
// overflow: hidden;
|
||||
// margin-right: 20rpx;
|
||||
//}
|
||||
//.icon_{
|
||||
// background: #eaf2fe;
|
||||
// border-radius: 8rpx;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
// box-sizing: border-box;
|
||||
// padding:5rpx 10rpx;
|
||||
// color: #427FFE;
|
||||
// font-size: 14px;
|
||||
//
|
||||
//
|
||||
//}
|
||||
.tel_{
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
//.name_{
|
||||
// font-size: 32rpx;
|
||||
// color: #101A3E;
|
||||
// margin-right: 20rpx;
|
||||
//}
|
||||
.bottom_{
|
||||
width: 100%;
|
||||
height: 158rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx -1rpx 24rpx 0rpx rgba(0,0,0,0.1);
|
||||
border-radius: 15px 15px 0px 0px;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.bottom_left{
|
||||
width: 301rpx;
|
||||
height: 78rpx;
|
||||
border: 2rpx solid #427FFE;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #427FFE;
|
||||
font-size: 28rpx;
|
||||
border-radius: 50px;
|
||||
margin: 30rpx;
|
||||
|
||||
}
|
||||
.bottom_right{
|
||||
width: 301rpx;
|
||||
height: 78rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: #427FFE;
|
||||
border: 2rpx solid #427FFE;
|
||||
border-radius: 50px;
|
||||
margin: 30rpx;
|
||||
}
|
||||
.roleName{
|
||||
white-space: nowrap; /* 不换行 */
|
||||
overflow: hidden; /* 超出部分隐藏 */
|
||||
text-overflow: ellipsis; /* 超出部分显示省略号 */
|
||||
width: 200rpx; /* 根据需要设置宽度 */
|
||||
}
|
||||
</style>
|
598
pages/index/addStaff.vue
Normal file
@ -0,0 +1,598 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<headersVue :titles="titles">
|
||||
<u-icon name="arrow-left" color="#fff" size="18"></u-icon>
|
||||
</headersVue>
|
||||
<view class="container">
|
||||
<view class="box_">
|
||||
<view class="d_s" style="margin-bottom: 10px;" v-if="userId">
|
||||
<view class="touxiang_">
|
||||
<image src="/static/imgs/yh.png" mode=""></image>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="name_">{{ staff.nickname }}</view>
|
||||
<view class="d_s">
|
||||
<view class="tel_">
|
||||
<image src="/static/imgs/tel.png" mode=""></image>
|
||||
</view>
|
||||
<view class="telnum">手机号:{{ staff.mobile }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d_b" v-if="!userId">
|
||||
<view class="">姓名</view>
|
||||
<input type="text" placeholder="请输入姓名" v-model="staff.nickname" style="text-align: right;"/>
|
||||
</view>
|
||||
<view class="d_b" v-if="!userId">
|
||||
<view class="">手机号</view>
|
||||
<input type="text" placeholder="请输入手机号" v-model="staff.mobile" style="text-align: right;"/>
|
||||
</view>
|
||||
<view class="d_b">
|
||||
<view class="">学历</view>
|
||||
<view class="" @click="showEducation = true">
|
||||
{{ staff.educational != null ? this.staff.educational : '请选择学历' }} >
|
||||
</view>
|
||||
</view>
|
||||
<view class="d_b">
|
||||
<view class="">身份证号</view>
|
||||
<input type="text" placeholder="请输入身份证号" v-model="staff.idCard" style="text-align: right;"/>
|
||||
</view>
|
||||
<view class="d_b">
|
||||
<view class="">入职时间</view>
|
||||
<view class="" @click="showJoinedDate = true">
|
||||
{{ staff.joinDate != null ? this.staff.joinDate : '请选择入职时间' }} >
|
||||
</view>
|
||||
</view>
|
||||
<view class="d_b">
|
||||
<view class="">转正时间</view>
|
||||
<view class="" @click="showFormalDate = true">
|
||||
{{ staff.probationPeriod != null ? this.staff.probationPeriod : '请选择转正时间' }} >
|
||||
</view>
|
||||
</view>
|
||||
<view class="d_b">
|
||||
<view class="">购买保险时间</view>
|
||||
<view class="" @click="showSafeDate = true">
|
||||
{{ staff.socialSecurityBuyDate != null ? this.staff.socialSecurityBuyDate : '请选择购买保险时间' }} >
|
||||
</view>
|
||||
</view>
|
||||
<view class="d_b">
|
||||
<view class="">驾照类型</view>
|
||||
<view class="" @click="showDriveType = true">
|
||||
{{ driverLicenseTypeArrStr != null ? this.driverLicenseTypeArrStr : '请选择驾照类型' }} >
|
||||
</view>
|
||||
</view>
|
||||
<view class="d_b" v-if="!userId">
|
||||
<view class="">岗位</view>
|
||||
<view class="" @click="showRole = true">
|
||||
{{ roleName != null ? this.roleName : '请选择岗位' }} >
|
||||
</view>
|
||||
</view>
|
||||
<view class="d_b" @click="handleUpload">
|
||||
<view class="">附件</view>
|
||||
<view class="lan_">上传附件
|
||||
<image src="/static/imgs/add.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<u-upload
|
||||
ref="uploadRef"
|
||||
:fileList="fileList1"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
name="1"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
v-show="fileList1.length > 0"
|
||||
>
|
||||
</u-upload>
|
||||
<view class="hui_box" v-if="fileList1.length == 0">
|
||||
<image src="/static/imgs/wod.png" mode=""></image>
|
||||
<view class="">
|
||||
<view class="big_">附件格式 jpg/png</view>
|
||||
<view class="sm_">100KB</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="anniu" @click="submit">
|
||||
{{ buttonTile }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-picker :show="showEducation" ref="uPicker" :columns="[educations]"
|
||||
@confirm="chooseEducation" @cancel="showEducation = false"
|
||||
keyName="label"></u-picker>
|
||||
|
||||
<u-picker :show="showRole" ref="uPicker" :columns="[roles]"
|
||||
@confirm="chooseRole" @cancel="showRole = false"
|
||||
keyName="name"></u-picker>
|
||||
|
||||
<qianziyu-select
|
||||
:show="showDriveType"
|
||||
type="checkbox"
|
||||
name="id"
|
||||
:dataLists="driverLicenseType"
|
||||
:showSearch=false
|
||||
@cancel="showDriveType = false"
|
||||
:checkboxData="driverLicenseTypeArr"
|
||||
@submit="onsubmit"
|
||||
@update:checkboxData="driverLicenseTypeArr = $event"
|
||||
>
|
||||
</qianziyu-select>
|
||||
|
||||
<u-datetime-picker
|
||||
:show="showJoinedDate"
|
||||
v-model="selectJoinDate"
|
||||
@cancel="showJoinedDate = false"
|
||||
@confirm="chooseJoinDate"
|
||||
mode="date"
|
||||
return-type='string'
|
||||
></u-datetime-picker>
|
||||
<u-datetime-picker
|
||||
:show="showFormalDate"
|
||||
v-model="selectProbationPeriod"
|
||||
@cancel="showFormalDate = false"
|
||||
@confirm="chooseFormalDate"
|
||||
mode="date"
|
||||
return-type='string'
|
||||
></u-datetime-picker>
|
||||
<u-datetime-picker
|
||||
:show="showSafeDate"
|
||||
v-model="selectSocialSecurityBuyDate"
|
||||
@cancel="showSafeDate = false"
|
||||
@confirm="chooseSafeDate"
|
||||
mode="date"
|
||||
return-type='string'
|
||||
></u-datetime-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headersVue from '../../components/header/headers.vue';
|
||||
import request from "@/utils/request";
|
||||
import {formatDate, getDictDataByType} from "@/utils/utils";
|
||||
import upload from "@/utils/upload";
|
||||
import {baseImageUrl} from "@/config";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: "新增员工",
|
||||
staff: {
|
||||
joinDate: null,
|
||||
probationPeriod: null,
|
||||
socialSecurityBuyDate: null,
|
||||
},
|
||||
fileList1: [],
|
||||
selectJoinDate: new Date().toString(),
|
||||
selectProbationPeriod: new Date().toString(),
|
||||
selectSocialSecurityBuyDate: new Date().toString(),
|
||||
buttonTile: '保存',
|
||||
show: false,
|
||||
showRole: false,
|
||||
status: 'loading',
|
||||
userId: undefined,
|
||||
showEducation: false,
|
||||
showJoinedDate: false,
|
||||
showFormalDate: false,
|
||||
showSafeDate: false,
|
||||
showDriveType: false,
|
||||
educations: [],
|
||||
roles: [],
|
||||
driverLicenseType: [],
|
||||
driverLicenseTypeArr: [],
|
||||
driverLicenseTypeArrStr: null,
|
||||
roleName: null,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
headersVue
|
||||
},
|
||||
onLoad(data) {
|
||||
if (data.id) {
|
||||
this.titles = '编辑员工'
|
||||
this.userId = data.id
|
||||
this.getInfoByUserId()
|
||||
this.buttonTile = '修改'
|
||||
}
|
||||
this.getEducation()
|
||||
this.getDriveType()
|
||||
this.getRoles()
|
||||
},
|
||||
methods: {
|
||||
cancelShow() {
|
||||
this.show = !this.cancelShow
|
||||
},
|
||||
async getRoles() {
|
||||
let res = await request({
|
||||
url: '/system/role/pageByQuery',
|
||||
method: 'get',
|
||||
params: {
|
||||
servicePackageId: 'jiance'
|
||||
}
|
||||
})
|
||||
this.roles = res.data
|
||||
},
|
||||
onsubmit(selectedData) {
|
||||
selectedData.map(item => item.id);
|
||||
this.driverLicenseTypeArr = selectedData;
|
||||
this.driverLicenseTypeArrStr = selectedData.map(item => item.id).join(',');
|
||||
this.showDriveType = false; // 提交后关闭弹窗
|
||||
},
|
||||
getDriveType() {
|
||||
return request({
|
||||
url: '/common/down/getDriverLicenseType',
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
//提取出数组中的id属性
|
||||
this.driverLicenseType = res.data
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
//判断是否是修改
|
||||
console.log(this.staff.fileList)
|
||||
if (this.userId) {
|
||||
this.update()
|
||||
}else {
|
||||
this.add()
|
||||
}
|
||||
},
|
||||
update() {
|
||||
// 验证表单信息
|
||||
const flag = this.validData()
|
||||
if (!flag) {
|
||||
return
|
||||
}
|
||||
|
||||
this.staff.userId = this.userId
|
||||
console.log(this.staff)
|
||||
const data = {
|
||||
...this.staff,
|
||||
fileList: this.fileList1,
|
||||
driverLicenseType: this.driverLicenseTypeArrStr,
|
||||
driverLicenseTypeArr: this.driverLicenseTypeArr.map(item => item.id)
|
||||
}
|
||||
request({
|
||||
url: '/inspectionStaff/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: "编辑成功"
|
||||
})
|
||||
this.getInfoByUserId()
|
||||
})
|
||||
},
|
||||
async add() {
|
||||
// 验证表单信息
|
||||
const flag = this.validData()
|
||||
if (!flag) {
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
nickname: this.staff.nickname,
|
||||
mobile: this.staff.mobile,
|
||||
username: this.staff.nickname,
|
||||
status: 0,
|
||||
userType: '01',
|
||||
roleId: this.staff.roleId,
|
||||
name: this.nickname,
|
||||
joinDate: this.staff.joinDate,
|
||||
idCard: this.staff.idCard,
|
||||
educational: this.staff.educational,
|
||||
probationPeriod: this.staff.probationPeriod,
|
||||
socialSecurityBuyDate: this.staff.socialSecurityBuyDate,
|
||||
driverLicenseTypeArr: this.driverLicenseTypeArr.map(item => item.id),
|
||||
password: '123456'
|
||||
}
|
||||
let res = await request({
|
||||
url: '/inspectionStaff/save',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
if (res.code == 200) {
|
||||
let roleIds = []
|
||||
roleIds.push(this.staff.roleId)
|
||||
let resp = await request({
|
||||
url: '/system/permission/assign-user-role',
|
||||
method: 'post',
|
||||
data: {
|
||||
userId: res.data,
|
||||
roleIds: roleIds
|
||||
}
|
||||
})
|
||||
uni.showToast({
|
||||
title: "添加成功"
|
||||
})
|
||||
this.show = false
|
||||
this.getindex()
|
||||
}
|
||||
},
|
||||
validData() {
|
||||
if (!this.staff.nickname || !this.staff.mobile) {
|
||||
uni.showToast({
|
||||
title: '姓名和电话不能有空',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (!this.staff.roleId && !this.userId) {
|
||||
uni.showToast({
|
||||
title: '请选择岗位',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
chooseJoinDate(e) {
|
||||
this.$nextTick(() => {
|
||||
this.staff.joinDate = formatDate(e.value)
|
||||
this.selectJoinDate = this.staff.joinDate
|
||||
})
|
||||
this.showJoinedDate = false
|
||||
console.log(this.staff)
|
||||
},
|
||||
chooseFormalDate(e) {
|
||||
this.$nextTick(() => {
|
||||
this.staff.probationPeriod = formatDate(e.value);
|
||||
this.selectProbationPeriod = this.staff.probationPeriod
|
||||
})
|
||||
this.showFormalDate = false;
|
||||
console.log(this.staff)
|
||||
},
|
||||
chooseSafeDate(e) {
|
||||
this.$nextTick(() => {
|
||||
this.staff.socialSecurityBuyDate = formatDate(e.value)
|
||||
this.selectSocialSecurityBuyDate = this.staff.socialSecurityBuyDate
|
||||
})
|
||||
this.showSafeDate = false
|
||||
console.log(this.staff)
|
||||
},
|
||||
async getInfoByUserId() {
|
||||
const res = await request({
|
||||
url: '/inspectionStaff/get',
|
||||
params: {
|
||||
id: this.userId
|
||||
},
|
||||
method: 'get'
|
||||
})
|
||||
this.staff = res.data
|
||||
this.topName = this.staff?.nickname
|
||||
if (res.data.driverLicenseType) {
|
||||
this.driverLicenseTypeArrStr = res.data.driverLicenseType
|
||||
res.data.driverLicenseTypeArr.forEach(item => {
|
||||
let temp = {
|
||||
id: item,
|
||||
name: item
|
||||
}
|
||||
this.driverLicenseTypeArr.push(temp)
|
||||
})
|
||||
}
|
||||
if (this?.staff?.fileList) {
|
||||
this.fileList1 = []
|
||||
this.staff.fileList.forEach((item) => {
|
||||
const temp = {
|
||||
name: item.name,
|
||||
url: item.url.startsWith("http") ? item.url : baseImageUrl + '/' + item.url
|
||||
}
|
||||
this.fileList1.push(temp)
|
||||
})
|
||||
console.log('tupian', this.fileList1)
|
||||
}
|
||||
},
|
||||
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 ''
|
||||
},
|
||||
async getEducations() {
|
||||
this.educations = await getDictDataByType("company_staff_edu")
|
||||
},
|
||||
chooseEducation(e) {
|
||||
this.$set(this.staff, 'education', e.value[0].label)
|
||||
this.staff.educational = e.value[0].label
|
||||
this.showEducation = false
|
||||
},
|
||||
chooseRole(e) {
|
||||
console.log(e)
|
||||
this.staff.roleId = e.value[0].id
|
||||
this.roleName = e.value[0].name
|
||||
this.showRole = false
|
||||
},
|
||||
|
||||
// 上传相关方法
|
||||
handleUpload() {
|
||||
// 通过 ref 获取 u-upload 组件实例,并调用其上传方法
|
||||
this.$refs.uploadRef.chooseFile();
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1);
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = this[`fileList${event.name}`].length;
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中",
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url);
|
||||
let item = this[`fileList${event.name}`][fileListLen];
|
||||
this[`fileList${event.name}`].splice(
|
||||
fileListLen,
|
||||
1,
|
||||
Object.assign(item, {
|
||||
status: "success",
|
||||
message: "",
|
||||
url: result,
|
||||
})
|
||||
);
|
||||
fileListLen++;
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// let a = uni.uploadFile({
|
||||
// url: "http://192.168.2.21:7001/upload", // 仅为示例,非真实的接口地址
|
||||
// filePath: url,
|
||||
// name: "file",
|
||||
// formData: {
|
||||
// user: "test",
|
||||
// },
|
||||
// success: (res) => {
|
||||
// setTimeout(() => {
|
||||
// resolve(res.data.data);
|
||||
// }, 1000);
|
||||
// },
|
||||
// });
|
||||
upload({
|
||||
url: '/common/upload',
|
||||
filePath: url,
|
||||
}).then((res) => {
|
||||
resolve(res.data.url);
|
||||
console.log(this.fileList1)
|
||||
this.forceRefreshFiles(); // 强制刷新文件列表
|
||||
})
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content {
|
||||
background: #f4f5f6;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
background: #f4f5f6;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
padding-top: 200rpx;
|
||||
padding-bottom: 28px;
|
||||
}
|
||||
|
||||
.box_ {
|
||||
background: #FFFFFF;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.d_s {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.d_b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 0rpx;
|
||||
border-top: 2rpx solid #F5F6F9;
|
||||
font-size: 28rpx;
|
||||
color: #8D90A6;
|
||||
|
||||
}
|
||||
|
||||
.touxiang_ {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-right: 20rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.tel_ {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.name_ {
|
||||
font-size: 32rpx;
|
||||
color: #101A3E;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.telnum {
|
||||
font-size: 24rpx;
|
||||
color: #366FFF;
|
||||
}
|
||||
|
||||
.lan_ {
|
||||
font-size: 28rpx;
|
||||
color: #327DFB;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.hui_box {
|
||||
width: 100%;
|
||||
background: #F5F6F9;
|
||||
border-radius: 16rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.big_ {
|
||||
font-size: 28rpx;
|
||||
color: #101A3E;
|
||||
}
|
||||
|
||||
.sm_ {
|
||||
font-size: 22rpx;
|
||||
color: #8D90A6;
|
||||
}
|
||||
|
||||
.anniu {
|
||||
width: 622rpx;
|
||||
height: 78rpx;
|
||||
background: #427FFE;
|
||||
border-radius: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
</style>
|
575
pages/index/newindex.vue
Normal file
@ -0,0 +1,575 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
|
||||
<view class="top_">
|
||||
<view class="logo_imgs">
|
||||
<image src="/static/imgs/logo.png" mode=""></image>
|
||||
</view>
|
||||
<view class="t_box">
|
||||
<view class="d_s">
|
||||
<view class="picture_">
|
||||
<image @click="showUserDetail" style="width: 104rpx;height: 104rpx;border-radius: 50%;"
|
||||
v-if="userInfo && userInfo.avatar === null" :src="defaultAvatar" mode="scaleToFill" @error="avatarErr"></image>
|
||||
<image @click="showUserDetail" style="width: 104rpx;height: 104rpx;border-radius: 50%;" v-else
|
||||
:src="userInfo.avatar" mode="scaleToFill" @error="avatarErr"></image>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="name_">
|
||||
{{ userInfo.nickname }}
|
||||
</view>
|
||||
<view class="bqing_">{{ userInfo.roleNames }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d_s">
|
||||
<view class="icon1" @click="goNotice()">
|
||||
<image src="/static/imgs/xiaoxi.png" mode=""></image>
|
||||
</view>
|
||||
<view class="icon1">
|
||||
<image src="/static/imgs/gengduo.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="three_">
|
||||
<view class="three_box1">
|
||||
<view class="">当日订单</view>
|
||||
<view class="num_">{{ threenum.todayOrderNum }}</view>
|
||||
</view>
|
||||
<view class="three_box2">
|
||||
<view class="">合规合格</view>
|
||||
<view class="num_">{{ threenum.hgNum }}</view>
|
||||
</view>
|
||||
<view class="three_box3">
|
||||
<view class="">双燃料合格</view>
|
||||
<view class="num_">{{ threenum.srlNum }}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="hang_"></view>
|
||||
<view class="jg_box">
|
||||
<view class="jg_top">2024-12-30 星期一 11:05</view>
|
||||
<view class="jg_ds">
|
||||
<view class="jg_ys">
|
||||
<image src="/static/imgs/jg1.png" mode="" @click="goordermanage"></image>
|
||||
<view class="">订单管理</view>
|
||||
</view>
|
||||
<view class="jg_ys">
|
||||
<image src="/static/imgs/jg2.png" mode=""></image>
|
||||
<view class="">业务统计</view>
|
||||
</view>
|
||||
<view class="jg_ys">
|
||||
<image src="/static/imgs/jg3.png" mode=""></image>
|
||||
<view class="">通知公告</view>
|
||||
</view>
|
||||
<view class="jg_ys" @click="goInternalManagement">
|
||||
<image src="/static/imgs/jg4.png" mode=""></image>
|
||||
<view class="">内部管理</view>
|
||||
</view>
|
||||
<view class="jg_ys" @click="show =!show">
|
||||
<image src="/static/imgs/jg5.png" mode=""></image>
|
||||
<view class="">更多功能</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="jg_bt" v-if="show">
|
||||
<view class="jg_ys1">
|
||||
<image src="/static/imgs/jg6.png" mode=""></image>
|
||||
<view class="">发布商品</view>
|
||||
</view>
|
||||
<view class="jg_ys1">
|
||||
<image src="/static/imgs/jg7.png" mode=""></image>
|
||||
<view class="">商品管理</view>
|
||||
</view>
|
||||
<view class="jg_ys1">
|
||||
<image src="/static/imgs/jg8.png" mode=""></image>
|
||||
<view class="">订单核销</view>
|
||||
</view>
|
||||
<view class="jg_ys1">
|
||||
<image src="/static/imgs/jg9.png" mode=""></image>
|
||||
<view class="">优惠券</view>
|
||||
</view>
|
||||
<view class="jg_ys1">
|
||||
<image src="/static/imgs/jg10.png" mode=""></image>
|
||||
<view class="">使用说明</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hang_"></view>
|
||||
<view class="list_">
|
||||
<view class="title_">预约记录</view>
|
||||
<view class="box_" v-for="(item,index) in 10" :key="index">
|
||||
<view class="box_ds">
|
||||
<view class="box_title">小型汽车(含5座)</view>
|
||||
<image src="/static/imgs/ns.png" style="width: 88rpx; height: 44rpx; " mode=""></image>
|
||||
</view>
|
||||
<view class="box_bd">
|
||||
<view class="box_ds">
|
||||
<image src="/static/imgs/car.png" style="width: 36rpx; height: 36rpx; " mode=""></image>
|
||||
<view class="size_">车牌号:鲁A00000</view>
|
||||
</view>
|
||||
<image src="/static/imgs/tel.png" style="width: 36rpx; height: 36rpx; " mode=""></image>
|
||||
</view>
|
||||
<view class="bd">
|
||||
<view class="left_">预约人</view>
|
||||
<view class="right_">王五</view>
|
||||
</view>
|
||||
<view class="bd">
|
||||
<view class="left_">电话</view>
|
||||
<view class="right_">128 1234 5678</view>
|
||||
</view>
|
||||
<view class="bd">
|
||||
<view class="left_">预约时间</view>
|
||||
<view class="right_">2025年01月01日</view>
|
||||
</view>
|
||||
<view class="bd">
|
||||
<view class="left_">客户来源</view>
|
||||
<view class="right_">代办</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getStorageWithExpiry, setStorageWithExpiry} from "@/utils/auth";
|
||||
import request from "@/utils/request";
|
||||
import config from "@/config";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: "首页",
|
||||
msg: "1",
|
||||
List: [],
|
||||
show: false,
|
||||
status: 'loading',
|
||||
warnMsg: [],
|
||||
chuan: '',
|
||||
titlemodeal: '通知',
|
||||
isWorking: false,
|
||||
user: {},
|
||||
baseUrl: '',
|
||||
animate: false,
|
||||
partnerId: '',
|
||||
threenum: {},
|
||||
showScroll: true,
|
||||
scrollDuration: 3000, // 滚动间隔时间,单位为毫秒
|
||||
items: [],
|
||||
ping: [],
|
||||
dateStr: '',
|
||||
week: '',
|
||||
is_mandatory: false,
|
||||
url: 'http://159.75.168.143:88/apk/lanan.apk',
|
||||
title: '版本升级',
|
||||
contents: '新版本上线了,根据您自己的选择是否升级',
|
||||
appAndPick: {
|
||||
appointNum: 0,
|
||||
pickNum: 0
|
||||
},
|
||||
baseImageUrl: this.$baseImageUrl,
|
||||
noReadNum: 1,
|
||||
userInfo: {},
|
||||
defaultAvatar: require('@/static/icons/avatar.png'),
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
// this.actList = ["1", "1", "1", "1", "1", ]
|
||||
// this.status = "nomore" 底部刷新结束
|
||||
this.getUserInfo()
|
||||
this.getindex()
|
||||
// this.getwarnMsglist()
|
||||
this.getbottom()
|
||||
this.getUserInfo()
|
||||
this.getWarnCount()
|
||||
this.getAppointAndPickNum()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log("刷新");
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
// this.show = true
|
||||
setTimeout(() => {
|
||||
console.log("加载执行");
|
||||
}, 2000)
|
||||
},
|
||||
|
||||
methods: {
|
||||
goInternalManagement(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/manage/internalManagement'
|
||||
})
|
||||
},
|
||||
goordermanage(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/ordermanage'
|
||||
})
|
||||
},
|
||||
goNotice(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/notice/notice'
|
||||
})
|
||||
},
|
||||
goback() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
showUserDetail(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/UserInfo'
|
||||
})
|
||||
},
|
||||
avatarErr(err) {
|
||||
console.log('err', err)
|
||||
this.userInfo.avatar = this.defaultAvatar
|
||||
},
|
||||
getUserInfo() {
|
||||
let roleNames = getStorageWithExpiry("roleNames")
|
||||
if (!roleNames){
|
||||
request({
|
||||
url: '/inspection/util/getRoleName',
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
roleNames = res.data
|
||||
setStorageWithExpiry("roleNames", roleNames)
|
||||
})
|
||||
}
|
||||
const data = getStorageWithExpiry("userInfo")
|
||||
if (!data) {
|
||||
request({
|
||||
url: '/system/user/profile/get',
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.userInfo = res.data
|
||||
if (this.userInfo.avatar) {
|
||||
this.userInfo.avatar = config.baseImageUrl + this.userInfo.avatar
|
||||
}
|
||||
this.userInfo.roleNames = roleNames
|
||||
setStorageWithExpiry("userInfo", this.userInfo)
|
||||
})
|
||||
} else {
|
||||
this.userInfo = data
|
||||
}
|
||||
},
|
||||
getWarnCount(){
|
||||
request({
|
||||
url: '/warnMsg/warnMsg/getCount',
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
if (res.data){
|
||||
this.noReadNum = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
async getAppointAndPickNum() {
|
||||
let res = await request({
|
||||
url: '/partnerOwn/partner/getAppointAndPickNum',
|
||||
method: 'get'
|
||||
})
|
||||
if (res.code == 200) {
|
||||
this.appAndPick = res.data
|
||||
}
|
||||
},
|
||||
// 底部消息
|
||||
async getbottom() {
|
||||
let data = {
|
||||
partnerId: uni.getStorageSync('partnerId')
|
||||
}
|
||||
let res = await request({
|
||||
url: '/appInspection/news/newMsgNum',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
if (res.code == 200) {
|
||||
this.chuan = res.data
|
||||
}
|
||||
},
|
||||
async getindex() {
|
||||
// 首页信息
|
||||
let res = await request({
|
||||
url: '/partnerOwn/partner/shopInfo',
|
||||
method: 'get',
|
||||
})
|
||||
this.user = res.data
|
||||
this.partnerId = res.data.partnerId
|
||||
uni.setStorageSync('partnerId', res.data.partnerId)
|
||||
if (res.data.isWorking == "0") {
|
||||
|
||||
this.isWorking = false
|
||||
}
|
||||
if (res.data.isWorking == "1") {
|
||||
this.isWorking = true
|
||||
}
|
||||
// 中间统计
|
||||
let reszj = await request({
|
||||
url: '/partnerOwn/partner/statisticsInfo?partnerId=' + this.partnerId,
|
||||
method: 'get',
|
||||
})
|
||||
let nums = {
|
||||
orderAmount: reszj.data.orderAmount / 100,
|
||||
orderNum: reszj.data.orderNum,
|
||||
todayOrderAmount: reszj.data.todayOrderAmount / 100,
|
||||
todayOrderNum: reszj.data.todayOrderNum,
|
||||
workedNum: reszj.data.workedNum,
|
||||
workingNum: reszj.data.workingNum,
|
||||
srlNum: reszj.data.srlNum,
|
||||
hgNum: reszj.data.hgNum,
|
||||
|
||||
}
|
||||
this.threenum = nums
|
||||
|
||||
|
||||
// 下方订单信息
|
||||
// let resxf = await request({
|
||||
// url:'/partnerOwn/partner/orderInfo?partnerId='+this.partnerId,
|
||||
// method: 'get',
|
||||
// })
|
||||
// this.items = resxf.data
|
||||
// 热销产品
|
||||
let resrx = await request({
|
||||
url: '/partnerOwn/partner/hotGoodsList?partnerId=' + this.partnerId,
|
||||
method: 'get',
|
||||
})
|
||||
this.ping = resrx.data
|
||||
// this.getswitch()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.content {}
|
||||
|
||||
|
||||
.top_ {
|
||||
width: 100%;
|
||||
height: 284rpx;
|
||||
background: linear-gradient(180deg, #054DF3 0%, #55A3FF 100%);
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
padding-top: 80rpx;
|
||||
}
|
||||
|
||||
.logo_imgs {
|
||||
width: 160rpx;
|
||||
height: 40rpx;
|
||||
margin: 20rpx 0rpx;
|
||||
|
||||
}
|
||||
|
||||
.t_box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.picture_ {
|
||||
overflow: hidden;
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.d_s {
|
||||
display: flex;
|
||||
|
||||
}
|
||||
|
||||
.name_ {
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.bqing_ {
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #FFFFFF;
|
||||
box-sizing: border-box;
|
||||
color: #FFFFFF;
|
||||
font-size: 22rpx;
|
||||
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
.icon1 {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.three_ {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.jg_box {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.list_ {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.three_box1 {
|
||||
width: 216rpx;
|
||||
height: 116rpx;
|
||||
background-image: url('/static/imgs/t1.png');
|
||||
background-size: 100% 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 14rpx 18rpx;
|
||||
font-size: 24rpx;
|
||||
color: #101A3E;
|
||||
|
||||
}
|
||||
|
||||
.three_box2 {
|
||||
width: 216rpx;
|
||||
height: 116rpx;
|
||||
background-image: url('/static/imgs/t2.png');
|
||||
background-size: 100% 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 14rpx 18rpx;
|
||||
font-size: 24rpx;
|
||||
color: #101A3E;
|
||||
}
|
||||
|
||||
.three_box3 {
|
||||
width: 216rpx;
|
||||
height: 116rpx;
|
||||
background-image: url('/static/imgs/t3.png');
|
||||
background-size: 100% 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 14rpx 18rpx;
|
||||
font-size: 24rpx;
|
||||
color: #101A3E;
|
||||
}
|
||||
|
||||
.num_ {
|
||||
font-size: 36rpx;
|
||||
color: #101A3E;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.hang_ {
|
||||
width: 100%;
|
||||
height: 30rpx;
|
||||
background: #F7F8FC;
|
||||
}
|
||||
|
||||
.jg_top {
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 30rpx;
|
||||
border-bottom: 1px solid #F5F5F5;
|
||||
}
|
||||
|
||||
.jg_ds {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 0rpx;
|
||||
border-bottom: 1px solid #F5F5F5;
|
||||
}
|
||||
|
||||
.jg_bt {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 0rpx;
|
||||
}
|
||||
|
||||
.jg_ys {
|
||||
font-size: 24rpx;
|
||||
color: #101A3E;
|
||||
text-align: center;
|
||||
|
||||
image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.jg_ys1 {
|
||||
font-size: 24rpx;
|
||||
color: #101A3E;
|
||||
text-align: center;
|
||||
|
||||
image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
}
|
||||
.title_{
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.box_{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
background: #F7F8FC;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
}
|
||||
.box_ds{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.box_bd{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 24rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 1px solid #E3ECFB;
|
||||
}
|
||||
.bd{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
margin: 20rpx 0rpx;
|
||||
}
|
||||
.box_title{
|
||||
font-size: 32rpx;
|
||||
color: #101A3E;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.size_{
|
||||
font-size: 24rpx;
|
||||
color: #366FFF;
|
||||
margin-left: 10rpx;
|
||||
|
||||
}
|
||||
.left_{
|
||||
font-size: 28rpx;
|
||||
color: #8D90A6;
|
||||
}
|
||||
.right_{
|
||||
font-size: 28rpx;
|
||||
color: #101A3E;
|
||||
}
|
||||
</style>
|
102
pages/manage/NewdeviceManage.vue
Normal file
@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<view class="">
|
||||
|
||||
|
||||
<headersVue :titles="titles"><u-icon name="arrow-left" color="#fff" size="18"></u-icon></headersVue>
|
||||
<view class="content">
|
||||
|
||||
<view class="box_">
|
||||
<view class="box_list">
|
||||
<view class="">
|
||||
<image src="/static/imgs/s1.png" mode=""></image>
|
||||
<view class="name_">底检设备</view>
|
||||
<view class="">100</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="box_list">
|
||||
<view class="">
|
||||
<image src="/static/imgs/s2.png" mode=""></image>
|
||||
<view class="name_">底检设备</view>
|
||||
<view class="">100</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="box_list">
|
||||
<view class="">
|
||||
<image src="/static/imgs/s3.png" mode=""></image>
|
||||
<view class="name_">底检设备</view>
|
||||
<view class="">100</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="box_list">
|
||||
<view class="">
|
||||
<image src="/static/imgs/s4.png" mode=""></image>
|
||||
<view class="name_">底检设备</view>
|
||||
<view class="">100</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headersVue from '../../components/header/headers.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: "设备管理",
|
||||
List: [],
|
||||
show: false,
|
||||
status: 'loading',
|
||||
}
|
||||
},
|
||||
components:{
|
||||
headersVue
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content{
|
||||
background: #F7F8FC;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
padding-top: 200rpx;
|
||||
}
|
||||
.box_{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.box_list{
|
||||
width: 328rpx;
|
||||
height: 396rpx;
|
||||
background: #fff;
|
||||
border-radius: 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx;
|
||||
image{
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
}
|
||||
}
|
||||
.name_{
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.num_{
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
}
|
||||
</style>
|
134
pages/manage/internalManagement.vue
Normal file
@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<headersVue :titles="titles"><u-icon name="arrow-left" color="#fff" size="18"></u-icon></headersVue>
|
||||
<view class="content">
|
||||
<!-- <view class="top_"></view> -->
|
||||
|
||||
<view class="box_" @click="goManage(1)">
|
||||
<view class="ds">
|
||||
<image src="/static/imgs/nb1.png" mode=""></image>
|
||||
<view class="">员工管理</view>
|
||||
</view>
|
||||
<view class="anniu">
|
||||
去查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_" @click="goManage(2)">
|
||||
<view class="ds">
|
||||
<image src="/static/imgs/nb2.png" mode=""></image>
|
||||
<view class="">设备管理</view>
|
||||
</view>
|
||||
<view class="anniu">
|
||||
去查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_">
|
||||
<view class="ds">
|
||||
<image src="/static/imgs/nb3.png" mode=""></image>
|
||||
<view class="">资料管理</view>
|
||||
</view>
|
||||
<view class="anniu">
|
||||
去查看
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_" @click="goManage(4)">
|
||||
<view class="ds">
|
||||
<image src="/static/imgs/nb4.png" mode=""></image>
|
||||
<view class="">工作汇报</view>
|
||||
</view>
|
||||
<view class="anniu">
|
||||
去查看
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headersVue from '../../components/header/headers.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: "内部管理",
|
||||
msg: "1",
|
||||
List: [],
|
||||
show: false,
|
||||
status: 'loading',
|
||||
}
|
||||
},
|
||||
components:{
|
||||
headersVue
|
||||
},
|
||||
methods:{
|
||||
goManage(num){
|
||||
if(num == 1){
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/NewstaffManagement'
|
||||
})
|
||||
}
|
||||
if(num == 2){
|
||||
uni.navigateTo({
|
||||
url:'/pages/manage/NewdeviceManage'
|
||||
})
|
||||
}
|
||||
if (num == 4) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/manage/workReport/reportList'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content{
|
||||
background: #F7F8FC;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
padding-top: 200rpx;
|
||||
}
|
||||
.box_{
|
||||
width: 100%;
|
||||
height: 128rpx;
|
||||
background-image: url('/static/imgs/box_.png');
|
||||
background-size: 100% 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
margin-bottom: 30rpx;
|
||||
image{
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
}
|
||||
.ds{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.anniu{
|
||||
width: 144rpx;
|
||||
height: 66rpx;
|
||||
background: #327DFB;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
border-radius: 50px;
|
||||
}
|
||||
</style>
|
434
pages/manage/workReport/reportDetals.vue
Normal file
@ -0,0 +1,434 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<headersVue :titles="titles">
|
||||
<u-icon name="arrow-left" color="#fff" size="18"></u-icon>
|
||||
</headersVue>
|
||||
<view class="container">
|
||||
<view class="box_">
|
||||
<view class="title_">
|
||||
<text style="color: red;">*</text>
|
||||
汇报主题
|
||||
</view>
|
||||
<u--input placeholder="请输入" border="surround" v-model="report.reportTopic"></u--input>
|
||||
<view class="x_"></view>
|
||||
<view class="" @click="show =! show">
|
||||
<text class="h_">汇报时间:</text>
|
||||
{{ formatDateTimeToMinute(report.reportTime) }}
|
||||
</view>
|
||||
<view class="x_"></view>
|
||||
<view class="d_s" @click="isShowReportTo = true">
|
||||
<text class="h_">汇报给:{{ reportTosStr }}</text>
|
||||
<view class="j_">+</view>
|
||||
</view>
|
||||
<view class="x_"></view>
|
||||
<view class="title_">
|
||||
<text style="color: red;">*</text>
|
||||
汇报内容
|
||||
</view>
|
||||
<u--textarea v-model="report.reportContent" placeholder="请输入内容"></u--textarea>
|
||||
<view class="x_"></view>
|
||||
<view class="d_b" @click="handleUpload">
|
||||
<view class="">附件</view>
|
||||
<view class="lan_">上传附件
|
||||
<image src="/static/imgs/add.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<u-upload
|
||||
ref="uploadRef"
|
||||
:fileList="fileList1"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
name="1"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
v-show="fileList1.length > 0"
|
||||
>
|
||||
</u-upload>
|
||||
<view class="hui_box" v-if="fileList1.length == 0">
|
||||
<image src="/static/imgs/wod.png" mode=""></image>
|
||||
<view class="">
|
||||
<view class="big_">附件格式pdf/jpg/png</view>
|
||||
<view class="sm_">100KB</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="anniu" @click="onSubmit">
|
||||
{{ buttonTitle}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-datetime-picker
|
||||
:show="show"
|
||||
@cancel="show = false"
|
||||
@confirm="selectReportTime"
|
||||
v-model="report.reportTime"
|
||||
mode="datetime"
|
||||
></u-datetime-picker>
|
||||
|
||||
<qianziyu-select
|
||||
:show="isShowReportTo"
|
||||
type="checkbox"
|
||||
name="nickname"
|
||||
:dataLists="reportToList"
|
||||
:showSearch=false
|
||||
@cancel="isShowReportTo = false"
|
||||
:checkboxData="report.reportTos"
|
||||
@submit="onReportToSubmit"
|
||||
popupTitle='汇报对象选择'
|
||||
@update:checkboxData="report.reportTos = $event"
|
||||
>
|
||||
</qianziyu-select>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headersVue from '../../../components/header/headers.vue';
|
||||
import request from "@/utils/request";
|
||||
import {formatDateTimeToMinute} from "@/utils/utils";
|
||||
import upload from "@/utils/upload";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: "汇报",
|
||||
List: [],
|
||||
show: false,
|
||||
status: 'loading',
|
||||
value: '',
|
||||
value1: Number(new Date()),
|
||||
value2: '',
|
||||
show1: false,
|
||||
report: {
|
||||
reportTopic: '',
|
||||
reportContent: '',
|
||||
reportTime: formatDateTimeToMinute(new Date()),
|
||||
reportTos: [],
|
||||
servicePackageId: "jiance",
|
||||
},
|
||||
isShowReportTo: false,
|
||||
reportToList: [],
|
||||
reportTosStr:null,
|
||||
fileList1: [],
|
||||
buttonTitle:"保存",
|
||||
}
|
||||
},
|
||||
components: {
|
||||
headersVue
|
||||
},
|
||||
onLoad(data) {
|
||||
if (data.id) {
|
||||
this.buttonTitle="修改"
|
||||
console.log(data.id)
|
||||
this.getWorkReport(data.id)
|
||||
}
|
||||
this.getReportTo()
|
||||
},
|
||||
methods: {
|
||||
formatDateTimeToMinute,
|
||||
cancelShow() {
|
||||
this.show = !this.show
|
||||
},
|
||||
async getReportTo() {
|
||||
await request({
|
||||
url: '/work/report/queryReportTo',
|
||||
method: 'get',
|
||||
params: {
|
||||
dictType: "ins_report_role"
|
||||
}
|
||||
}).then(res => {
|
||||
this.reportToList = res.data
|
||||
})
|
||||
},
|
||||
onReportToSubmit(selectedData) {
|
||||
this.isShowReportTo = false
|
||||
this.report.reportTos = selectedData
|
||||
this.reportTosStr = selectedData.map(item => item.nickname).join(',')
|
||||
},
|
||||
selectReportTime(e) {
|
||||
this.report.reportTime = formatDateTimeToMinute(e.value)
|
||||
this.show = false
|
||||
},
|
||||
|
||||
// 上传相关方法
|
||||
handleUpload() {
|
||||
// 通过 ref 获取 u-upload 组件实例,并调用其上传方法
|
||||
this.$refs.uploadRef.chooseFile();
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1);
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = this[`fileList${event.name}`].length;
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中",
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url);
|
||||
let item = this[`fileList${event.name}`][fileListLen];
|
||||
this[`fileList${event.name}`].splice(
|
||||
fileListLen,
|
||||
1,
|
||||
Object.assign(item, {
|
||||
status: "success",
|
||||
message: "",
|
||||
url: result,
|
||||
})
|
||||
);
|
||||
fileListLen++;
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// let a = uni.uploadFile({
|
||||
// url: "http://192.168.2.21:7001/upload", // 仅为示例,非真实的接口地址
|
||||
// filePath: url,
|
||||
// name: "file",
|
||||
// formData: {
|
||||
// user: "test",
|
||||
// },
|
||||
// success: (res) => {
|
||||
// setTimeout(() => {
|
||||
// resolve(res.data.data);
|
||||
// }, 1000);
|
||||
// },
|
||||
// });
|
||||
upload({
|
||||
url: '/common/upload',
|
||||
filePath: url,
|
||||
}).then((res) => {
|
||||
resolve(res.data.url);
|
||||
this.forceRefreshFiles(); // 强制刷新文件列表
|
||||
})
|
||||
});
|
||||
},
|
||||
/** 表单提交 */
|
||||
onSubmit() {
|
||||
console.log('提交的数据:', this.report.reportTime)
|
||||
//校验
|
||||
const isValid = this.checkForm()
|
||||
if (!isValid) {
|
||||
return
|
||||
}
|
||||
//将文件转为字符串
|
||||
this.report.filePath = this.fileList1
|
||||
.map(item => item.url.replace(/^https?:\/\/[^/]+\/minio\//, '')) // 去除域名和 minio/
|
||||
.join(',');
|
||||
|
||||
this.report.reportTos = this.report.reportTos.map(item => item.id)
|
||||
let url = '/work/report/create'
|
||||
let method = 'post'
|
||||
if (this.type === 'edit') {
|
||||
url = '/work/report/update'
|
||||
method = 'put'
|
||||
}
|
||||
request({
|
||||
url: url,
|
||||
method: method,
|
||||
data: this.report
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
// 在跳回之前刷新页面
|
||||
uni.navigateBack({
|
||||
delta: 1, // 跳回前一个页面
|
||||
success: () => {
|
||||
// 刷新当前页面数据
|
||||
uni.reLaunch({
|
||||
url: '/pages/manage/workReport/workReport' // 替换为你要刷新页面的路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 校验 */
|
||||
checkForm() {
|
||||
if (this.report.reportTos.length === 0) {
|
||||
if (!this.report.reportTopic) {
|
||||
uni.showToast({
|
||||
title: '请输入汇报主题',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
uni.showToast({
|
||||
title: '请选择汇报对象',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
if (!this.report.reportContent) {
|
||||
uni.showToast({
|
||||
title: '请输入汇报内容',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
/** 获取汇报对象 */
|
||||
async getWorkReport(id) {
|
||||
await request({
|
||||
url: '/work/report/get?id=' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.report = res.data
|
||||
// 根据 ID 数组查找对应的数据,并赋值给 report.reportTos
|
||||
this.report.reportTos = this.reportToList.filter(item => res.data.reportTos.includes(item.id));
|
||||
this.reportTosStr = this.report.reportTos.map(item => item.nickname).join(',')
|
||||
if (res.data.filePath) {
|
||||
this.fileList1 = res.data.filePath.split(',').map(item => {
|
||||
return {
|
||||
url: this.baseImageUrl + "/" + item
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-top: 200rpx;
|
||||
background: #f4f5f6;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.container {
|
||||
background: #f4f5f6;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.box_ {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.title_ {
|
||||
font-size: 28rpx;
|
||||
color: #101A3E;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.x_ {
|
||||
width: 100%;
|
||||
height: 2rpx;
|
||||
background: #f4f5f6;
|
||||
margin: 30rpx 0rpx;
|
||||
}
|
||||
|
||||
.h_ {
|
||||
font-size: 28rpx;
|
||||
color: #8D90A6;
|
||||
}
|
||||
|
||||
.d_s {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.j_ {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background: #D9E0EC;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
line-height: 40rpx;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.d_b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 0rpx;
|
||||
border-top: 2rpx solid #F5F6F9;
|
||||
font-size: 28rpx;
|
||||
color: #8D90A6;
|
||||
|
||||
}
|
||||
|
||||
.telnum {
|
||||
font-size: 24rpx;
|
||||
color: #366FFF;
|
||||
}
|
||||
|
||||
.lan_ {
|
||||
font-size: 28rpx;
|
||||
color: #327DFB;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.hui_box {
|
||||
width: 100%;
|
||||
background: #F5F6F9;
|
||||
border-radius: 16rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.big_ {
|
||||
font-size: 28rpx;
|
||||
color: #101A3E;
|
||||
}
|
||||
|
||||
.sm_ {
|
||||
font-size: 22rpx;
|
||||
color: #8D90A6;
|
||||
}
|
||||
|
||||
.anniu {
|
||||
width: 622rpx;
|
||||
height: 78rpx;
|
||||
background: #427FFE;
|
||||
border-radius: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
</style>
|
221
pages/manage/workReport/reportList.vue
Normal file
@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<headersVue :titles="titles">
|
||||
<u-icon name="arrow-left" color="#fff" size="18"></u-icon>
|
||||
</headersVue>
|
||||
<view class="top_">
|
||||
<view class="search_box">
|
||||
<u-search placeholder="请输入汇报人姓名或汇报主题进行搜索" @search="getReportList" @clear="getReportList" :showAction="false" searchIconColor="#427FFE" v-model="queryParams.topicOrUserName"></u-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container">
|
||||
<view class="c_box" v-for="(item,index) in reportList" :key="index" @click="goDetails(item)">
|
||||
<view class="c_ds" style="margin-bottom: 15px;">
|
||||
<view class="touxiang_">
|
||||
<image :src="baseImageUrl + '/' + item.avatar" mode="" v-if="item.avatar"></image>
|
||||
<image src="/static/imgs/yh.png" mode="" v-else></image>
|
||||
</view>
|
||||
<view class="name_">{{ item.userName}}</view>
|
||||
<view class="icon_">{{ item.reportTopic }}</view>
|
||||
</view>
|
||||
<view class="c_ds">
|
||||
<view class="" style="color: #8D90A6;">汇报时间:</view>
|
||||
<view class="">{{ formatDateChinese(item.reportTime) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%; height: 60px; "></view>
|
||||
|
||||
<view class="bottom_" @click="goDetails()">
|
||||
<view class="bottom_box">填写汇报</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headersVue from '../../../components/header/headers.vue';
|
||||
import config from "@/config";
|
||||
import {formatDateChinese, formatDateTimeToMinute} from "@/utils/utils";
|
||||
import request from "@/utils/request";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: "汇报列表",
|
||||
List: [],
|
||||
show: false,
|
||||
status: 'loading',
|
||||
reportList: [],
|
||||
showPopup: false, // 控制筛选弹窗显示
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
reportTopic: null,
|
||||
reportTime: [],
|
||||
createTime: [],
|
||||
userName: null,
|
||||
servicePackageId: "jiance",
|
||||
dictType: 'ins_high_rise',
|
||||
topicOrUserName: '',
|
||||
},
|
||||
showStarTime: false,
|
||||
showEndTime: false,
|
||||
baseImageUrl: config.baseImageUrl,
|
||||
totalPages: 0,
|
||||
reportTimeStr: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
headersVue
|
||||
},
|
||||
onLoad() {
|
||||
this.getReportList();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.queryParams.pageNo >= this.totalPages) {
|
||||
uni.showToast({
|
||||
title: '没有下一页数据',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
} else {
|
||||
this.queryParams.pageNo++
|
||||
this.getReportList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatDateChinese,
|
||||
formatDateTimeToMinute,
|
||||
// 获取汇报列表
|
||||
getReportList() {
|
||||
request({
|
||||
url: "/work/report/page",
|
||||
method: "GET",
|
||||
params: this.queryParams,
|
||||
}).then((res) => {
|
||||
if (this.queryParams.pageNo != 1) {
|
||||
this.reportList = this.reportList.concat(res.data.records);
|
||||
} else {
|
||||
this.reportList = res.data.records;
|
||||
}
|
||||
let total = res.total;
|
||||
this.totalPages = Math.ceil(total / this.queryParams.pageSize);
|
||||
});
|
||||
},
|
||||
goDetails(data) {
|
||||
if (!data) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/manage/workReport/reportDetals'
|
||||
})
|
||||
}else {
|
||||
console.log('id', data)
|
||||
uni.navigateTo({
|
||||
url: '/pages/manage/workReport/reportDetals?id=' + data.id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-top: 200rpx;
|
||||
background: #f4f5f6;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.container {
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
background: #f4f5f6;
|
||||
}
|
||||
|
||||
.search_box{
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 2rpx solid #F5F5F5;
|
||||
}
|
||||
|
||||
.top_{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
background: #fff;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.c_box {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.c_ds {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.touxiang_ {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-right: 20rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.name_ {
|
||||
font-size: 32rpx;
|
||||
color: #101A3E;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.icon_ {
|
||||
background: #eaf2fe;
|
||||
box-sizing: border-box;
|
||||
padding: 5rpx 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 16rpx;
|
||||
color: #427FFE;
|
||||
}
|
||||
|
||||
.bottom_ {
|
||||
width: 100%;
|
||||
height: 158rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx -1rpx 24rpx 0rpx rgba(0, 0, 0, 0.1);
|
||||
border-radius: 15px 15px 0px 0px;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.bottom_box {
|
||||
width: 600rpx;
|
||||
height: 78rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: #427FFE;
|
||||
border: 2rpx solid #427FFE;
|
||||
border-radius: 50px;
|
||||
margin: 30rpx;
|
||||
}
|
||||
</style>
|
BIN
static/imgs/add.png
Normal file
After Width: | Height: | Size: 550 B |
BIN
static/imgs/box_.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
static/imgs/car.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
static/imgs/gengduo.png
Normal file
After Width: | Height: | Size: 824 B |
BIN
static/imgs/jg1.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
static/imgs/jg10.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
static/imgs/jg2.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
static/imgs/jg3.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
static/imgs/jg4.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
static/imgs/jg5.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
static/imgs/jg6.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
static/imgs/jg7.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
static/imgs/jg8.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
static/imgs/jg9.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
static/imgs/logo.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
static/imgs/nb1.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
static/imgs/nb2.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
static/imgs/nb3.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
static/imgs/nb4.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
static/imgs/ns.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
static/imgs/num1.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
static/imgs/num2.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
static/imgs/num3.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
static/imgs/s1.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
static/imgs/s2.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
static/imgs/s3.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
static/imgs/s4.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
static/imgs/t1.png
Normal file
After Width: | Height: | Size: 841 B |
BIN
static/imgs/t2.png
Normal file
After Width: | Height: | Size: 991 B |
BIN
static/imgs/t3.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
static/imgs/tel.png
Normal file
After Width: | Height: | Size: 954 B |
BIN
static/imgs/touxiang.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
static/imgs/wod.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
static/imgs/xiaoxi.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
static/imgs/yh.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
@ -33,6 +33,16 @@ export function formatDate(timestamp) {
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
export function formatDateChinese(timestamp) {
|
||||
// 将时间戳转换为Date对象
|
||||
const date = new Date(timestamp);
|
||||
// 获取年月日时分秒
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}年${month}月${day}日`;
|
||||
}
|
||||
|
||||
export function formatDateTimeToMinute(timestamp) {
|
||||
// 将时间戳转换为 Date 对象
|
||||
|