代码优化

This commit is contained in:
BianLzhaoMin 2025-02-14 17:46:31 +08:00
parent f9d9bf2cf8
commit 16230562e8
6 changed files with 1207 additions and 1120 deletions

205
config.js
View File

@ -39,103 +39,118 @@
// } // }
// 测试环境 // 测试环境
module.exports = { module.exports = {
// baseUrl:'/prod-api', // baseUrl:'/prod-api',
// http://192.168.0.14:19999 // http://192.168.0.14:19999
// loginBaseUrl: 'http://112.29.103.165:1616', // loginBaseUrl: 'http://112.29.103.165:1616',
// // loginBaseUrl: 'http://192.168.0.14:27018', // // loginBaseUrl: 'http://192.168.0.14:27018',
// // loginBaseUrl:'http://192.168.0.14:19999', // // loginBaseUrl:'http://192.168.0.14:19999',
// // baseUrl:'http://192.168.0.14:2900', // // baseUrl:'http://192.168.0.14:2900',
// baseUrl: 'http://192.168.0.14:19999', // baseUrl: 'http://192.168.0.14:19999',
// // loginUrl: 'http://112.29.103.165:1616', // // loginUrl: 'http://112.29.103.165:1616',
// login: 'http://192.168.0.14:19200', // login: 'http://192.168.0.14:19200',
// // 图片展示基础地址 // // 图片展示基础地址
// fileUrl: 'http://192.168.0.14:19999/exam-file/', // fileUrl: 'http://192.168.0.14:19999/exam-file/',
// // 上传文件地址 // // 上传文件地址
// uploadUrl: 'http://192.168.0.14:19999/exam-file/file/uploadBase64', // uploadUrl: 'http://192.168.0.14:19999/exam-file/file/uploadBase64',
// bmwUrl: 'http://192.168.0.14:19999/exam-bmw', // bmwUrl: 'http://192.168.0.14:19999/exam-bmw',
// // 体检-基础路径 // // 体检-基础路径
// tjBaseUrl: 'http://192.168.0.14:18077/AppPeaManager', // tjBaseUrl: 'http://192.168.0.14:18077/AppPeaManager',
// // tjBaseUrl: 'http://192.168.2.91:19100/AppPeaManager', // // tjBaseUrl: 'http://192.168.2.91:19100/AppPeaManager',
// tjFile: 'http://192.168.0.14:18077/medicalDocumentation/statics/', // tjFile: 'http://192.168.0.14:18077/medicalDocumentation/statics/',
// 兰坪实名制 - 本地
// realBaseUrl: 'http://192.168.0.44:31910/',
// //兰坪实名制移动端--移动
// realAppUrl: 'http://192.168.0.44:31913/app',
// //兰坪实名制移动端--登录
// lpLoginUrl: 'http://192.168.0.44:39200/',
// //兰坪实名制移动端--后台
// lpBmwUrl: 'http://192.168.0.44:31912',
// // 兰坪实名制移动端-文件
// realFileUrl: 'http://192.168.0.44:31909/file/',
// // 兰坪实名制移动端-安培
// lpExamUrl: 'http://192.168.0.44:31910',
// 兰坪实名制 - 本地 // //兰坪实名制 - 测试
// realBaseUrl: 'http://192.168.0.44:31910/', // realBaseUrl: 'http://192.168.0.14:31910/',
// //兰坪实名制移动端--移动 // //兰坪实名制移动端--移动
// realAppUrl: 'http://192.168.0.44:31913/app', // realAppUrl: 'http://192.168.0.14:31913/app',
// //兰坪实名制移动端--登录 // //兰坪实名制移动端--登录
// lpLoginUrl: 'http://192.168.0.44:39200/', // lpLoginUrl: 'http://192.168.0.14:39200/',
// //兰坪实名制移动端--后台 // //兰坪实名制移动端--后台
// lpBmwUrl: 'http://192.168.0.44:31912', // lpBmwUrl: 'http://192.168.0.14:31912',
// // 兰坪实名制移动端-文件 // // 兰坪实名制移动端-文件
// realFileUrl: 'http://192.168.0.44:31909/file/', // realFileUrl: 'http://192.168.0.14:31909/file/',
// // 兰坪实名制移动端-安培 // // 兰坪实名制移动端-安培
// lpExamUrl: 'http://192.168.0.44:31910', // lpExamUrl: 'http://192.168.0.14:31910',
//兰坪实名制 - 测试
realBaseUrl: 'http://192.168.0.14:31910/',
//兰坪实名制移动端--移动
realAppUrl: 'http://192.168.0.14:31913/app',
//兰坪实名制移动端--登录
lpLoginUrl: 'http://192.168.0.14:39200/',
//兰坪实名制移动端--后台
lpBmwUrl: 'http://192.168.0.14:31912',
// 兰坪实名制移动端-文件
realFileUrl: 'http://192.168.0.14:31909/file/',
// 兰坪实名制移动端-安培
lpExamUrl: 'http://192.168.0.14:31910',
// 实名制移动端 -- 新
realNewYnUrl: 'http://192.168.0.14:1918',
realIdCardUrl: 'http://192.168.0.14:26699',
baseUrl: 'http://192.168.0.14:19999',
// 兰坪实名制 线上环境
// realAppUrl: 'http://112.29.103.165:14413/app',
// lpLoginUrl : 'http://112.29.103.165:14413/auth/',
// lpBmwUrl : 'http://112.29.103.165:14413',
// realFileUrl: 'http://192.168.0.14:1909/file/',
// lpExamUrl : 'http://112.29.103.165:14413/system/',
//实名制移动端 线上环境
// realNewYnUrl : 'http://112.29.103.165:14413/ynPlan',
// baseUrl: 'http://112.29.103.165:1616/exam',
// realIdCardUrl: 'http://112.29.103.165:1616/exam',
// http://112.29.103.165:1616/exam/exam-student/personalCenter/getFaceRecognition
// //实名制移动端-登录接口 // // 实名制移动端 -- 新
// realLoginUrl: 'http://192.168.0.14:1616/auth/', // realNewYnUrl: 'http://192.168.0.14:1918',
// realBaseUrl: 'http://192.168.0.14:1910/', // realIdCardUrl: 'http://192.168.0.14:26699',
// //实名制移动端-移动 // baseUrl: 'http://192.168.0.14:19999',
// realAppUrl: 'http://192.168.0.14:1913/app',
// //实名制移动端-安培
// realExamUrl: 'http://192.168.0.14:1616/system',
// //实名制移动端-文件
// realFileUrl: 'http://192.168.0.14:1909/file/',
// //实名制移动端
// realBmwUrl: 'http://192.168.0.14:1616/bmw',
// //实名制移动端 -- 新
// realNewBmwUrl: 'http://192.168.0.14:1616',
// loginUrl: 'http://192.168.0.14:27018',
// //实名制移动端 -- 新
// realNewYnUrl: 'http://192.168.0.14:1918',
// realIdCardUrl: 'http://192.168.0.14:26699',
// //作业计划 -- 新 //兰坪实名制 - 测试
// workPlanNewYnUrl: 'http://192.168.0.14:19191', realBaseUrl: 'http://192.168.2.209:31910/',
//兰坪实名制移动端--移动
realAppUrl: 'http://192.168.2.209:31913/app',
//兰坪实名制移动端--登录
lpLoginUrl: 'http://192.168.2.209:39200/',
//兰坪实名制移动端--后台
lpBmwUrl: 'http://192.168.2.209:31912',
// 兰坪实名制移动端-文件
realFileUrl: 'http://192.168.2.209:31909/file/',
// 兰坪实名制移动端-安培
lpExamUrl: 'http://192.168.2.209:31910',
// 应用信息 // 实名制移动端 -- 新
appInfo: { realNewYnUrl: 'http://192.168.2.209:1918',
// 应用名称 realIdCardUrl: 'http://192.168.2.209:26699',
name: '作业管控智慧平台', baseUrl: 'http://192.168.2.209:19999',
// 应用版本
version: '1.1.0' // 兰坪实名制 线上环境
} // realAppUrl: 'http://112.29.103.165:14413/app',
}
// lpLoginUrl : 'http://112.29.103.165:14413/auth/',
// lpBmwUrl : 'http://112.29.103.165:14413',
// realFileUrl: 'http://192.168.0.14:1909/file/',
// lpExamUrl : 'http://112.29.103.165:14413/system/',
//实名制移动端 线上环境
// realNewYnUrl : 'http://112.29.103.165:14413/ynPlan',
// baseUrl: 'http://112.29.103.165:1616/exam',
// realIdCardUrl: 'http://112.29.103.165:1616/exam',
// http://112.29.103.165:1616/exam/exam-student/personalCenter/getFaceRecognition
// //实名制移动端-登录接口
// realLoginUrl: 'http://192.168.0.14:1616/auth/',
// realBaseUrl: 'http://192.168.0.14:1910/',
// //实名制移动端-移动
// realAppUrl: 'http://192.168.0.14:1913/app',
// //实名制移动端-安培
// realExamUrl: 'http://192.168.0.14:1616/system',
// //实名制移动端-文件
// realFileUrl: 'http://192.168.0.14:1909/file/',
// //实名制移动端
// realBmwUrl: 'http://192.168.0.14:1616/bmw',
// //实名制移动端 -- 新
// realNewBmwUrl: 'http://192.168.0.14:1616',
// loginUrl: 'http://192.168.0.14:27018',
// //实名制移动端 -- 新
// realNewYnUrl: 'http://192.168.0.14:1918',
// realIdCardUrl: 'http://192.168.0.14:26699',
// //作业计划 -- 新
// workPlanNewYnUrl: 'http://192.168.0.14:19191',
// 应用信息
appInfo: {
// 应用名称
name: '作业管控智慧平台',
// 应用版本
version: '1.1.0'
}
}

View File

@ -159,15 +159,19 @@ export default {
let errorMessage = '' let errorMessage = ''
this.tableData.forEach((item, index) => { this.tableData.forEach((item, index) => {
const totalNum = item.totalNum console.log('item,指定计划时的每一项', item)
const totalNum = parseInt(item.totalNum)
console.log('totalNum', totalNum) console.log('totalNum', totalNum)
const completeNumAllDay = Number(item.completeNumDay) || 0 // const completeNumAllDay = Number(item.completeNumDay) || 0
const completeNumAllDay = parseInt(item.completeNumAllDay)
console.log('completeNumAllDay', completeNumAllDay) console.log('completeNumAllDay', completeNumAllDay)
const completeNumDay = item.completeNumDay // const completeNumDay = item.completeNumDay
const completeNumDay = parseInt(item.completeNumDay)
console.log('completeNumDay', completeNumDay) console.log('completeNumDay', completeNumDay)
console.log(completeNumDay + completeNumAllDay > totalNum, 'completeNumDay + completeNumAllDay > totalNum')
if (completeNumDay + completeNumAllDay > totalNum) { if (completeNumDay + completeNumAllDay > totalNum) {
isValid = false isValid = false
errorMessage += `${index + 1} 行: 本日计划完成量 + 本月已定计划量 不能大于 本月计划量\n` errorMessage += `${index + 1} 行: 本日计划完成量 + 本月已定计划量 不能大于 本月计划量\n`

File diff suppressed because it is too large Load Diff

View File

@ -1,469 +1,506 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar class="u-navbar" title="暂退人员选择" placeholder @leftClick="leftClick" leftIconColor="#fff" bgColor="#00337A" :titleStyle="{ color: '#FFF', fontSize: '32rpx' }"></u-navbar> <u-navbar
class="u-navbar"
<scroll-view class="content" scroll-y="true"> title="暂退人员选择"
<view class="view-box"> placeholder
<!-- <view style="width: 96%;padding:10rpx;margin: 0 auto;;margin-bottom: 10rpx;">{{proName}}</view> --> @leftClick="leftClick"
<view class="form-box"> leftIconColor="#fff"
<view class="form-input-box"> bgColor="#00337A"
<view style="width:60%;height: 100%;"> :titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
<u--input v-model="keyWord" type="text" placeholder="请输入人员姓名" maxlength="20" border="surround" clearable></u--input> ></u-navbar>
</view>
<view class="submitBtn" @click="selectSuspendCheckList">查询</view>
</view>
</view>
<view style="width: 100%;height: 75vh;display: flex;align-items: center;justify-content: center;" v-if="isLoading">
<u-loading-icon :show="true" mode="circle" text="加载中" :vertical="true"></u-loading-icon>
</view>
<view v-if="!isLoading&&listData.length==0" style="width: 96%;height: 66vh;display: flex;flex-direction: column;justify-content: center;align-items: center;" >
<image src="../../../../static/realName/noData.png" style="width: 100rpx;height: 120rpx;" mode=""></image>
<view>暂无数据</view>
</view>
<u-list height="75vh" v-if="!isLoading&&listData.length>0">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="content-box">
<view style="display: flex;align-items: center;">
<view style="width: 10%;" @change="checkSelect(item)">
<u-checkbox-group v-model="item.checked">
<u-checkbox :customStyle="{margin: '0rpx 10rpx'}" :label="''" :name="item.idNumber"></u-checkbox>
</u-checkbox-group>
</view>
<view style="width: 85%;" @change="checkSelect(item)">
<view class="item-text">
<text class="label">姓名</text>
<text class="info">{{item.name}}</text>
</view>
<view class="item-text" >
<text class="label">身份证号</text>
<text class="info">{{item.idNumber}}</text>
</view>
<view class="item-text" >
<text class="label">是否考勤</text>
<text class="info" v-if="item.isAtt==0" style="color: #FF2F2F;">未考勤</text>
<text class="info" v-if="item.isAtt==1" style="color: #10BF95;">已考勤</text>
</view>
</view>
</view>
</view>
</view>
</u-list-item>
</u-list>
<view style="width:92%;height: 90rpx;display: flex;align-items: center;justify-content: flex-end;">
<view @click="handleAdd" style="width:25%;height:70rpx;line-height: 70rpx;text-align: center;background: #00337A;color: #FFF;border-radius: 10rpx;">确定</view>
</view>
</view>
</scroll-view>
<scroll-view class="content" scroll-y="true">
<view class="view-box">
<!-- <view style="width: 96%;padding:10rpx;margin: 0 auto;;margin-bottom: 10rpx;">{{proName}}</view> -->
<view class="form-box">
<view class="form-input-box">
<view style="width: 60%; height: 100%">
<u--input
v-model="keyWord"
type="text"
placeholder="请输入人员姓名"
maxlength="20"
border="surround"
clearable
></u--input>
</view>
<view class="submitBtn" @click="selectSuspendCheckList">查询</view>
</view>
</view>
<view
style="width: 100%; height: 75vh; display: flex; align-items: center; justify-content: center"
v-if="isLoading"
>
<u-loading-icon :show="true" mode="circle" text="加载中" :vertical="true"></u-loading-icon>
</view>
<view
v-if="!isLoading && listData.length == 0"
style="
width: 96%;
height: 66vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
>
<image src="../../../../static/realName/noData.png" style="width: 100rpx; height: 120rpx" mode=""></image>
<view>暂无数据</view>
</view>
<u-list height="75vh" v-if="!isLoading && listData.length > 0">
<u-list-item v-for="(item, index) in listData" :key="item.idNumber">
<view class="list-item">
<view class="content-box">
<view style="display: flex; align-items: center">
<view style="width: 10%" @change="checkSelect(item)">
<u-checkbox-group v-model="item.checked">
<u-checkbox
:customStyle="{ margin: '0rpx 10rpx' }"
:label="''"
:name="item.idNumber"
></u-checkbox>
</u-checkbox-group>
</view>
<view style="width: 85%" @change="checkSelect(item)">
<view class="item-text">
<text class="label">姓名</text>
<text class="info">{{ item.name }}</text>
</view>
<view class="item-text">
<text class="label">身份证号</text>
<text class="info">{{ item.idNumber }}</text>
</view>
<view class="item-text">
<text class="label">是否考勤</text>
<text class="info" v-if="item.isAtt == 0" style="color: #ff2f2f">未考勤</text>
<text class="info" v-if="item.isAtt == 1" style="color: #10bf95">已考勤</text>
</view>
</view>
</view>
</view>
</view>
</u-list-item>
</u-list>
<view style="width: 92%; height: 90rpx; display: flex; align-items: center; justify-content: flex-end">
<view
@click="handleAdd"
style="
width: 25%;
height: 70rpx;
line-height: 70rpx;
text-align: center;
background: #00337a;
color: #fff;
border-radius: 10rpx;
"
>
确定
</view>
</view>
</view>
</scroll-view>
</view> </view>
</template> </template>
<script> <script>
import { pathToBase64, base64ToPath } from 'image-tools'; import { pathToBase64, base64ToPath } from 'image-tools'
import config from '@/config' import config from '@/config'
export default { export default {
data() { data() {
return { return {
proId:uni.getStorageSync('realNameUser').proId, proId: uni.getStorageSync('realNameUser').proId,
proName:"", proName: '',
teamId:uni.getStorageSync('realNameUser').teamId, teamId: uni.getStorageSync('realNameUser').teamId,
userId:uni.getStorageSync('realNameUser').userId, userId: uni.getStorageSync('realNameUser').userId,
keyWord:"", keyWord: '',
isCheckAll:false, isCheckAll: false,
isLoading:false, isLoading: false,
listData:[], listData: []
} }
}, },
onLoad(option) { onLoad(option) {
// this.getPro() // this.getPro()
}, },
onShow() { onShow() {
this.selectSuspendCheckList() this.selectSuspendCheckList()
}, },
methods: { methods: {
// //
getPro(){ getPro() {
let param={ let param = {
id:this.proId, id: this.proId,
subId:-1 subId: -1
} }
uni.request({ uni.request({
url: config.realAppUrl + '/offLine/getPro', url: config.realAppUrl + '/offLine/getPro',
method: 'post', method: 'post',
data: param, data: param,
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('realNameToken') Authorization: uni.getStorageSync('realNameToken')
}, },
success: res => { success: res => {
res = res.data; res = res.data
if(res.code==200){ if (res.code == 200) {
console.log(res) console.log(res)
this.proName = res.data[0].abbreviation||""; this.proName = res.data[0].abbreviation || ''
} }
}, },
fail: err => { fail: err => {
console.log(err) console.log(err)
} }
}) })
}, },
//退 //退
selectSuspendCheckList(){ selectSuspendCheckList() {
let param={ let param = {
proId:uni.getStorageSync('realNameUser').proId, proId: uni.getStorageSync('realNameUser').proId,
name:this.keyWord name: this.keyWord
} }
console.log(param) console.log(param)
this.listData=[] this.listData = []
this.isLoading=true; this.isLoading = true
uni.request({ uni.request({
url: config.realAppUrl+'/suspend/selectSuspendCheckList', url: config.realAppUrl + '/suspend/selectSuspendCheckList',
method: 'post', method: 'post',
data: param, data: param,
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('realNameToken') Authorization: uni.getStorageSync('realNameToken')
}, },
success: res => { success: res => {
console.log(res) console.log(res)
this.isLoading=false; this.isLoading = false
res = res.data; res = res.data
if(res.code==200){ if (res.code == 200) {
res.data.forEach(item=>{ res.data.forEach(item => {
item.checked=[]; item.checked = []
}) })
this.listData=res.data; this.listData = res.data
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}) })
} }
}, },
fail: err => { fail: err => {
this.isLoading=false; this.isLoading = false
console.log(err) console.log(err)
} }
}) })
}, },
// //
checkSelect(chosen){ checkSelect(chosen) {
console.log(chosen) console.log(chosen)
this.listData.forEach(item=>{ this.listData.forEach(item => {
if(item.idNumber==chosen.idNumber){ if (item.idNumber == chosen.idNumber) {
if(item.checked.length==0){ if (item.checked.length == 0) {
item.checked=[item.idNumber] item.checked = [item.idNumber]
}else{ } else {
item.checked=[] item.checked = []
} }
} }
}) })
}, },
// //
handleAdd(){ handleAdd() {
let paramsList = [] let paramsList = []
this.listData.forEach(item=>{ this.listData.forEach(item => {
if(item.checked.length>0){ if (item.checked.length > 0) {
let obj={ let obj = {
idNumber:item.idNumber, idNumber: item.idNumber,
proId:item.proId proId: item.proId
} }
paramsList.push(obj) paramsList.push(obj)
} }
}) })
if(paramsList.length>0){ if (paramsList.length > 0) {
uni.showModal({ uni.showModal({
title: `确认是否暂退所选人员?`, title: `确认是否暂退所选人员?`,
cancelText: '取消', cancelText: '取消',
confirmText: '确定', confirmText: '确定',
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
console.log(paramsList) console.log(paramsList)
this.addSuspendPerson(paramsList) this.addSuspendPerson(paramsList)
} }
} }
}); })
}else{ } else {
uni.showToast({ uni.showToast({
title: '请先勾选人员!', title: '请先勾选人员!',
icon: 'none' icon: 'none'
}) })
} }
}, },
//退 //退
addSuspendPerson(params){ addSuspendPerson(params) {
uni.request({ uni.request({
url: config.realAppUrl+'/suspend/addSuspendPerson', url: config.realAppUrl + '/suspend/addSuspendPerson',
method: 'post', method: 'post',
data: params, data: params,
header: { header: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
Authorization: uni.getStorageSync('realNameToken') Authorization: uni.getStorageSync('realNameToken')
}, },
success: res => { success: res => {
console.log(res) console.log(res)
res = res.data; res = res.data
if(res.code==200){ if (res.code == 200) {
uni.showToast({ uni.showToast({
title: res.data, title: res.data,
icon: 'none' icon: 'none'
}) })
this.selectSuspendCheckList() this.selectSuspendCheckList()
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}) })
} }
}, },
fail: err => { fail: err => {
console.log(err) console.log(err)
} }
}) })
}, },
leftClick() { leftClick() {
console.log('返回') console.log('返回')
uni.navigateBack({ uni.navigateBack({
delta: 1 // delta: 1 //
}); })
}, },
timeFormat(dateTime = null, formatStr = 'yyyy-mm-dd') { timeFormat(dateTime = null, formatStr = 'yyyy-mm-dd') {
let date let date
// //
if (!dateTime) { if (!dateTime) {
date = new Date() date = new Date()
} }
// unix // unix
else if (/^\d{10}$/.test(dateTime?.toString().trim())) { else if (/^\d{10}$/.test(dateTime?.toString().trim())) {
date = new Date(dateTime * 1000) date = new Date(dateTime * 1000)
} }
// new Date // new Date
else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) { else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) {
date = new Date(Number(dateTime)) date = new Date(Number(dateTime))
} }
// Safari/Webkitnew Date/ // Safari/Webkitnew Date/
// '2022-07-10 01:02:03' '2022-07-10T01:02:03' // '2022-07-10 01:02:03' '2022-07-10T01:02:03'
else if (typeof dateTime === 'string' && dateTime.includes('-') && !dateTime.includes('T')) { else if (typeof dateTime === 'string' && dateTime.includes('-') && !dateTime.includes('T')) {
date = new Date(dateTime.replace(/-/g, '/')) date = new Date(dateTime.replace(/-/g, '/'))
} }
// RFC 2822 // RFC 2822
else { else {
date = new Date(dateTime) date = new Date(dateTime)
} }
const timeSource = { const timeSource = {
'y': date.getFullYear().toString(), // y: date.getFullYear().toString(), //
'm': (date.getMonth() + 1).toString().padStart(2, '0'), // m: (date.getMonth() + 1).toString().padStart(2, '0'), //
'd': date.getDate().toString().padStart(2, '0'), // d: date.getDate().toString().padStart(2, '0'), //
'h': date.getHours().toString().padStart(2, '0'), // h: date.getHours().toString().padStart(2, '0'), //
'M': date.getMinutes().toString().padStart(2, '0'), // M: date.getMinutes().toString().padStart(2, '0'), //
's': date.getSeconds().toString().padStart(2, '0') // s: date.getSeconds().toString().padStart(2, '0') //
// //
} }
for (const key in timeSource) { for (const key in timeSource) {
const [ret] = new RegExp(`${key}+`).exec(formatStr) || [] const [ret] = new RegExp(`${key}+`).exec(formatStr) || []
if (ret) { if (ret) {
// //
const beginIndex = key === 'y' && ret.length === 2 ? 2 : 0 const beginIndex = key === 'y' && ret.length === 2 ? 2 : 0
formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex)) formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex))
} }
} }
return formatStr return formatStr
}, }
}, }
} }
</script> </script>
<style lang="scss">
.page {
width: 100vw;
height: 100vh;
background-color: #EFEFEF;
box-sizing: border-box;
.tab-box {
width: 100%;
margin: 0rpx auto;
padding-top: 20rpx;
display: flex;
justify-content: space-between;
background-color: #FFF;
.tab-item {
height: 70upx;
width: 45%;
font-size: 30upx;
text-align: center;
line-height: 70upx;
color: #666;
}
.active {
color: #00337A;
border-radius: 10upx 10upx 0 0;
font-weight: bold;
}
.activeLine{
background: #00337A;
border-radius: 10upx;
width: 100%;
height: 6upx;
}
}
.submitBtn{
width: 30%;
height: 50rpx;
line-height: 50rpx;
border-radius: 10rpx;
background: #00337A;
color: #FFF;
padding: 10rpx 16rpx;
margin: 0 20rpx;
text-align: center;
}
.content{
width: 100%;
height: 88vh;
// padding-bottom: 80rpx;
background-color: #EFEFEF;
}
// padding: 0 20px;
.view-box{
width: 100%;
height: auto;
margin: 0rpx auto;
border-radius: 10rpx;
// background-color: red;
.title-view{
font-weight: 600;
margin-left: 20rpx;
border-bottom: 1rpx solid #EFEFEF;
}
.form-box{
width: 100%;
height: auto;
font-size: 26rpx;
background-color: #FFF;
.form-input-box{
padding: 20rpx 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.view-item{
width: 94%;
margin: 0rpx auto;
padding:10rpx;
display: flex;
border-bottom: 1rpx solid #EFEFEF;
font-size: 26rpx;
.label{
width: 160rpx;
color: #666;
margin-bottom: 10rpx;
}
.img-box{
width: 94%;
height: auto;
margin: 0rpx auto;
padding:10rpx;
display: flex;
border-bottom: 1rpx solid #EFEFEF;
.img-item {
float: left;
width: 200upx;
height: 200upx;
border: 1px solid #ddd;
margin: 0 22rpx 20upx 0upx;
position: relative;
box-sizing: border-box;
background: #eee;
.img {
display: block;
width: 100%;
height: 100%;
}
.remove-btn {
position: absolute;
top: -18upx;
right: -18upx;
width: 44upx;
height: 44upx;
z-index: 2;
}
}
.upload-btn {
display: flex;
justify-content: center;
align-items: center;
.img {
width: 60upx;
height: 60upx;
margin: unset;
}
}
}
}
.sumbit-btn{
width: 94%;
height: 80rpx;
margin: 0 auto;
margin-bottom: 100rpx;
display: flex;align-items: center;justify-content: center;
background: #00337A;
color: #FFF;
border-radius: 10rpx;
}
}
.list-item{
width: 100%;
height: auto;
background-color: #fff;
border-radius: 20rpx;
margin: 20rpx 0;
.content-box{
width: 96%;
height: auto;
margin: 20rpx;
// background-color: #F2F6F9;
padding: 10rpx 0;
.item-text{
width: 96%;
margin-left: 20rpx;
margin-top: 15rpx;
// display: flex;
align-items: center;
position: relative;
.label{
color: #999;
// font-weight: 500;
}
.info-right{
position: absolute;
top: 0rpx;
right: 40rpx;
}
.info{
color: #6F6F6F;
}
}
}
}
<style lang="scss">
.page {
width: 100vw;
height: 100vh;
background-color: #efefef;
box-sizing: border-box;
.tab-box {
width: 100%;
margin: 0rpx auto;
padding-top: 20rpx;
display: flex;
justify-content: space-between;
background-color: #fff;
.tab-item {
height: 70upx;
width: 45%;
font-size: 30upx;
text-align: center;
line-height: 70upx;
color: #666;
}
.active {
color: #00337a;
border-radius: 10upx 10upx 0 0;
font-weight: bold;
}
.activeLine {
background: #00337a;
border-radius: 10upx;
width: 100%;
height: 6upx;
}
}
.submitBtn {
width: 30%;
height: 50rpx;
line-height: 50rpx;
border-radius: 10rpx;
background: #00337a;
color: #fff;
padding: 10rpx 16rpx;
margin: 0 20rpx;
text-align: center;
}
.content {
width: 100%;
height: 88vh;
// padding-bottom: 80rpx;
background-color: #efefef;
}
// padding: 0 20px;
.view-box {
width: 100%;
height: auto;
margin: 0rpx auto;
border-radius: 10rpx;
// background-color: red;
.title-view {
font-weight: 600;
margin-left: 20rpx;
border-bottom: 1rpx solid #efefef;
}
.form-box {
width: 100%;
height: auto;
font-size: 26rpx;
background-color: #fff;
.form-input-box {
padding: 20rpx 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.view-item {
width: 94%;
margin: 0rpx auto;
padding: 10rpx;
display: flex;
border-bottom: 1rpx solid #efefef;
font-size: 26rpx;
.label {
width: 160rpx;
color: #666;
margin-bottom: 10rpx;
}
.img-box {
width: 94%;
height: auto;
margin: 0rpx auto;
padding: 10rpx;
display: flex;
border-bottom: 1rpx solid #efefef;
.img-item {
float: left;
width: 200upx;
height: 200upx;
border: 1px solid #ddd;
margin: 0 22rpx 20upx 0upx;
position: relative;
box-sizing: border-box;
background: #eee;
.img {
display: block;
width: 100%;
height: 100%;
}
.remove-btn {
position: absolute;
top: -18upx;
right: -18upx;
width: 44upx;
height: 44upx;
z-index: 2;
}
}
.upload-btn {
display: flex;
justify-content: center;
align-items: center;
.img {
width: 60upx;
height: 60upx;
margin: unset;
}
}
}
}
.sumbit-btn {
width: 94%;
height: 80rpx;
margin: 0 auto;
margin-bottom: 100rpx;
display: flex;
align-items: center;
justify-content: center;
background: #00337a;
color: #fff;
border-radius: 10rpx;
}
}
.list-item {
width: 100%;
height: auto;
background-color: #fff;
border-radius: 20rpx;
margin: 20rpx 0;
.content-box {
width: 96%;
height: auto;
margin: 20rpx;
// background-color: #F2F6F9;
padding: 10rpx 0;
.item-text {
width: 96%;
margin-left: 20rpx;
margin-top: 15rpx;
// display: flex;
align-items: center;
position: relative;
.label {
color: #999;
// font-weight: 500;
}
.info-right {
position: absolute;
top: 0rpx;
right: 40rpx;
}
.info {
color: #6f6f6f;
}
}
}
}
} }
</style> </style>

View File

@ -386,14 +386,14 @@
</view> </view>
<view class="form-input-box"> <view class="form-input-box">
<view style="width: 25%; height: 100%; margin-top: 20rpx"> <view style="width: 25%; height: 100%; margin-top: 20rpx">
<text>班组级考试</text> <text>班组级考试</text>
</view> </view>
<view class="img-box"> <view class="img-box">
<view class="img-item upload-btn" @click="uploadFileTraining(2)"> <view class="img-item upload-btn" @click="uploadFileTraining(3)">
<image class="img" src="@/static/realName/tianjia-img.png" mode=""></image> <image class="img" src="@/static/realName/tianjia-img.png" mode=""></image>
</view> </view>
<view class="img-item" v-if="entryTrainBean.eamExamFilePath"> <view class="img-item" v-if="entryTrainBean.teamExamFilePath">
<image class="img" :src="entryTrainBean.eamExamFilePath" mode=""></image> <image class="img" :src="entryTrainBean.teamExamFilePath" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
@ -1104,7 +1104,7 @@ export default {
companyExamFilePath: '', // companyExamFilePath: '', //
deptExamFilePath: '', // deptExamFilePath: '', //
eamExamFilePath: '' // teamExamFilePath: '' //
}, },
entrySubTeamBean: { entrySubTeamBean: {
subId: '', // subId: '', //
@ -1826,7 +1826,7 @@ export default {
this.entryTrainBean.deptExamFilePath = config.realBaseUrl + JSON.parse(uploadFileRes.data).data.url this.entryTrainBean.deptExamFilePath = config.realBaseUrl + JSON.parse(uploadFileRes.data).data.url
} }
if (type === 3) { if (type === 3) {
this.entryTrainBean.eamExamFilePath = config.realBaseUrl + JSON.parse(uploadFileRes.data).data.url this.entryTrainBean.teamExamFilePath = config.realBaseUrl + JSON.parse(uploadFileRes.data).data.url
} }
} else { } else {
uni.$u.toast('上传失败') uni.$u.toast('上传失败')

View File

@ -398,14 +398,14 @@
</view> </view>
<view class="form-input-box"> <view class="form-input-box">
<view style="width: 25%; height: 100%; margin-top: 20rpx"> <view style="width: 25%; height: 100%; margin-top: 20rpx">
<text>班组级考试</text> <text>班组级考试</text>
</view> </view>
<view class="img-box"> <view class="img-box">
<view class="img-item upload-btn" @click="uploadFileTraining(2)"> <view class="img-item upload-btn" @click="uploadFileTraining(3)">
<image class="img" src="@/static/realName/tianjia-img.png" mode=""></image> <image class="img" src="@/static/realName/tianjia-img.png" mode=""></image>
</view> </view>
<view class="img-item" v-if="entryTrainBean.eamExamFilePath"> <view class="img-item" v-if="entryTrainBean.teamExamFilePath">
<image class="img" :src="entryTrainBean.eamExamFilePath" mode=""></image> <image class="img" :src="entryTrainBean.teamExamFilePath" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
@ -1123,7 +1123,7 @@ export default {
isPass: '', // isPass: '', //
companyExamFilePath: '', // companyExamFilePath: '', //
deptExamFilePath: '', // deptExamFilePath: '', //
eamExamFilePath: '' // teamExamFilePath: '' //
}, },
entrySubTeamBean: { entrySubTeamBean: {
subId: '', // subId: '', //
@ -1899,7 +1899,7 @@ export default {
this.entryTrainBean.deptExamFilePath = config.realBaseUrl + JSON.parse(uploadFileRes.data).data.url this.entryTrainBean.deptExamFilePath = config.realBaseUrl + JSON.parse(uploadFileRes.data).data.url
} }
if (type === 3) { if (type === 3) {
this.entryTrainBean.eamExamFilePath = config.realBaseUrl + JSON.parse(uploadFileRes.data).data.url this.entryTrainBean.teamExamFilePath = config.realBaseUrl + JSON.parse(uploadFileRes.data).data.url
} }
} else { } else {
uni.$u.toast('上传失败') uni.$u.toast('上传失败')