This commit is contained in:
yanran200730
2022-05-24 16:31:10 +08:00
parent e7c61c8293
commit 2b8e4dc41d
19 changed files with 255 additions and 72 deletions

View File

@@ -25,7 +25,7 @@
<label>*</label>
<span>拍摄人</span>
</div>
<div class="right" @click="linkTo('./PersonnelSetting')">
<div class="right" @click="linkTo('./PersonnelSetting?id=' + id)">
<span>{{ createUserId ? '已选择' : '不限' }}</span>
<image src="./images/right.png" />
</div>
@@ -57,7 +57,8 @@
photoSource: 0,
watermarkId: '',
isLoading: false,
id: ''
id: '',
albumUserList: []
}
},
@@ -69,6 +70,7 @@
}
uni.$on('change', e => {
console.log(e)
if (e.type === 'watermark') {
this.watermarkId = e.value
}
@@ -76,6 +78,10 @@
if (e.type === 'photoSource') {
this.photoSource = e.value
}
if (e.type === 'personnel') {
this.albumUserList = e.value
}
})
},
@@ -110,6 +116,7 @@
createUserId: this.createUserId,
photoSource: this.photoSource,
watermarkId: this.watermarkId,
albumUserList: this.albumUserList,
id: this.id || ''
}).then(res => {
if (res.code === 0) {

View File

@@ -1,7 +1,7 @@
<template>
<div class="photo">
<div class="photo-header">
<image src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/64f71761d2b04746ad640a43706a92e4~tplv-k3u1fbpfcp-zoom-crop-mark:1304:1304:1304:734.awebp?" mode="aspectFill" />
<image :src="coverImg" mode="aspectFill" />
<div>
<h2>{{ info.albumName }}</h2>
<span @click="linkTo('./AddAlbum?id=' + id)">相册设置</span>
@@ -30,22 +30,22 @@
<h2>照片列表</h2>
<div class="right">
<picker mode="date" @change="onChange">
<div class="right-item">
<div class="right-item" style="margin-right: 0;">
<span>{{ date || '所有日期' }}</span>
<image src="./images/down.png" />
</div>
</picker>
<div class="right-item" style="margin-right: 0;">
<!-- <div class="right-item" style="margin-right: 0;">
<span>所有干部</span>
<image src="./images/down.png" />
</div>
</div> -->
</div>
</div>
<div class="photo-item__wrapper">
<div class="photo-item" @click="linkTo('./Photo?url=' + item.photoUrl + '&id=' + item.id)" v-for="(item, index) in list" :key="index">
<image :src="item.photoUrl" mode="aspectFill" />
<div class="photo-item__text">
<h2>张三</h2>
<h2><AiOpenData v-if="item.wxOpenUserId" type="userName" :openid="item.createUserId"></AiOpenData></h2>
<p>{{ item.createTime }}</p>
</div>
</div>
@@ -117,7 +117,6 @@
},
onChange (e) {
console.log(e)
this.date = e.detail.value
},
@@ -141,6 +140,7 @@
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: this.info.photoSource === '1' ? ['camera'] : ['album', 'camera'],
success: res => {
let formData = new FormData()
formData.append('file', res.tempFiles[0])
@@ -157,6 +157,10 @@
this.$http.post(`/api/appalbumphoto/DetailByAlbumID?albumId=${this.id}`).then(res => {
if (res.code === 0) {
this.list = res.data
if (res.data.length) {
this.coverImg = res.data[0].photoUrl
}
}
})
}
@@ -261,6 +265,7 @@
.photo-header {
position: relative;
height: 400px;
background: rgba(0,0,0, 0.7);
div {
position: relative;
@@ -296,7 +301,6 @@
h2 {
color: #fff;
background: rgba(0,0,0, 0.1);
font-size: 56px;
}
}

View File

@@ -33,11 +33,9 @@ export default {
},
onShow() {
this.$refs?.TabPage?.show()
// this.$refs?.TabPage?.show()
this.$nextTick(() => {
this.injectJWeixin(['sendChatMessage', 'shareAppMessage', 'shareWechatMessage']).then(() => {
this.$dict.load(['questionnaireStatus', 'questionnaireType', 'questionnaireFieldType'])
})
this.injectJWeixin(['getLocation', 'sendChatMessage', 'shareAppMessage', 'shareWechatMessage'])
})
}
}

View File

@@ -20,9 +20,9 @@
<div class="info">
<div class="info-tab">
<div class="left">
<span @click="currIndex = 0" :class="[currIndex === 0 ? 'active' : '']">全部 {{ attendanceCount.all || 0 }}</span>
<span @click="currIndex = 1" :class="[currIndex === 1 ? 'active' : '']">已出勤 {{ attendanceCount.hasIn || 0 }}</span>
<span @click="currIndex = 2" :class="[currIndex === 2 ? 'active' : '']">未出勤 {{ attendanceCount.hasOut || 0 }}</span>
<span @click="changeTab(0)" :class="[currIndex === 0 ? 'active' : '']">全部 {{ attendanceCount.all || 0 }}</span>
<span @click="changeTab(1)" :class="[currIndex === 1 ? 'active' : '']">已出勤 {{ attendanceCount.hasIn || 0 }}</span>
<span @click="changeTab(2)" :class="[currIndex === 2 ? 'active' : '']">未出勤 {{ attendanceCount.hasOut || 0 }}</span>
</div>
<div class="right" @click="linkTo('./AttendanceSetting')">考勤设置</div>
</div>
@@ -58,7 +58,10 @@
date: '',
currIndex: 0,
list: [],
attendanceCount: {}
attendanceCount: {},
all: '1',
hasIn: '',
hasOut: ''
}
},
@@ -93,6 +96,26 @@
})
},
changeTab (index) {
if (index === 0) {
this.all = '1'
this.hasIn = ''
this.hasOut = ''
} else if (index === 1) {
this.all = ''
this.hasIn = '1'
this.hasOut = ''
} else {
this.all = ''
this.hasIn = ''
this.hasOut = '1'
}
this.currIndex = index
this.getList()
},
onDateChange (e) {
const values = e.detail.value.split('-')
this.date = `${values[0]}${values[1]}${values[2]}`
@@ -112,15 +135,18 @@
},
getList () {
this.$http.post(`/api/appattendancerecord/alldetail?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => {
this.$loading()
this.$http.post(`/api/appattendancerecord/alldetail?all=${this.all}&hasIn=${this.hasIn}&hasOut=${this.hasOut}&queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => {
if (res.code === 0) {
this.list = res.data.map(v => {
return {
...v,
workInTime: v.workInTime ? v.workInTime.split(' ')[1] : '',
workOutTime: v.workOutTime ? v.workOutTime.split(' ')[1] : ''
workInTime: v.workInTime ? this.$dayjs(v.workInTime).format('hh:mm') : '',
workOutTime: v.workOutTime ? this.$dayjs(v.workOutTime).format('hh:mm') : ''
}
})
this.$hideLoading()
}
})
}

