添加出差申请

main
suixy 1 week ago
parent 1ff25eb88f
commit a9e7adc655

@ -47,22 +47,4 @@
line-height: 60rpx; line-height: 60rpx;
color: #aaa; color: #aaa;
} }
.moreFormItem-enter-active,
.moreFormItem-leave-active {
transition: max-height 0.3s ease, opacity 0.3s ease;
overflow: hidden;
}
.moreFormItem-enter-from,
.moreFormItem-leave-to {
max-height: 0;
opacity: 0;
}
.moreFormItem-enter-to,
.moreFormItem-leave-from {
max-height: 500rpx;
opacity: 1;
}
</style> </style>

@ -0,0 +1,11 @@
import {
request
} from '@/utils/request'
export const listContractInfo = (query) => {
return request({
url: '/oa/erp/contractInfo/list',
method: 'get',
data: query
});
};

@ -0,0 +1,17 @@
import {
request
} from '@/utils/request'
export function getInfo() {
return request({
url: '/system/user/getInfo',
method: 'get'
});
}
export function getRouters() {
return request({
url: '/system/menu/getRouters',
method: 'get'
});
}

@ -0,0 +1,11 @@
import {
request
} from '@/utils/request'
export const listProjectInfo = (query) => {
return request({
url: '/oa/erp/projectInfo/list',
method: 'get',
data: query
});
};

@ -26,11 +26,10 @@
.title { .title {
color: #333; color: #333;
font-size: 32rpx font-size: 32rpx;
margin-bottom: 30rpx;
} }
.content { .content {}
margin-top: 30rpx;
}
} }
</style> </style>

@ -10,7 +10,7 @@
} from 'vue' } from 'vue'
const props = defineProps({ const props = defineProps({
options: Array, options: Array,
value: Number | String | Array, value: [Number, String, Array],
showValue: Boolean, showValue: Boolean,
separator: String, separator: String,
type: String, type: String,

@ -0,0 +1,54 @@
<template>
<view class="searchInput">
<view class="input">
<input style="height: 60rpx;" @input="onInput" v-model="input" />
</view>
<button class="btn" type="primary" @tap="btnClick"></button>
</view>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue'
const input = ref('')
const props = defineProps(['title', 'modelValue'])
const emit = defineEmits(['search'])
const btnClick = (e) => {
emit('search', props.value)
}
const onInput = (e) => {
emit('update:modelValue', e.detail.value)
}
onMounted(() => {
input.value = props.modelValue
})
</script>
<style scoped lang="scss">
.searchInput {
width: 100%;
height: 60rpx;
border: 1px solid #ccc;
border-radius: 30rpx;
.input {
display: inline-block;
margin: 0 10rpx 0 20rpx;
width: calc(100% - 10rpx - 20rpx - 100rpx - 6rpx);
}
.btn {
display: inline-block;
width: 100rpx;
height: 48rpx;
line-height: 48rpx;
vertical-align: top;
margin-top: 6rpx;
padding: 0;
border-radius: 24rpx;
font-size: 26rpx
}
}
</style>

@ -0,0 +1,52 @@
<template>
<view class="top">
<view class="back">
<image class="back" :src="`${imgUrl}/icon/back.png`" mode="aspectFit" @tap="toback">
</image>
</view>
<view class="text">
{{text}}
</view>
</view>
</template>
<script setup>
import {
imgUrl
} from '@/common/config';
import {
router
} from '../utils/router';
const props = defineProps(['text'])
const toback = () => {
router.back()
}
</script>
<style scoped lang="scss">
.top {
width: 750rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
background-color: #fff;
position: relative;
.back {
position: absolute;
display: inline-block;
height: 40rpx;
width: 40rpx;
top: 50%;
left: 40rpx;
transform: translate(-50%, -50%);
}
.text {
vertical-align: top;
display: inline-block;
width: 750rpx;
height: 100%;
}
}
</style>

@ -0,0 +1,27 @@
<template>
<view class="form-item">
<view class="title" :style="{width : (width || 'auto')}">{{title}}</view>
<view class="item">
<slot></slot>
</view>
</view>
</template>
<script setup>
const props = defineProps(['title', 'width'])
</script>
<style scoped>
.title {
display: inline-block;
margin-right: 20rpx;
line-height: 60rpx;
}
.item {
flex: 1;
width: 200rpx;
display: inline-block;
vertical-align: top;
}
</style>

@ -0,0 +1,46 @@
<template>
<view>
<input :disabled="disabled" class="input" v-model="model" :placeholder="props.placeholder" @change="onChange" />
</view>
</template>
<script setup>
import {
computed
} from 'vue'
const props = defineProps({
modelValue: Object,
placeholder: String,
disabled:Boolean
})
const emit = defineEmits(['update:modelValue', 'change'])
const model = computed({
get() {
return props.modelValue
},
set(val) {
emit('update:modelValue', val)
}
})
const onChange = (val) => {
let data = props.modelValue?.[val.detail.value]?.value || ''
emit('change', modelValue)
}
</script>
<style lang="scss" scoped>
.input {
height: 50rpx;
line-height: 50rpx;
font-size: 24rpx;
color: #333;
.uni-input-placeholder {
font-size: 24rpx;
}
}
</style>

@ -0,0 +1,35 @@
<template>
<view>
<picker mode="selector" @change="onChange" :range-key="key||'label'" :value="valueIndex" :range="data">
<view class="picker">
{{(data.find(e=>e.value == value)||{}).label}}
</view>
</picker>
</view>
</template>
<script setup>
import {
computed,
} from 'vue'
const props = defineProps(['key', 'value', 'data'])
const emit = defineEmits(['change'])
const onChange = (val) => {
let data = props.data?.[val.detail.value]?.value || ''
emit('change', data)
}
const valueIndex = computed(() => {
if (!props.data) return 0
const index = props.data.findIndex(e => e.value === props.value)
return index >= 0 ? index : 0
})
</script>
<style lang="scss" scoped>
.picker {
height: 50rpx;
line-height: 50rpx;
font-size: 24rpx;
color: #333;
}
</style>

@ -0,0 +1,85 @@
<template>
<!-- 遮罩层 -->
<view v-if="visible" class="popup-mask" @click="close">
<view @click.stop class="popup-content" :style="{ transform: transformStyle }">
<slot></slot>
</view>
</view>
</template>
<script setup>
import {
ref,
computed,
defineExpose
} from 'vue'
const props = defineProps({
position: {
type: String,
default: 'bottom'
},
duration: {
type: Number,
default: 300
}
})
const emit = defineEmits(['open', 'close'])
const visible = ref(false)
const animating = ref(false)
//
const transformStyle = computed(() => {
if (animating.value) return 'translateY(0%)'
if (props.position === 'bottom') return 'translateY(100%)'
if (props.position === 'top') return 'translateY(-100%)'
return 'scale(0.8)'
})
//
function open() {
visible.value = true
animating.value = false
setTimeout(() => {
animating.value = true
emit('open')
}, 20)
}
function close() {
animating.value = false
setTimeout(() => {
visible.value = false
emit('close')
}, props.duration)
}
defineExpose({
open,
close
})
</script>
<style>
.popup-mask {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: flex-end;
z-index: 999;
}
.popup-content {
width: 100%;
background: #fff;
border-radius: 16rpx 16rpx 0 0;
transition: transform 0.3s ease;
}
</style>

@ -0,0 +1,15 @@
import Top from './Top.vue'
import Card from './Card.vue'
import DictTag from './DictTag.vue'
import FormItem from './form/FormItem.vue'
import SearchInput from './SearchInput.vue'
import Picker from './form/Picker.vue'
export {
Top,
Card,
DictTag,
FormItem,
SearchInput,
Picker
}

@ -5,6 +5,8 @@ import DictTag from '@/components/DictTag.vue'
import FormItem from '@/components/form/FormItem.vue' import FormItem from '@/components/form/FormItem.vue'
import SearchInput from '@/components/SearchInput.vue' import SearchInput from '@/components/SearchInput.vue'
import Picker from '@/components/form/Picker.vue' import Picker from '@/components/form/Picker.vue'
import Input from '@/components/form/Input.vue'
import Popup from '@/components/form/Popup.vue'
// #ifndef VUE3 // #ifndef VUE3
import Vue from 'vue' import Vue from 'vue'
@ -28,7 +30,9 @@ export function createApp() {
app.component('DictTag', DictTag) app.component('DictTag', DictTag)
app.component('FormItem', FormItem) app.component('FormItem', FormItem)
app.component('SearchInput', SearchInput) app.component('SearchInput', SearchInput)
app.component('Pickera', Picker) app.component('Picker', Picker)
app.component('Input', Input)
app.component('Popup', Popup)
return { return {
app app
} }

@ -1,7 +1,7 @@
<template> <template>
<view :style="{marginTop:barHeight+'px'}"> <view :style="{marginTop:barHeight+'px'}">
<Top text="合同查询" /> <Top text="合同查询" />
<scroll-view scroll-y="" style="background-color: #F2F3F5;" <scroll-view scroll-y style="background-color: #F2F3F5;"
:style="{height:`calc(${pageHeight+'px'} - 30rpx - 100rpx)`,paddingBottom:'30rpx'}" :style="{height:`calc(${pageHeight+'px'} - 30rpx - 100rpx)`,paddingBottom:'30rpx'}"
@scrolltolower="onScrollToLower"> @scrolltolower="onScrollToLower">
<view id="contain" ref="containRef"> <view id="contain" ref="containRef">
@ -13,7 +13,8 @@
<FormItem :title="'合同编号'" width="180rpx" v-if="moreFormItem"> <FormItem :title="'合同编号'" width="180rpx" v-if="moreFormItem">
<input class="uni-input" v-model="searchForm.contractCode" /> <input class="uni-input" v-model="searchForm.contractCode" />
</FormItem> </FormItem>
<transition name="moreFormItem"> <!-- <transition name="moreFormItem"> -->
<view class="moreFormItem" :class="{ open: moreFormItem }">
<view v-show="moreFormItem"> <view v-show="moreFormItem">
<FormItem :title="'客户合同编号'" width="201rpx"> <FormItem :title="'客户合同编号'" width="201rpx">
<input class="uni-input" v-model="searchForm.customerContractCode" /> <input class="uni-input" v-model="searchForm.customerContractCode" />
@ -22,19 +23,21 @@
<input class="uni-input" v-model="searchForm.contractName" /> <input class="uni-input" v-model="searchForm.contractName" />
</FormItem> </FormItem>
<FormItem :title="'业务方向'" width="180rpx"> <FormItem :title="'业务方向'" width="180rpx">
<Pickera key="label" :data="business_direction" :value="searchForm.businessDirection" <Picker key="label" :data="business_direction" :value="searchForm.businessDirection"
@change="e=>searchForm.businessDirection =e" /> @change="e=>searchForm.businessDirection =e" />
</FormItem> </FormItem>
<FormItem :title="'合同状态'" width="180rpx"> <FormItem :title="'合同状态'" width="180rpx">
<Pickera key="label" :data="contract_status" :value="searchForm.contractStatus" <Picker key="label" :data="contract_status" :value="searchForm.contractStatus"
@change="e=>searchForm.contractStatus =e" /> @change="e=>searchForm.contractStatus =e" />
</FormItem> </FormItem>
</view> </view>
</transition> </view>
<!-- </transition> -->
<view style="text-align: center;"> <view style="text-align: center;">
<button style="height:60rpx;width: 150rpx;line-height: 60rpx;display: inline-block;" v-if="moreFormItem" <button style="height:60rpx;width: 150rpx;line-height: 60rpx;display: inline-block;font-size: 28rpx;"
form-type="submit" type="primary">搜索</button> v-if="moreFormItem" form-type="submit" type="primary">搜索</button>
<button style="height:60rpx;width: 150rpx;line-height: 60rpx;display: inline-block;margin-left: 20rpx;" <button
style="height:60rpx;width: 150rpx;line-height: 60rpx;display: inline-block;margin-left: 20rpx;font-size: 28rpx;"
v-if="moreFormItem" form-type="reset" plain="true" type="primary">重置</button> v-if="moreFormItem" form-type="reset" plain="true" type="primary">重置</button>
</view> </view>
<view class="toggle" @tap="toggleForm"> <view class="toggle" @tap="toggleForm">
@ -91,6 +94,9 @@
</Card> </Card>
</view> </view>
</scroll-view> </scroll-view>
<view v-if="infoShow">
<Info :data="infoData" />
</view>
</view> </view>
</template> </template>
@ -110,6 +116,7 @@
import { import {
getHeight getHeight
} from '@/utils/index.js' } from '@/utils/index.js'
import Info from './info.vue'
const { const {
contract_category, contract_category,
@ -123,6 +130,8 @@
'contract_status' 'contract_status'
]) ])
); );
const infoShow = ref(false)
const infoData = ref({})
const containRef = ref(null) const containRef = ref(null)
const moreFormItem = ref(false) const moreFormItem = ref(false)
const toggleForm = () => { const toggleForm = () => {
@ -139,7 +148,7 @@
let res = false let res = false
return new Promise(resolve => { return new Promise(resolve => {
uni.createSelectorQuery() uni.createSelectorQuery()
.select('#contain') // .in(proxy) .select('#contain')
.boundingClientRect(rect => { .boundingClientRect(rect => {
resolve(rect?.height < pageHeight.value) resolve(rect?.height < pageHeight.value)
}) })
@ -176,15 +185,18 @@
} }
} }
const itemOperation = (e) => { const itemOperation = (e) => {
infoShow.value = true
if (e.contractStatus !== '1') { if (e.contractStatus !== '1') {
uni.navigateTo({ infoData.value = {
url: '/pages/contract/info?type=1&id=' + e.contractId type: 1,
}) id: e.contractId
}
} }
if (e.contractStatus === '1') { if (e.contractStatus === '1') {
uni.navigateTo({ infoData.value = {
url: '/pages/contract/info?type=2&id=' + e.contractId type: 2,
}) id: e.contractId
}
} }
} }
const pageHeight = ref(0) const pageHeight = ref(0)
@ -197,7 +209,10 @@
barHeight.value = statusBarHeight barHeight.value = statusBarHeight
pageHeight.value = sys.windowHeight - statusBarHeight pageHeight.value = sys.windowHeight - statusBarHeight
} else { } else {
pageHeight.value = sys.windowHeight const systemInfo = uni.getSystemInfoSync()
const statusBarHeight = systemInfo.statusBarHeight || 0
barHeight.value = statusBarHeight || 0
pageHeight.value = sys.windowHeight - statusBarHeight
} }
search() search()
}, 100) }, 100)
@ -264,4 +279,35 @@
min-width: calc(45% - 20rpx); min-width: calc(45% - 20rpx);
color: #999 color: #999
} }
.moreFormItem-enter-active,
.moreFormItem-leave-active {
transition: max-height 0.3s ease, opacity 0.3s ease;
overflow: hidden;
}
.moreFormItem-enter-from,
.moreFormItem-leave-to {
max-height: 0;
opacity: 0;
}
.moreFormItem-enter-to,
.moreFormItem-leave-from {
max-height: 500rpx;
opacity: 1;
}
.moreFormItem {
max-height: 0;
opacity: 0;
overflow: hidden;
transition: max-height 0.3s ease, opacity 0.3s ease;
}
.moreFormItem.open {
max-height: 600rpx; // 200 / 400
opacity: 1;
}
</style> </style>

@ -1,68 +1,70 @@
<template> <template>
<Card> <view>
<form> <Card class="container">
<FormItem :title="'有无合同'"> <form>
<input class="uni-input" v-model="searchForm.contractCode" /> <FormItem :title="'有无合同'">
</FormItem> <input class="uni-input" v-model="searchForm.contractCode" />
<FormItem :title="'合同编号'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同编号'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'合同名称'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同名称'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'合同大类'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同大类'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'业务方向'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'业务方向'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'部门'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'部门'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'合同签订日期'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同签订日期'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'合同总价'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同总价'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'甲方公司'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'甲方公司'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'乙方公司'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'乙方公司'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'甲方授权代表'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'甲方授权代表'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'乙方授权代表'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'乙方授权代表'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'甲方签字日期'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'甲方签字日期'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'乙方签字日期'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'乙方签字日期'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'合同状态'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同状态'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'合同模板标识'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同模板标识'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'合同负责人'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同负责人'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'合同模板'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'合同模板'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'附件'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'附件'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
<FormItem :title="'备注'"> </FormItem>
<input class="uni-input" v-model="form.contractCode" /> <FormItem :title="'备注'">
</FormItem> <input class="uni-input" v-model="form.contractCode" />
</form> </FormItem>
</Card> </form>
</Card>
</view>
</template> </template>
<script setup> <script setup>
@ -79,4 +81,14 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container {
width: 600rpx;
height: 80vh;
overflow: auto;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin: 0
}
</style> </style>

@ -0,0 +1,199 @@
<template>
<view :style="{marginTop:barHeight+'px'}">
<Top text="出差申请" />
<scroll-view scroll-y
:style="{height:`calc(${pageHeight+'px'} - 30rpx - 100rpx)`,paddingBottom:'30rpx',backgroundColor:'#eee9'}">
<view class="list">
<view class="item">
<view class="formItem">
<view class="title">申请单号</view>
<view class="inputBg">
<Input v-model="applicatioData.applyCode" placeholder="自动生成" />
</view>
</view>
<view class="formItem">
<view class="title">申请人</view>
<view class="inputBg">
<Input v-model="applicatioData.applicantName" placeholder="自动填充" />
</view>
</view>
<view class="formItem">
<view class="title">申请人部门</view>
<view class="inputBg">
<Input v-model="applicatioData.deptName" placeholder="自动填充" />
</view>
</view>
</view>
<view class="item" v-for="(i,k) in list">
<view class="itemTitle">行程明细 {{k+1}}</view>
<view class="formItem">
<view class="title">出差类型</view>
<view class="inputBg">
<Picker key="label" :data="trip_type" :value="i.tripType" @change="e=>i.tripType =e" />
</view>
</view>
<view class="formItem">
<view class="title">项目名称</view>
<view class="inputBg" @tap="getProject(k)">
<Input style="pointer-events:none" disabled v-model="i.projectName" placeholder="点击选择" />
<Input v-show="false" v-model="i.projectId" placeholder="projectId" />
</view>
</view>
<view class="formItem">
<view class="title">项目号</view>
<view class="inputBg" @tap="getProject(k)">
<Input style="pointer-events:none" disabled v-model="i.projectCode" placeholder="点击选择" />
</view>
</view>
<view class="formItem">
<view class="title">出差事由</view>
<view class="inputBg">
<textarea class="textArea" v-model="i.tripReason" placeholder="出差事由" />
</view>
</view>
<view class="formItem">
<view class="title">开始时间</view>
<view class="inputBg">
<uni-section :title="'日期范围用法:' + '[' + range + ']'" type="line"></uni-section>
</view>
</view>
</view>
<Popup ref="popupRef" v-model="show" position="bottom" :duration="300">
<view class="search">
<FormItem :title="'项目名称'">
<SearchInput @search="getList" v-model="form.projectName" />
</FormItem>
</view>
<scroll-view scroll-y style="height: 600rpx;">
<view @tap="pitchOnProject(i)" v-for="i in projectList">
<Card style="pointer-events:none" hideTitle class="projectList">
<DictTag style="position: absolute;top: 30rpx;right: 30rpx;" :options="project_category"
:value="i.projectCategory" />
<view>
{{i.projectName}}
</view>
<view style="font-size: 24rpx;color: #999;margin-right: 24rpx;display: inline-block;">
{{i.projectCode}}
</view>
<view style="font-size: 24rpx;color: #999;display: inline-block;">
项目经理:{{i.managerName}}
</view>
</Card>
</view>
</scroll-view>
</Popup>
</view>
</scroll-view>
</view>
</template>
<script setup>
import {
toRefs,
ref,
onMounted,
computed
} from 'vue'
import {
useDict
} from '@/utils/dict.js'
const {
trip_type,
business_direction,
project_category,
} = toRefs(
useDict(['trip_type', 'business_direction', 'project_category'])
);
import {
listProjectInfo
} from '@/api/workHourReporting.js'
const popupRef = ref()
const applicatioData = ref({})
const form = ref({})
const projectIndex = ref(null)
const list = ref([{}])
const projectList = ref([])
const getProject = (index) => {
projectIndex.value = index
popupRef.value.open()
}
const getProjectList = async () => {
const res = await listProjectInfo();
projectList.value = res.rows;
}
const getList = async () => {
const res = await listProjectInfo(form.value);
projectList.value = res.rows;
}
const pitchOnProject = (e) => {
list.value[projectIndex.value].projectName = e.projectName
list.value[projectIndex.value].projectId = e.projectId
list.value[projectIndex.value].projectCode = e.projectCode
popupRef.value.close()
}
const pageHeight = ref(0)
const barHeight = ref(0)
const sys = uni.getSystemInfoSync()
onMounted(() => {
setTimeout(() => {
if ((process.env.UNI_PLATFORM === 'app-plus' || process.env.UNI_PLATFORM === 'app')) {
const statusBarHeight = plus.navigator.getStatusbarHeight()
barHeight.value = statusBarHeight
pageHeight.value = sys.windowHeight - statusBarHeight
} else {
pageHeight.value = sys.windowHeight
}
}, 100)
})
</script>
<style lang="scss" scoped>
.list {
margin-top: 20rpx;
}
.item {
width: 670rpx;
margin-left: 20rpx;
background-color: #fff;
border-radius: 20rpx;
padding: 20rpx;
margin-bottom: 20rpx;
.itemTitle {
font-size: 24rpx;
margin-bottom: 24rpx;
}
.formItem {
margin-bottom: 24rpx;
}
.title {
font-size: 24rpx;
margin-bottom: 12rpx;
}
.inputBg {
border-radius: 10rpx;
font-size: 24rpx;
padding-left: 10rpx;
border: 1rpx solid #eee;
color: #666;
}
}
.projectList {
background-color: #eee;
margin-bottom: 20rpx;
}
.textArea {
font-size: 24rpx;
color: #333;
}
</style>

@ -3,8 +3,8 @@
<scroll-view scroll-y="true" :style="{height:pageHeight+'px'}" style="position: relative"> <scroll-view scroll-y="true" :style="{height:pageHeight+'px'}" style="position: relative">
<view class="workbenchIcon"></view> <view class="workbenchIcon"></view>
<view class="headPortrait"></view> <view class="headPortrait"></view>
<view class="userName">名称</view> <view class="userName">{{userInfo.nickName}}</view>
<view class="department">青岛海威物联科技有限公司</view> <view class="department">{{userInfo.deptName}}</view>
<Card class="card1" title="全员"> <Card class="card1" title="全员">
<view class="viewMore"> <view class="viewMore">
查看更多 查看更多
@ -33,17 +33,24 @@
import { import {
imgUrl imgUrl
} from '@/common/config'; } from '@/common/config';
import {
syncGlobalData
} from '@/store/index.js'
const {
userInfo
} = syncGlobalData(['userInfo'])
console.log(userInfo.value);
const list = computed(() => { const list = computed(() => {
return [{ return [{
icon: `${imgUrl}/icon/attendancePunch.png`, icon: `${imgUrl}/icon/attendancePunch.png`,
name: '考勤打卡', name: '合同信息',
color: '#E7F8FD', color: '#E7F8FD',
path: '/pages/contract/index' path: '/pages/contract/index'
}, },
{ {
icon: `${imgUrl}/icon/oa.png`, icon: `${imgUrl}/icon/oa.png`,
name: 'OA审批', name: '出差申请',
color: '#FFEBE9', color: '#FFEBE9',
path: '/pages/workHourReporting/index' path: '/pages/workHourReporting/index'
}, },
@ -56,18 +63,9 @@
} }
const pageHeight = ref() const pageHeight = ref()
const barHeight = ref()
const sys = uni.getSystemInfoSync() const sys = uni.getSystemInfoSync()
onMounted(() => { onMounted(() => {
setTimeout(() => { pageHeight.value = sys.windowHeight
if ((process.env.UNI_PLATFORM === 'app-plus' || process.env.UNI_PLATFORM === 'app')) {
const statusBarHeight = plus.navigator.getStatusbarHeight()
barHeight.value = statusBarHeight
pageHeight.value = sys.windowHeight - statusBarHeight
} else {
pageHeight.value = sys.windowHeight
}
}, 1000)
}) })
</script> </script>

@ -13,7 +13,7 @@
*/ */
/* 图片地址 */ /* 图片地址 */
// $img-url: 'https://hw-bm-1307203087.cos.ap-beijing.myqcloud.com'; // $img-url: 'https://hw-bm-1307203087.cos.ap-beijing.myqcloud.com/mom-app';
$img-url: 'https://frp-off.com:47543/appstatic'; $img-url: 'https://frp-off.com:47543/appstatic';

File diff suppressed because it is too large Load Diff

@ -0,0 +1,12 @@
export const getHeight = (dom, proxy) => {
let height = 0
uni.createSelectorQuery()
.in(proxy)
.select(dom)
.boundingClientRect(rect => {
height = rect.height
})
.exec()
return height
};

@ -17,6 +17,8 @@ import {
const encryptHeader = getGlobalData('encryptHeader'); const encryptHeader = getGlobalData('encryptHeader');
const baseURL = 'https://frp-off.com:47543' const baseURL = 'https://frp-off.com:47543'
// const baseURL = 'http://192.168.100.101:8095'
// const baseURL = 'http://localhost:5174/prod-api'
const getToken = () => { const getToken = () => {
return uni.getStorageSync('token') return uni.getStorageSync('token')

@ -0,0 +1,25 @@
import {
getGlobalData
} from '@/store/index.js'
const back = () => {
const pages = getCurrentPages()
if (pages.length === 1) {
uni.reLaunch({
url: '/pages/workbench/index'
})
} else {
uni.navigateBack()
}
}
const push = (a, b) => {
let routeList = getGlobalData('route')
let type = b || 1
if (type === 1) {
uni.navigateTo(a)
}
}
export const router = {
back,
push
}
Loading…
Cancel
Save