日计划 等页面搭建

This commit is contained in:
BianLzhaoMin 2024-10-15 17:01:47 +08:00
parent f5ae7a0d84
commit bcb0fac678
14 changed files with 745 additions and 66 deletions

40
main.js
View File

@ -5,9 +5,13 @@ import store from './store'
// #ifndef VUE3
import Vue from 'vue'
import config from './config.js'
import moment from 'moment'
moment.locale('zh-cn')
Vue.config.productionTip = false
// Vue.prototype.$api = $api
Vue.prototype.$store = store
Vue.prototype.$moment = moment
Vue.prototype.$adpid = '1111111111'
Vue.prototype.$backgroundAudioData = {
playing: false,
@ -33,23 +37,23 @@ Vue.prototype.$verificationToken = function () {
header: {
Authorization: uni.getStorageSync('access_token')
},
success: (res) => {
console.log('🚀 ~ res:', res)
let data = res.data
console.log('🚀 ~ res.data:', data)
if (data === '' || data === undefined) {
uni.showToast({
title: '已在其他设备登录,请重新登录',
icon: 'none'
})
uni.reLaunch({
url: '/pages/login'
})
}
},
fail: (err) => {
console.log('🚀 ~ err:', err)
}
success: res => {
console.log('🚀 ~ res:', res)
let data = res.data
console.log('🚀 ~ res.data:', data)
if (data === '' || data === undefined) {
uni.showToast({
title: '已在其他设备登录,请重新登录',
icon: 'none'
})
uni.reLaunch({
url: '/pages/login'
})
}
},
fail: err => {
console.log('🚀 ~ err:', err)
}
})
}
@ -63,7 +67,7 @@ app.$mount()
// #ifdef VUE3
import { createSSRApp } from 'vue'
import { data } from 'uview-ui/libs/mixin/mixin';
import { data } from 'uview-ui/libs/mixin/mixin'
export function createApp() {
const app = createSSRApp(App)
app.use(store)

40
package-lock.json generated
View File

@ -3,41 +3,6 @@
"version": "3.4.5",
"lockfileVersion": 1,
"requires": true,
"packages": {
"": {
"name": "hello-uniapp",
"version": "3.4.5",
"license": "MIT",
"dependencies": {
"crypto-js": "^4.2.0",
"image-tools": "^1.4.0",
"luch-request": "^3.1.1"
}
},
"node_modules/@dcloudio/types": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/@dcloudio/types/-/types-2.6.12.tgz",
"integrity": "sha512-mrCMwcINy1IFjU9VUqLeWBkj404yWs5paLDttBcA+eqUjanuUQbBcTVPqlrGgkyzLXDcV2oDDZRSNxNpXi4kMQ=="
},
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"node_modules/image-tools": {
"version": "1.4.0",
"resolved": "https://registry.npmmirror.com/image-tools/-/image-tools-1.4.0.tgz",
"integrity": "sha512-TKtvJ6iUwM0mfaD4keMnk1ENHFC470QEjBfA3IlvKdEOufzvWbjbaoNcoyYq6HlViF8+d5tOS1ooE6j7CHf1lQ=="
},
"node_modules/luch-request": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/luch-request/-/luch-request-3.1.1.tgz",
"integrity": "sha512-p7+mlcEtgRcd0OfXC4XZbyiwSr1XgCeqNT7LlVUjnk7InYl/8d5Rk7BUqAYNA2WRafI1wRIUQWRWZRpeUwWR0w==",
"dependencies": {
"@dcloudio/types": "^2.0.16"
}
}
},
"dependencies": {
"@dcloudio/types": {
"version": "2.6.12",
@ -61,6 +26,11 @@
"requires": {
"@dcloudio/types": "^2.0.16"
}
},
"moment": {
"version": "2.30.1",
"resolved": "https://repo.huaweicloud.com/repository/npm/moment/-/moment-2.30.1.tgz",
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
}
}
}

View File

@ -23,7 +23,8 @@
"dependencies": {
"crypto-js": "^4.2.0",
"image-tools": "^1.4.0",
"luch-request": "^3.1.1"
"luch-request": "^3.1.1",
"moment": "^2.30.1"
},
"dcloudext": {
"sale": {

View File

@ -211,7 +211,6 @@
"navigationBarTitleText": "图片学习"
}
},
////-
{
//
@ -631,7 +630,6 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/HealthExaminationApp/index/index",
"style": {
@ -692,13 +690,25 @@
"navigationBarTitleText": "消息通知"
}
},
/* */
{
"path": "pages/workPlan/index/index",
"style": {
"navigationStyle": "custom"
}
},
/* */
{
"path": "pages/workPlan/workbench/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/workPlan/dayPlan/index",
"style": {
"navigationStyle": "custom"
}
}
],
"globalStyle": {

View File

@ -0,0 +1,39 @@
<template>
<view>
<picker mode="date" @change="onDateChange" :value="DateValue">
<!-- <view>
<text style="color: red; margin: 0 10rpx">*</text>
<text>选择时间</text>
</view> -->
<view class="time-container">
<view class="date-picker">{{ DateValue }}</view>
<text>&gt;</text>
</view>
</picker>
</view>
</template>
<script>
export default {
data() {
return {
DateValue: this.$moment().format('YYYY-MM-DD')
}
},
methods: {
onDateChange(e) {
this.DateValue = e.detail.value
}
}
}
</script>
<style scoped>
.time-container {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 38rpx;
}
</style>

View File

@ -0,0 +1,377 @@
<template>
<view class="day-plan">
<u-navbar
class="u-navbar"
:title="dayPlanTitle"
placeholder
@leftClick="leftClick"
leftIconColor="#fff"
bgColor="#00337A"
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
/>
<view class="day-plan-content">
<button
:key="index"
@tap="onTapCheck(index)"
v-for="(item, index) in btnList"
:class="{ active: index === activeIndex }"
>
{{ item.btn_title }}
</button>
</view>
<!-- 工程待办 -->
<view class="common-style" v-show="activeIndex === 0">
<picker mode="date" @change="onDateChange" :value="currentTime">
<view>
<text style="color: red; margin: 0 10rpx">*</text>
<text>选择时间</text>
</view>
<view class="time-container">
<view class="date-picker">{{ currentTime }}</view>
<text>&gt;</text>
</view>
</picker>
</view>
<!-- 发起提交 -->
<view v-show="activeIndex === 1" class="submit-container common-style">
<uni-forms
class="form-container"
ref="form"
:modelValue="formData"
:rules="rules"
label-position="top"
label-width="200"
>
<uni-forms-item label="工程名称" required>
<view class="time-container" @tap="onSelectProject">
<view>请选择</view>
<text>&gt;</text>
</view>
</uni-forms-item>
<uni-forms-item label="选择时间" required>
<view>
<TimeSelect />
</view>
</uni-forms-item>
<uni-forms-item label="分公司分管领导" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="简要工程概况" name="gk" required>
<uni-easyinput type="text" v-model="formData.gk" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="施工进度" name="jd" required>
<uni-easyinput type="text" v-model="formData.jd" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="作业内容" name="nr" required>
<uni-easyinput type="text" v-model="formData.nr" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="风险等级" name="dj" required>
<view class="time-container" @tap="onSelectProject">
<view>请选择</view>
<text>&gt;</text>
</view>
</uni-forms-item>
<uni-forms-item label="风险类别" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="现场负责人" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="全体人数" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="公司职工人数" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="分包人员人数" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="投入车辆(辆)" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="投入监控设备数(台)" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="SIP编号" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="责任管控人" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="中等以上风险作业管控人等" name="name" required>
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="风险管控层级" name="name" required>
<view class="time-container" @tap="onSelectProject">
<view>请选择</view>
<text>&gt;</text>
</view>
</uni-forms-item>
</uni-forms>
<view class="submit-btn">
<button>导入计划</button>
<button @tap="onSaveSubmit">保存提交</button>
</view>
</view>
<!-- 查看报表 -->
<view v-show="activeIndex === 2" class="common-style">
<uni-forms ref="form-b" label-position="top" label-width="200">
<uni-forms-item label="工程名称" required>
<view class="time-container" @tap="onSelectProject">
<view>请选择</view>
<text>&gt;</text>
</view>
</uni-forms-item>
</uni-forms>
<view class="icon-search-time">
<text style="fon-size: 30rpx; margin-right: 25rpx" @tap="onReduceMonth"></text>
<uni-icons type="left" size="20" @tap="onReduceDay"></uni-icons>
<view class="view-time">
<picker mode="date" @change="onChangeCurrentData" :value="currentTime">
<view class="date-picker">{{ currentTime }}</view>
</picker>
</view>
<uni-icons type="right" size="20" @tap="onAddDay"></uni-icons>
<text style="fon-size: 30rpx; margin-left: 25rpx" @tap="onAddMonth"></text>
<button @tap="onBackToday">返回本日</button>
</view>
</view>
<!-- 查看数据 -->
<view v-show="activeIndex === 3">查看数据</view>
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="flex-style" style="justify-content: space-between">
<text>选择工程</text>
<text>X</text>
</view>
<view>2024-10-16</view>
<view class="search">
<view class="select">
<uni-data-select v-model="value" @change="onProjectChange" :localdata="range"></uni-data-select>
</view>
<button>搜索</button>
</view>
<view class="project-content">暂无数据</view>
</view>
</uni-popup>
</view>
</template>
<script>
import TimeSelect from './components/time-select'
export default {
components: {
TimeSelect
},
data() {
return {
dayPlanTitle: '基建日计划',
activeIndex: 0,
btnList: [
{ btn_title: '工作待办' },
{ btn_title: '发起提交' },
{ btn_title: '查看报表' },
{ btn_title: '查看数据' }
],
currentTime: this.$moment().format('YYYY-MM-DD'),
range: [
{ value: 0, text: '全部' },
{ value: 1, text: '未填报' },
{ value: 2, text: '已填报' }
],
value: 0,
formData: {},
rules: {
name: {
rules: [{ required: true, errorMessage: '请填写' }]
},
gk: {
rules: [{ required: true, errorMessage: '请填写' }]
},
jd: {
rules: [{ required: true, errorMessage: '请填写' }]
},
nr: {
rules: [{ required: true, errorMessage: '请填写' }]
},
dj: {
rules: [{ required: true, errorMessage: '请填写' }]
}
}
}
},
methods: {
leftClick() {
uni.navigateTo({ url: '/pages/workPlan/workbench/index' })
},
onTapCheck(i) {
this.activeIndex = i
},
onSelectTime() {
this.$refs.popup.open('top')
},
onChangeCurrentData(e) {
this.currentTime = e.detail.value
},
onSelectProject() {
this.$refs.popup.open('center')
},
onProjectChange() {
console.log('选择---')
},
onSaveSubmit() {
this.$refs.form
.validate()
.then(res => {
console.log(res)
})
.catch(error => {
console.log(error)
})
},
onReduceMonth() {
this.currentTime = this.$moment(this.currentTime).subtract(1, 'months').format('YYYY-MM-DD')
},
onReduceDay() {
this.currentTime = this.$moment(this.currentTime).subtract(1, 'days').format('YYYY-MM-DD')
},
onAddMonth() {
this.currentTime = this.$moment(this.currentTime).add(1, 'months').format('YYYY-MM-DD')
},
onAddDay() {
this.currentTime = this.$moment(this.currentTime).add(1, 'days').format('YYYY-MM-DD')
},
onBackToday() {
this.currentTime = this.$moment().format('YYYY-MM-DD')
}
},
onLoad(options) {
if (options.type == 1) {
this.dayPlanTitle = '基建日计划'
} else {
this.dayPlanTitle = '生产日计划'
}
}
}
</script>
<style lang="scss" scoped>
.day-plan-content {
display: flex;
button {
// width: 50%;
flex: 1;
height: 120rpx;
// color: #00337a;
color: #2c2b2b;
font-size: 26rpx;
line-height: 120rpx;
text-align: center;
border-radius: 0;
}
button::after {
border: none;
}
.active {
border-bottom: 2px solid #00337a;
}
}
.common-style {
padding: 15rpx;
}
.time-container {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 38rpx;
}
// .project-select {
// width: 80%;
// }
.popup-content {
width: 90vw;
padding: 20rpx;
background-color: #eeeeee;
.search {
width: 100%;
height: 70rpx;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #eeeeee;
.select {
height: 68rpx;
width: 65%;
margin: 0;
}
button {
height: 68rpx;
width: 30%;
line-height: 68rpx;
font-size: 32rpx;
background-color: #003777;
color: #fff;
border-radius: 12rpx;
}
}
.project-content {
height: 460rpx;
width: 97%;
margin: 0 auto;
background-color: #fff;
}
}
.flex-style {
display: flex;
align-content: center;
}
.form-container {
padding: 10rpx 20rpx;
}
.uni-forms-item {
margin-bottom: 16px;
}
.submit-btn {
margin: 15rpx 0;
}
.icon-search-time {
height: 68rpx;
display: flex;
align-items: center;
font-weight: bold;
button {
background-color: #003777;
color: #fff;
height: 65rpx;
line-height: 65rpx;
font-weight: normal;
font-size: 30rpx;
}
}
.view-time {
margin: 0 35rpx;
}
</style>

View File

@ -37,11 +37,6 @@ export default {
<style lang="scss" scoped>
.day-risk {
h2 {
margin: 20rpx 0;
font-size: 26rpx;
}
.data-container {
display: flex;
justify-content: space-between;

View File

@ -1,11 +1,59 @@
<template>
<view>
<text>风险日历</text>
<h2>风险日历</h2>
<view class="check-btn">
<button
v-for="(item, index) in btnList"
:key="index"
class="button"
:type="activeIndex === index ? 'primary' : ''"
@tap="onTimeCheck(index)"
>
{{ item.btn_title }}
</button>
</view>
<view>
<!-- 插入模式 -->
<uni-calendar
class="uni-calendar--hook"
startDate="2024-10-15"
endDate="2024-10-20"
:range="true"
:showMonth="false"
@change="change"
@monthSwitch="monthSwitch"
/>
</view>
</view>
</template>
<script>
export default {}
export default {
data() {
return {
primary: '',
activeIndex: 0,
btnList: [{ btn_title: '月' }, { btn_title: '周' }, { btn_title: '日' }]
}
},
methods: {
change() {
console.log('日期变化---')
},
monthSwitch() {
console.log('切换月份时触发--')
},
onTimeCheck(i) {
this.activeIndex = i
}
}
}
</script>
<style></style>
<style lang="scss" scoped>
.check-btn {
display: flex;
align-items: center;
}
</style>

View File

@ -71,5 +71,10 @@ export default {
background: #fff;
box-sizing: border-box;
padding: 0 10rpx;
h2 {
margin: 20rpx 0;
font-size: 26rpx;
}
}
</style>

View File

@ -12,7 +12,7 @@ export default {
//新版本新增页面被打开方式默认为reLaunch
},
{
pagePath: 'pages/realName/workbench/index',
pagePath: 'pages/workPlan/workbench/index',
iconPath: '/static/realName/work.png',
selectedIconPath: '/static/realName/workSelected.png',
text: '工作台'

View File

@ -0,0 +1,43 @@
<template>
<!-- 现场监护 -->
<view class="custody">
<h4>现场监护</h4>
<view class="custody-content">
<view class="icon-box">
<image src="@/static/realName/attendance_statistics.png" mode="scaleToFill" />
现场监护
</view>
</view>
</view>
</template>
<script>
export default {}
</script>
<style lang="scss" scoped>
.custody-content {
padding: 25rpx 5rpx;
background-color: #fff;
image {
width: 58rpx;
height: 58rpx;
margin-bottom: 30rpx;
}
.icon-box {
width: 33.33%;
display: flex;
flex-direction: column;
align-items: center;
}
}
h4 {
margin: 20rpx 0;
padding-left: 15rpx;
font-size: 36rpx;
font-weight: normal;
}
</style>

View File

@ -0,0 +1,67 @@
<template>
<!-- 现场监护 -->
<view class="infrastructure">
<h4>基建-计划审核</h4>
<view class="infrastructure-content">
<view class="icon-box" v-for="(icon, index) in iconList" :key="index" @tap="onOpenPlanPage(icon.url)">
<image src="@/static/realName/attendance_statistics.png" mode="scaleToFill" />
{{ icon.icon_title }}
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
iconList: [
{ icon_title: '日计划', url: '/pages/workPlan/dayPlan/index' },
{ icon_title: '周计划', url: 'xxx' },
{ icon_title: '月计划', url: 'xxx' },
{ icon_title: '涉网计划', url: 'xxx' },
{ icon_title: '临时计划', url: 'xxx' }
]
}
},
methods: {
onOpenPlanPage(url) {
uni.navigateTo({ url: `${url}?type=1` })
}
}
}
</script>
<style lang="scss" scoped>
.infrastructure-content {
padding: 25rpx 5rpx;
background-color: #fff;
display: flex;
flex-wrap: wrap;
image {
width: 58rpx;
height: 58rpx;
margin-bottom: 30rpx;
}
.icon-box {
width: 33.33%;
display: flex;
flex-direction: column;
align-items: center;
}
}
.infrastructure-content .icon-box:nth-child(4),
.infrastructure-content .icon-box:nth-child(5) {
margin-top: 30rpx;
}
h4 {
margin: 20rpx 0;
padding-left: 15rpx;
font-size: 36rpx;
font-weight: normal;
}
</style>

View File

@ -0,0 +1,67 @@
<template>
<!-- 现场监护 -->
<view class="production">
<h4>生产-计划审核</h4>
<view class="production-content">
<view class="icon-box" v-for="(icon, index) in iconList" :key="index" @tap="onOpenPlanPage(icon.url)">
<image src="@/static/realName/attendance_statistics.png" mode="scaleToFill" />
{{ icon.icon_title }}
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
iconList: [
{ icon_title: '日计划', url: '/pages/workPlan/dayPlan/index' },
{ icon_title: '周计划', url: 'xxx' },
{ icon_title: '月计划', url: 'xxx' },
{ icon_title: '涉网计划', url: 'xxx' },
{ icon_title: '临时计划', url: 'xxx' }
]
}
},
methods: {
onOpenPlanPage(url) {
uni.navigateTo({ url: `${url}?type=2` })
}
}
}
</script>
<style lang="scss" scoped>
.production-content {
padding: 25rpx 5rpx;
background-color: #fff;
display: flex;
flex-wrap: wrap;
image {
width: 58rpx;
height: 58rpx;
margin-bottom: 30rpx;
}
.icon-box {
width: 33.33%;
display: flex;
flex-direction: column;
align-items: center;
}
}
.production-content .icon-box:nth-child(4),
.production-content .icon-box:nth-child(5) {
margin-top: 30rpx;
}
h4 {
margin: 20rpx 0;
padding-left: 15rpx;
font-size: 36rpx;
font-weight: normal;
}
</style>

View File

@ -0,0 +1,53 @@
<template>
<view class="workbench">
<u-navbar
class="u-navbar"
title="工作台"
placeholder
@leftClick="leftClick"
leftIconColor="#fff"
bgColor="#00337A"
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
/>
<!-- 现场监护 -->
<CustodyModel />
<!-- 基建-计划审核 -->
<InfrastructureModel />
<!-- 生产-计划审核 -->
<ProductionModel />
<m-tabbar fixed fill :current="1" :tabbar="tabbar"></m-tabbar>
</view>
</template>
<script>
import TabbarConfig from '../util/tabbar'
import CustodyModel from './components/custody-model'
import InfrastructureModel from './components/infrastructure-model'
import ProductionModel from './components/production-model'
export default {
components: {
CustodyModel,
ProductionModel,
InfrastructureModel
},
data() {
return {
tabbar: TabbarConfig
}
},
methods: {
leftClick() {
uni.navigateTo({ url: '/pages/workPlan/index/index' })
}
}
}
</script>
<style lang="scss" scoped>
.workbench {
padding: 20rpx 30rpx;
}
</style>