View File

@@ -115,7 +115,7 @@
</div>
</div>
<div class="form-group__item form-group__checked" v-if="form.openWorkPoint === '1' && !address.address">
<div class="left left-add" @click="linkTo('/saas/AppCountryAlbum/ChooseAddess')">
<div class="left left-add" @click="linkTo('./ChooseAddess')">
<div class="add-btn"></div>
<h2 style="color: #1088F9;">添加打卡点</h2>
</div>

View File

@@ -27,7 +27,7 @@
<div class="right" :class="[currIndex === index ? 'active' : '']"></div>
</div>
</scroll-view>
<div class="address-btn">
<div class="address-btn" v-if="!isChooseAddress">
<span>打卡有效范围</span>
<div class="right" @click="isShowScope = true">
<i>{{ distance[chooseIndex] }}</i>
@@ -54,7 +54,7 @@
</template>
<script>
import { mapState } from 'vuex'
import { mapState, mapActions } from 'vuex'
export default {
name: 'ChooseAddess',
@@ -79,7 +79,8 @@
addressList: [],
page: 1,
marker: null,
timeout: null
timeout: null,
isChooseAddress: false
}
},
@@ -95,22 +96,41 @@
...mapState(['user',])
},
onLoad () {
uni.getLocation({
type: 'wgs84',
success: res => {
this.longitude = res.longitude
this.latitude = res.latitude
}
})
onLoad (query) {
if (query.type === 'address') {
this.isChooseAddress = true
uni.setNavigationBarTitle({
title: '选择地点'
})
}
this.getLocation()
},
methods: {
...mapActions(['injectJWeixin']),
chooseDistance (index) {
this.chooseIndex = index
this.isShowScope = false
},
getLocation () {
this.injectJWeixin(['getLocation']).then(res => {
wx.getLocation({
type: 'wgs84',
success: res => {
this.longitude = res.longitude
this.latitude = res.latitude
},
error: res => {
console.log(res)
}
})
})
},
init () {
this.map.setZoom(19)
this.addMarker(this.map.getCenter())
@@ -126,13 +146,20 @@
confirm () {
const address = this.addressList[this.currIndex]
uni.$emit('address', {
address: address.address,
title: address.title,
lat: address.location.lat,
lng: address.location.lng,
distance: this.distance[this.chooseIndex]
})
if (this.isChooseAddress) {
uni.$emit('change', {
...uni.getStorageSync('formConfig'),
defaultValue: address.address
})
} else {
uni.$emit('address', {
address: address.address,
title: address.title,
lat: address.location.lat,
lng: address.location.lng,
distance: this.distance[this.chooseIndex]
})
}
uni.navigateBack({
delta: 1
})

View File

@@ -5,24 +5,28 @@
<span>*选择拍摄人后相册只能上传该拍摄人照片</span>
</div>
<div class="cell-group">
<div class="cell-item" hover-class="bg-hover" @click="currIndex = 0">
<div class="cell-item" hover-class="bg-hover" @click="userList = [], currIndex = 0">
<div class="cell-item__left">
<h2>不限</h2>
</div>
<div class="cell-item__check" :class="[currIndex === 0 ? 'active' : '']"></div>
</div>
<div class="cell-item" hover-class="bg-hover" @click="currIndex = 1">
<div class="cell-item" hover-class="bg-hover" @click="toChoose">
<div class="cell-item__left">
<h2>根据条件选择</h2>
</div>
<div class="cell-item__check" :class="[currIndex === 1 ? 'active' : '']"></div>
</div>
</div>
<div class="form-btn" hover-class="text-hover">保存</div>
<div class="user" v-for="(item, index) in userList" :key="index">
<AiOpenData v-if="item" type="userName" :openid="item"></AiOpenData>
</div>
<div class="form-btn" hover-class="text-hover" @click="save">保存</div>
</div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
name: 'PersonnelSetting',
@@ -30,19 +34,65 @@
data () {
return {
currIndex: 0
currIndex: 0,
userList: [],
ticket: '',
count: 0
}
},
onLoad () {
onLoad (query) {
this.getInfo(query.id)
},
methods: {
...mapActions(['selectPrivilegedContact']),
linkTo (url) {
uni.navigateTo({
url
})
},
save () {
if (this.currIndex === 1 && !this.userList.length) {
return this.$u.toast('请选择人员')
}
uni.$emit('change', {
type: 'personnel',
value: this.userList.length ? this.userList : []
})
uni.navigateBack({
delta: 1
})
},
getInfo (id) {
this.$http.post(`/api/appalbum/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.userList = res.data.albumUserList || []
this.currIndex = (res.data.albumUserList && res.data.albumUserList.length) ? 1 : 0
}
})
},
toChoose () {
this.$loading()
this.currIndex = 1
this.selectPrivilegedContact({
fromDepartmentId: 0,
selectedTickets: this.ticket ? [this.ticket] : [],
selectedOpenUserIds: this.userList
}).then(res => {
uni.hideLoading()
this.userList = res.userList.map(e => e.openUserId) || []
this.ticket = res.selectedTicket || ''
console.log(res)
}).catch(() => {
uni.hideLoading()
})
}
}
}
@@ -150,4 +200,4 @@
}
}
}
</style>
</style>

View File

@@ -157,7 +157,7 @@
display: flex;
align-items: center;
justify-content: center;
width: 336px;
width: 400px;
height: 72px;
line-height: 1;
background: #0B111F;
@@ -165,6 +165,13 @@
font-size: 28px;
color: #cbcbcb;
span {
max-width: 70%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
image {
width: 32px;
height: 32px;

View File

@@ -16,7 +16,7 @@
<div class="photo-bottom__top">
<image src="./images/clear.png" @click="isHide = true, currIndex = -1" />
<h2>水印</h2>
<span>确定</span>
<span @click="save">确定</span>
</div>
<div class="waterlist">
<div
@@ -187,14 +187,12 @@
getLocation () {
this.injectJWeixin(['getLocation']).then(res => {
console.log(res)
wx.getLocation({
type: 'wgs84',
success: res => {
var lat = res.latitude
var lng = res.longitude
this.$http.post('/api/appdvcpconfig/apiForward',
`https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
if (res.code === 0) {
const data = res.data.result
uni.setStorageSync('address', {
@@ -431,7 +429,7 @@
display: flex;
align-items: center;
justify-content: center;
width: 336px;
width: 400px;
height: 72px;
line-height: 1;
background: #0B111F;
@@ -439,6 +437,13 @@
font-size: 28px;
color: #cbcbcb;
span {
max-width: 70%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
image {
width: 32px;
height: 32px;

View File

@@ -1,7 +1,7 @@
<template>
<div class="AttendanceFiexdTime">
<div class="form-group">
<div class="form-group__item" hover-class="bg-hover" v-for="(item, index) in config" :key="index">
<div class="form-group__item" hover-class="bg-hover" v-if="item.fieldType" v-for="(item, index) in config" :key="index">
<div class="left">
<switch color="#1088F9" :checked="item.status === '1'" :disabled="item.editEnable === '0'" @change="e => onChange(e, index)" />
</div>
@@ -78,13 +78,20 @@
if (e.fieldType === '2') return
if (e.fieldType === '3') {
uni.setStorageSync('formConfig', e)
this.linkTo('./ChooseAddess?type=address')
return false
}
uni.setStorageSync('formConfig', e)
this.linkTo('./Form')
},
save () {
for (let i = 0; i < this.config.length; i ++) {
if (['2', '3', '4', '5'].indexOf(this.config[i].fieldType) === -1 && !this.config[i].defaultValue && this.config[i].status === '1') {
if (['2', '3', '4', '5'].indexOf(this.config[i].fieldType) === -1 && this.config[i].fieldType && !this.config[i].defaultValue && this.config[i].status === '1') {
return this.$u.toast(`请输入${this.mapFieldLable(this.config[i].type)}`)
}
}
@@ -159,6 +166,7 @@
}
p {
line-height: 1.3;
font-size: 34px;
color: #333;
}

View File

@@ -1,5 +1,5 @@
<template>
<div class="WatermarkSetting">
<div class="WatermarkSetting" v-if="pageShow">
<div class="title">
<h2>水印选择</h2>
<span>*选择水印后相册只能上传该水印照片</span>
@@ -22,8 +22,8 @@
<h2>水印库</h2>
</div>
<div class="watermark-list" v-if="currIndex === 1">
<div class="item" @click="checkd(item.type)" v-for="(item, index) in config" :key="index" :class="[checkedList.includes(index) ? 'active' : '']">
<image class="checked" v-if="checkedList.includes(item.type)" src="./images/xuanzhong.png" />
<div class="item" @click="checkd(item.id)" v-for="(item, index) in list" :key="index" :class="[checkedList.includes(item.id) ? 'active' : '']">
<image class="checked" v-if="checkedList.includes(item.id)" src="./images/xuanzhong.png" />
<image class="watermark" :src="item.thum" mode="aspectFill" />
</div>
</div>
@@ -42,7 +42,9 @@
return {
currIndex: 0,
config,
checkedList: []
checkedList: [],
list: [],
pageShow: false
}
},
@@ -51,9 +53,24 @@
this.currIndex = 1
this.checkedList = query.value.split(',')
}
this.getList()
},
methods: {
getList () {
this.$loading()
this.$http.post(`/api/appalbumtemplate/list?size=100&status=1`).then(res => {
if (res.code === 0) {
this.list = res.data.records
}
this.pageShow = true
this.$hideLoading()
})
},
save () {
uni.$emit('change', {
type: 'watermark',

View File

@@ -47,7 +47,7 @@
<div class="album-list__wrapper">
<div class="item" v-for="(item, index) in list" :key="index" @click="linkTo('./AlbumDetail?id=' + item.id)">
<span v-if="item.photoHasRead === 'NO'">未查看</span>
<image src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/fa50994a01ff415294729ac6e0623845~tplv-k3u1fbpfcp-no-mark:240:240:240:160.awebp?" />
<image src="./../images/icon.png" />
<div class="item-bottom">
<h2>{{ item.albumName }}</h2>
<div class="item-bottom__info">
@@ -238,13 +238,17 @@
justify-content: space-between;
.item {
display: flex;
position: relative;
align-items: center;
justify-content: center;
width: 328px;
height: 328px;
margin-top: 32px;
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
border-radius: 16px;
overflow: hidden;
background: #EFF5FA;
.item-bottom {
position: absolute;
@@ -317,8 +321,8 @@
}
& > image {
width: 100%;
height: 100%;
width: 80px;
height: 80px;
}
}
}

View File

@@ -92,7 +92,13 @@
},
mounted () {
this.configList = JSON.parse(JSON.stringify(this.config))
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '7') {
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
}
return v
})
uni.$on('change', e => {
this.configList = e

View File

@@ -80,8 +80,8 @@
this.isShowDate = date.status === '1'
this.isShowAddress = address.status === '1'
this.title = title.defaultValue || '巡查日志'
this.weather = weather.defaultValue || '晴转多云'
this.address = date.defaultValue || '武汉天地'
this.address = uni.getStorageSync('address').address || ''
this.weather = uni.getStorageSync('address').weather || ''
this.reporter = reporter.defaultValue || ''
this.date = date.defaultValue || this.$dayjs(new Date).format('YYYY-MM-DD')
this.remark = remark.defaultValue || ''
@@ -92,7 +92,19 @@
},
mounted () {
this.configList = JSON.parse(JSON.stringify(this.config))
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '3') {
v.defaultValue = uni.getStorageSync('address').address || ''
}
if (v.fieldType === '2') {
v.defaultValue = uni.getStorageSync('address').weather || ''
}
if (v.fieldType === '7') {
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
}
return v
})
uni.$on('change', e => {
this.configList = e

View File

@@ -103,8 +103,8 @@
this.isShowDate = date.status === '1'
this.isShowAddress = address.status === '1'
this.title = title.defaultValue || '巡查日志'
this.address = address.defaultValue || '武汉天地'
this.title = title.defaultValue || ''
this.address = address.defaultValue || ''
this.hoster = hoster.defaultValue || ''
this.date = date.defaultValue || this.$dayjs(new Date).format('YYYY-MM-DD')
this.remark = remark.defaultValue || ''
@@ -118,7 +118,13 @@
},
mounted () {
this.configList = JSON.parse(JSON.stringify(this.config))
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '7') {
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
}
return v
})
uni.$on('change', e => {
this.configList = e

View File

@@ -91,7 +91,13 @@
},
mounted () {
this.configList = JSON.parse(JSON.stringify(this.config))
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '7') {
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
}
return v
})
uni.$on('change', e => {
this.configList = e

View File

@@ -22,9 +22,9 @@
date: '',
time: '',
week: '',
weather: '晴转多云',
weather: '',
remark: '',
address: '武汉市·绿地蓝海国际A座',
address: '',
timer: null,
configList: [],
isShowWeather: false,

View File

@@ -9,7 +9,7 @@
</div>
<div class="bottom">{{ date }} {{ weekCn }}</div>
</div>
<div class="bottom" v-show="isShowAddress">{{ address }}</div>
<div class="bottom" v-if="isShowAddress">{{ address }}</div>
</div>
</template>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB