请假申请
This commit is contained in:
parent
ca7bc6bdaa
commit
3c2dc3ac5e
4
env/.env.development
vendored
4
env/.env.development
vendored
@ -5,5 +5,5 @@ VITE_DELETE_CONSOLE = false
|
|||||||
# 是否开启sourcemap
|
# 是否开启sourcemap
|
||||||
VITE_SHOW_SOURCEMAP = true
|
VITE_SHOW_SOURCEMAP = true
|
||||||
|
|
||||||
#VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
|
VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
|
||||||
VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
32
src/api/pages/absence/index.ts
Normal file
32
src/api/pages/absence/index.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { http } from '@/utils/http';
|
||||||
|
|
||||||
|
/*根据username获取职位名称和审批领导列表*/
|
||||||
|
export function queryZwmcAndExaApi(username : string) {
|
||||||
|
return http({
|
||||||
|
url: '/CxcQxj/cxcQxj/queryZwmcByUsername',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
username
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/*新增请假申请*/
|
||||||
|
export function addApi(config) {
|
||||||
|
return http({
|
||||||
|
url: '/CxcQxj/cxcQxj/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: config
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/*根据username获取最新请假结束日期*/
|
||||||
|
export function queryHisDateApi(username : string) {
|
||||||
|
return http({
|
||||||
|
url: '/CxcQxj/cxcQxj/queryHisDate',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
username
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -65,4 +65,17 @@ export function queryCarouselApi(config) {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
data: config
|
data: config
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取分类字典
|
||||||
|
*/
|
||||||
|
export function getCategoryItemsApi(pid) { // 分类字典专用
|
||||||
|
return http({
|
||||||
|
url: '/sys/category/findtree',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
pid
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
@ -145,7 +145,6 @@ const clearPageParamsCache = () => {
|
|||||||
const handleClickRight = () => {
|
const handleClickRight = () => {
|
||||||
emit('navRight')
|
emit('navRight')
|
||||||
}
|
}
|
||||||
console.log('props:', props)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -191,6 +191,15 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/humanResources/absence/apply",
|
||||||
|
"type": "page",
|
||||||
|
"layout": "default",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTitleText": "请假申请"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/integrated/duty/index",
|
"path": "pages/integrated/duty/index",
|
||||||
"type": "page",
|
"type": "page",
|
||||||
|
319
src/pages/humanResources/absence/apply.vue
Normal file
319
src/pages/humanResources/absence/apply.vue
Normal file
@ -0,0 +1,319 @@
|
|||||||
|
<route lang="json5" type="page">
|
||||||
|
{
|
||||||
|
layout: 'default',
|
||||||
|
style: {
|
||||||
|
navigationStyle: 'custom',
|
||||||
|
navigationBarTitleText: '请假申请',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</route>
|
||||||
|
<template>
|
||||||
|
<view :class="{'gray': appStore.isGray == 1 }">
|
||||||
|
<wd-navbar left-text="返回" left-arrow title="请假申请"
|
||||||
|
custom-style="padding-top: var(--status-bar-height, 0); background-image: linear-gradient(to right, #1890ff, #096dd9); color: #fff;"
|
||||||
|
@click-left="handleClickLeft">
|
||||||
|
</wd-navbar>
|
||||||
|
<wd-form ref="form" :model="model">
|
||||||
|
<wd-cell-group border>
|
||||||
|
<wd-input label="职工姓名" prop="username" v-model="userStore.userInfo.realname" readonly
|
||||||
|
:rules="[{ required: true, message: '请输入职工姓名' }]" />
|
||||||
|
<wd-input label="工作单位" prop="department" v-model="model.department" readonly
|
||||||
|
:rules="[{ required: true, message: '请输入工作单位' }]" />
|
||||||
|
<wd-input label="联系方式" prop="phone" v-model="model.phone" readonly
|
||||||
|
:rules="[{ required: true, message: '请输入联系方式' }]" />
|
||||||
|
<wd-col-picker label="请假类型" prop="type" v-model="model.type" :columns="typeData" @confirm="queryMinDate"
|
||||||
|
:column-change="columnChange" :display-format="displayFormat" :rules="[{
|
||||||
|
validator: (val) => validateType(val),
|
||||||
|
message: ifOk ? '请选择请假类型' : '有未销假数据,当前只能选择干部离返濮报备', required: true }]" />
|
||||||
|
<wd-calendar label="开始时间" prop="begintime" v-model="model.begintime" @confirm="begintimeConfirm"
|
||||||
|
:rules="[{ required: true, message: '请选择开始时间' }]" :min-date="minBegintime" />
|
||||||
|
<wd-calendar label="结束时间" prop="endtime" v-model="model.endtime"
|
||||||
|
:rules="[{ required: true, message: '请选择结束时间' }]" :min-date="minEndtime" />
|
||||||
|
<wd-picker :label="examineleader" prop="examineleader" v-model="model.examineleader"
|
||||||
|
:columns="examineleaderData" :rules="[{ required: true, message: '请选择' + examineleader }]" />
|
||||||
|
<wd-input label="出发地" prop="departure" v-model="model.departure"
|
||||||
|
:rules="[{ required: true, message: '请输入出发地' }]" />
|
||||||
|
<wd-input label="目的地" prop="destination" v-model="model.destination"
|
||||||
|
:rules="[{ required: true, message: '请输入目的地' }]" />
|
||||||
|
<wd-input label="请假事由" prop="reason" v-model="model.reason"
|
||||||
|
:rules="[{ required: true, message: '请输入请假事由' }]" />
|
||||||
|
</wd-cell-group>
|
||||||
|
<view class="footer">
|
||||||
|
<wd-button type="primary" size="large" @click="handleSubmit" block>提交</wd-button>
|
||||||
|
</view>
|
||||||
|
</wd-form>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
useAppStore
|
||||||
|
} from '@/store';
|
||||||
|
import {
|
||||||
|
useUserStore
|
||||||
|
} from '@/store/user'
|
||||||
|
import {
|
||||||
|
getCategoryItemsApi
|
||||||
|
} from '@/api/system'
|
||||||
|
import {
|
||||||
|
queryZwmcAndExaApi,
|
||||||
|
addApi,
|
||||||
|
queryHisDateApi
|
||||||
|
} from '@/api/pages/absence'
|
||||||
|
import {
|
||||||
|
queryPostByUserIdApi
|
||||||
|
} from '@/api/system/user'
|
||||||
|
|
||||||
|
const appStore = useAppStore();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const model = reactive({
|
||||||
|
contractNumber: userStore.userInfo.workNo,
|
||||||
|
username: userStore.userInfo.username,
|
||||||
|
department: userStore.userInfo.department,
|
||||||
|
phone: userStore.userInfo.phone,
|
||||||
|
type: [], //用[]、0无法正常被验证 就是不选请假类型时也能通过表单验证 所以在form中使用自定义验证
|
||||||
|
begintime: null,
|
||||||
|
endtime: null,
|
||||||
|
examineleader: '',
|
||||||
|
departure: appStore.location,
|
||||||
|
destination: '',
|
||||||
|
reason: '',
|
||||||
|
})
|
||||||
|
const form = ref()
|
||||||
|
const data = ref([])
|
||||||
|
const typeData = ref([])
|
||||||
|
const examineleaderData = ref([])
|
||||||
|
/**判断显示审批 / 分管领导*/
|
||||||
|
const examineleader = ref('')
|
||||||
|
const zwmc = ref('')
|
||||||
|
const ifOk = ref(true)
|
||||||
|
const minBegintime = ref(0)
|
||||||
|
const minEndtime = ref(0)
|
||||||
|
/**返回的最新一条请假结束时间*/
|
||||||
|
const resDate = ref('')
|
||||||
|
/**返回的最新一条请假结束时间*/
|
||||||
|
const handleClickLeft = () => {
|
||||||
|
uni.navigateBack();
|
||||||
|
};
|
||||||
|
const columnChange = ({
|
||||||
|
selectedItem,
|
||||||
|
resolve,
|
||||||
|
finish
|
||||||
|
}) => {
|
||||||
|
const areaData = findChildren(data.value, selectedItem.value)
|
||||||
|
if (areaData && areaData.length) {
|
||||||
|
resolve(
|
||||||
|
areaData.map((item) => {
|
||||||
|
return {
|
||||||
|
value: item.name,
|
||||||
|
label: item.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const findChildren = (data, code) => {
|
||||||
|
if (!code) {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
for (const item of data) {
|
||||||
|
if (item.name === code) {
|
||||||
|
return item.children || null
|
||||||
|
}
|
||||||
|
if (item.children) {
|
||||||
|
const childrenResult = findChildren(item.children, code)
|
||||||
|
if (childrenResult) {
|
||||||
|
return childrenResult
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
const displayFormat = (selectedItems) => {
|
||||||
|
if (selectedItems.length > 0) {
|
||||||
|
return selectedItems[selectedItems.length - 1].label
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const validateType = (val) => {
|
||||||
|
if (!val || val.length === 0) return false // 必须选择
|
||||||
|
const selectedType = val[val.length - 1] // 获取最后一级选中的类型
|
||||||
|
// ifOk为true时可以选任何类型,为false时只能选"干部离返濮报备"
|
||||||
|
return ifOk.value ? true : selectedType === '干部离返濮报备'
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSubmit = () => {
|
||||||
|
form.value.validate().then(({
|
||||||
|
valid,
|
||||||
|
errors
|
||||||
|
}) => {
|
||||||
|
if (valid) {
|
||||||
|
const submitData = {
|
||||||
|
...model,
|
||||||
|
type: model.type[model.type.length - 1], // 取最后一级
|
||||||
|
begintime: formatDate(model.begintime),
|
||||||
|
endtime: formatDate(model.endtime),
|
||||||
|
zwmc: zwmc.value
|
||||||
|
}
|
||||||
|
addApi(submitData).then(res => {
|
||||||
|
console.log('----', res)
|
||||||
|
})
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '成功',
|
||||||
|
// icon: 'success'
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatDate(date) {
|
||||||
|
date = new Date(date)
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
}
|
||||||
|
|
||||||
|
/*获取请假类型*/
|
||||||
|
const getTypeList = () => {
|
||||||
|
getCategoryItemsApi('1838487445813645313').then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
data.value = res.result
|
||||||
|
typeData.value = [data.value.map(item => {
|
||||||
|
return {
|
||||||
|
value: item.name,
|
||||||
|
label: item.name
|
||||||
|
}
|
||||||
|
})]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const getZwmcAndExa = () => {
|
||||||
|
queryZwmcAndExaApi(userStore.userInfo.username).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
examineleaderData.value = res.result.list.map(item => {
|
||||||
|
return {
|
||||||
|
label: item.realname,
|
||||||
|
value: item.username
|
||||||
|
}
|
||||||
|
})
|
||||||
|
zwmc.value = res.result.zwmc
|
||||||
|
if (zwmc.value == '单位专家' || zwmc.value == '基层正职' || zwmc.value == '高级主管') {
|
||||||
|
examineleader.value = '分管领导';
|
||||||
|
} else {
|
||||||
|
examineleader.value = '审批领导';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.message,
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
handleClickLeft()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryHisDate = () => {
|
||||||
|
queryPostByUserIdApi(userStore.userInfo.userid).then(ress => {
|
||||||
|
queryHisDateApi(userStore.userInfo.username).then(res => {
|
||||||
|
if (ress == '员工') { // 员工需要先销假,才能新增请假信息
|
||||||
|
if (res.endtime != null && res.resumptiontime == null) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先销假上一条请假信息!',
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 2000)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else { //基层干部请假
|
||||||
|
if (res.endtime != null && res.resumptiontime == null) {
|
||||||
|
ifOk.value = false; //ifOk为false时,说明 有未销假数据 ,只能请 '干部离返濮'
|
||||||
|
} else {
|
||||||
|
ifOk.value = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resDate.value = res.resumptiontime ? dateStringToTimestamp(res.resumptiontime) :
|
||||||
|
res.endtime ? dateStringToTimestamp(res.endtime, 1) : null
|
||||||
|
console.log('---', resDate.value)
|
||||||
|
queryMinDate();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将日期字符串转换为13位时间戳(支持yyyymmdd和yyyy-mm-dd格式)
|
||||||
|
* @param {string} dateStr
|
||||||
|
* @returns {number} 13位时间戳(毫秒)
|
||||||
|
*/
|
||||||
|
function dateStringToTimestamp(dateStr, flag) {
|
||||||
|
if (dateStr != null) {
|
||||||
|
const normalized = dateStr.replace(/-/g, '');
|
||||||
|
const year = parseInt(normalized.substring(0, 4));
|
||||||
|
const month = parseInt(normalized.substring(4, 6)) - 1;
|
||||||
|
const day = parseInt(normalized.substring(6, 8));
|
||||||
|
const date = new Date(year, month, day);
|
||||||
|
// 如果flag为1,则增加一天
|
||||||
|
if (flag === 1) {
|
||||||
|
date.setDate(date.getDate() + 1);
|
||||||
|
}
|
||||||
|
return date.getTime();
|
||||||
|
} else { // dateStr为空返回当天时间戳
|
||||||
|
const today = new Date();
|
||||||
|
today.setHours(0, 0, 0, 0);
|
||||||
|
return today.getTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryMinDate = () => {
|
||||||
|
const today = new Date(); // 获取当前日期
|
||||||
|
if (resDate.value) {
|
||||||
|
if (model.type[model.type.length - 1] != '干部离返濮报备') {
|
||||||
|
minBegintime.value = resDate.value;
|
||||||
|
} else {
|
||||||
|
const today = new Date(); // 当前日期
|
||||||
|
const sixMonthsAgo = new Date(today);
|
||||||
|
sixMonthsAgo.setMonth(today.getMonth() - 3); // 3个月前 min-date尽量不要设置过大,避免大量数据的计算和传递导致页面性能低下。
|
||||||
|
minBegintime.value = sixMonthsAgo.getTime();
|
||||||
|
}
|
||||||
|
model.begintime = resDate.value > dateStringToTimestamp() ? resDate.value : dateStringToTimestamp()
|
||||||
|
} else {
|
||||||
|
const today = new Date(); // 当前日期
|
||||||
|
const sixMonthsAgo = new Date(today);
|
||||||
|
sixMonthsAgo.setMonth(today.getMonth() - 3); // 3个月前 min-date尽量不要设置过大,避免大量数据的计算和传递导致页面性能低下。
|
||||||
|
minBegintime.value = sixMonthsAgo.getTime();
|
||||||
|
// 如果 resDate 不存在 返回当天
|
||||||
|
model.begintime = dateStringToTimestamp()
|
||||||
|
}
|
||||||
|
minEndtime.value = model.begintime
|
||||||
|
}
|
||||||
|
|
||||||
|
const begintimeConfirm = () => {
|
||||||
|
/*将结束时间置空*/
|
||||||
|
model.endtime = null
|
||||||
|
/*改变结束时间最小值*/
|
||||||
|
minEndtime.value = model.begintime
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
/*获取请假类别*/
|
||||||
|
getTypeList()
|
||||||
|
/*获取审批领导*/
|
||||||
|
getZwmcAndExa()
|
||||||
|
/*获取*/
|
||||||
|
queryHisDate()
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.footer {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -9,7 +9,7 @@
|
|||||||
</route>
|
</route>
|
||||||
<template>
|
<template>
|
||||||
<view :class="{'gray': appStore.isGray == 1 }">
|
<view :class="{'gray': appStore.isGray == 1 }">
|
||||||
<wd-navbar left-text="返回" left-arrow
|
<wd-navbar left-text="返回" left-arrow title="干部值班"
|
||||||
custom-style="padding-top: var(--status-bar-height, 0); background-image: linear-gradient(to right, #1890ff, #096dd9); color: #fff;"
|
custom-style="padding-top: var(--status-bar-height, 0); background-image: linear-gradient(to right, #1890ff, #096dd9); color: #fff;"
|
||||||
@click-left="handleClickLeft">
|
@click-left="handleClickLeft">
|
||||||
</wd-navbar>
|
</wd-navbar>
|
||||||
@ -30,10 +30,9 @@
|
|||||||
import {
|
import {
|
||||||
getListApi
|
getListApi
|
||||||
} from '@/api/pages/duty'
|
} from '@/api/pages/duty'
|
||||||
|
const appStore = useAppStore();
|
||||||
const dataValue = ref(Date.now())
|
const dataValue = ref(Date.now())
|
||||||
const dataSource = ref([])
|
const dataSource = ref([])
|
||||||
const appStore = useAppStore();
|
|
||||||
const handleClickLeft = () => {
|
const handleClickLeft = () => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
};
|
};
|
||||||
@ -67,7 +66,4 @@
|
|||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
@ -71,7 +71,7 @@
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const userName = ref()
|
const userName = ref()
|
||||||
const password = ref()
|
const password = ref()
|
||||||
const showPassword = ref(false) //是否显示明文
|
const showPassword = ref(true) //是否显示明文
|
||||||
const remPW = ref(false) //是否记住密码
|
const remPW = ref(false) //是否记住密码
|
||||||
/**h5系统信息中没有appWgtVersion值*/
|
/**h5系统信息中没有appWgtVersion值*/
|
||||||
const version = uni.getSystemInfoSync().appWgtVersion ? uni.getSystemInfoSync().appWgtVersion : uni.getSystemInfoSync().appVersion
|
const version = uni.getSystemInfoSync().appWgtVersion ? uni.getSystemInfoSync().appWgtVersion : uni.getSystemInfoSync().appVersion
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
</route>
|
</route>
|
||||||
<template>
|
<template>
|
||||||
<view :class="{'gray': appStore.isGray == 1 }">
|
<view :class="{'gray': appStore.isGray == 1 }">
|
||||||
<wd-navbar left-text="返回" left-arrow
|
<wd-navbar left-text="返回" left-arrow title="三册查看"
|
||||||
custom-style="padding-top: var(--status-bar-height, 0); background-image: linear-gradient(to right, #1890ff, #096dd9); color: #fff;"
|
custom-style="padding-top: var(--status-bar-height, 0); background-image: linear-gradient(to right, #1890ff, #096dd9); color: #fff;"
|
||||||
@click-left="handleClickLeft">
|
@click-left="handleClickLeft">
|
||||||
</wd-navbar>
|
</wd-navbar>
|
||||||
<wd-col-picker label="选择目录" v-model="selectedValue" :columns="dataSource" :column-change="columnChange"
|
<wd-col-picker label="选择目录" v-model="selectedValue" :columns="dataSource" :column-change="columnChange"
|
||||||
@confirm="handleConfirm" :display-format="displayFormat" ></wd-col-picker>
|
@confirm="handleConfirm" :display-format="displayFormat"></wd-col-picker>
|
||||||
|
|
||||||
<iframe id="bdIframe" :src="fileUrl" ref="bdIframe" style="border: none;" class="iframe" v-if="fileUrl" />
|
<iframe id="bdIframe" :src="fileUrl" ref="bdIframe" style="border: none;" class="iframe" v-if="fileUrl" />
|
||||||
<view v-else @click="onlinePreview(item.path)" v-for="(item, i) in fileUrl2" style="padding: 15px 0 0 0">
|
<view v-else @click="onlinePreview(item.path)" v-for="(item, i) in fileUrl2" style="padding: 15px 0 0 0">
|
||||||
<wd-card :title="item.name"></wd-card>
|
<wd-card :title="item.name"></wd-card>
|
||||||
@ -42,17 +42,10 @@
|
|||||||
getPathByInsflagQuote,
|
getPathByInsflagQuote,
|
||||||
queryByIdApi
|
queryByIdApi
|
||||||
} from '@/api/pages/sc';
|
} from '@/api/pages/sc';
|
||||||
import {
|
|
||||||
useColPickerData
|
|
||||||
} from '@/hooks/useColPickerData'
|
|
||||||
import Base64 from '@/utils/code';
|
import Base64 from '@/utils/code';
|
||||||
import {
|
import {
|
||||||
getEnvBaseUrl
|
getEnvBaseUrl
|
||||||
} from '@/utils/index'
|
} from '@/utils/index'
|
||||||
const {
|
|
||||||
colPickerData,
|
|
||||||
findChildrenByCode
|
|
||||||
} = useColPickerData()
|
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const data = ref([])
|
const data = ref([])
|
||||||
@ -95,16 +88,18 @@
|
|||||||
let quote = res.result.quote
|
let quote = res.result.quote
|
||||||
let insFlag = res.result.insFlag
|
let insFlag = res.result.insFlag
|
||||||
if (url) {
|
if (url) {
|
||||||
fileUrl.value = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(base64.encode(getEnvBaseUrl() + '/sys/common/static/' + url))
|
fileUrl.value = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(base64
|
||||||
}else if(/^-?\d+$/.test(quote) && !insFlag){
|
.encode(getEnvBaseUrl() + '/sys/common/static/' + url))
|
||||||
|
} else if (/^-?\d+$/.test(quote) && !insFlag) {
|
||||||
getJobDesIdByDepAndName({
|
getJobDesIdByDepAndName({
|
||||||
jobname: quote,
|
jobname: quote,
|
||||||
jobdep: useUserStore().userInfo.orgCode
|
jobdep: useUserStore().userInfo.orgCode
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
fileUrl.value = getEnvBaseUrl() + '/jmreport/view/929517863011811328?id=' + res.id +
|
fileUrl.value = getEnvBaseUrl() + '/jmreport/view/929517863011811328?id=' + res
|
||||||
|
.id +
|
||||||
"&token=" + useUserStore().userInfo.token;
|
"&token=" + useUserStore().userInfo.token;
|
||||||
})
|
})
|
||||||
}else if(insFlag){
|
} else if (insFlag) {
|
||||||
getPathByInsflagQuote({
|
getPathByInsflagQuote({
|
||||||
insFlag: insFlag,
|
insFlag: insFlag,
|
||||||
quote: quote
|
quote: quote
|
||||||
@ -112,7 +107,7 @@
|
|||||||
fileUrl.value = ''
|
fileUrl.value = ''
|
||||||
fileUrl2.value = res;
|
fileUrl2.value = res;
|
||||||
})
|
})
|
||||||
}else {
|
} else {
|
||||||
fileUrl.value = ''
|
fileUrl.value = ''
|
||||||
fileUrl2.value = ''
|
fileUrl2.value = ''
|
||||||
}
|
}
|
||||||
@ -143,22 +138,37 @@
|
|||||||
url: `/pages/onlinePreview/${path}?data=${e}`
|
url: `/pages/onlinePreview/${path}?data=${e}`
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const findChildrenByCode = (data, code) => {
|
||||||
|
if (!code) {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
for (const item of data) {
|
||||||
|
if (item.value === code) {
|
||||||
|
return item.children || null
|
||||||
|
}
|
||||||
|
if (item.children) {
|
||||||
|
const childrenResult = findChildrenByCode(item.children, code)
|
||||||
|
if (childrenResult) {
|
||||||
|
return childrenResult
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
// 判断是否是 H5 环境
|
// 判断是否是 H5 环境
|
||||||
const isH5 = () => {
|
const isH5 = () => {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
return true;
|
return true;
|
||||||
// #endif
|
// #endif
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
return false;
|
return false;
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getList();
|
getList();
|
||||||
//#ifdef H5 || MP-WEIXIN
|
|
||||||
ifH5 = true;
|
|
||||||
//#endif
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { createRouter } from '@/plugin/uni-mini-router'
|
import { createRouter } from '@/plugin/uni-mini-router'
|
||||||
// 导入pages.json
|
// 导入pages.json
|
||||||
import pagesJson from '../pages.json'
|
import pagesJson from '../pages.json'
|
||||||
console.log("pagesJson::",pagesJson);
|
|
||||||
// 引入uni-parse-pages
|
// 引入uni-parse-pages
|
||||||
import pagesJsonToRoutes from 'uni-parse-pages'
|
import pagesJsonToRoutes from 'uni-parse-pages'
|
||||||
import { useUserStore } from '@/store/user'
|
import { useUserStore } from '@/store/user'
|
||||||
|
1
src/types/uni-pages.d.ts
vendored
1
src/types/uni-pages.d.ts
vendored
@ -20,6 +20,7 @@ interface NavigateToOptions {
|
|||||||
"/pages/onlinePreview/onlinePreviewH5" |
|
"/pages/onlinePreview/onlinePreviewH5" |
|
||||||
"/pages/user/people" |
|
"/pages/user/people" |
|
||||||
"/pages/workHome/index" |
|
"/pages/workHome/index" |
|
||||||
|
"/pages/humanResources/absence/apply" |
|
||||||
"/pages/integrated/duty/index" |
|
"/pages/integrated/duty/index" |
|
||||||
"/pages/operate/file/detail" |
|
"/pages/operate/file/detail" |
|
||||||
"/pages/operate/file/index" |
|
"/pages/operate/file/index" |
|
||||||
|
@ -371,7 +371,7 @@ export const getLocation = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const getWeather = (lat : string, lon : string) => {
|
const getWeather = (lat : number, lon : number) => {
|
||||||
let params = {
|
let params = {
|
||||||
lat: lat,
|
lat: lat,
|
||||||
lon: lon
|
lon: lon
|
||||||
@ -388,7 +388,7 @@ function handleDefaultLocation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function weatherRequest(params: { lat?: string; lon?: string; q?: string }) {
|
function weatherRequest(params : { lat ?: string; lon ?: string; q ?: string }) {
|
||||||
const store = useAppStore()
|
const store = useAppStore()
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'https://api.openweathermap.org/data/2.5/weather',
|
url: 'https://api.openweathermap.org/data/2.5/weather',
|
||||||
|
Loading…
Reference in New Issue
Block a user