新建工程
This commit is contained in:
1690
common/js/area.json
Normal file
1690
common/js/area.json
Normal file
File diff suppressed because it is too large
Load Diff
12
pages.json
12
pages.json
@@ -297,6 +297,18 @@
|
||||
"navigationBarTitleText": "新增项目"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/gc/new",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增工程"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/gc/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "工程列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/erweima",
|
||||
"style": {
|
||||
|
||||
143
pages/gc/list.vue
Normal file
143
pages/gc/list.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<view :loading="loading">
|
||||
<!-- <uni-nav-bar left-icon="left" right-icon="cart" title="标题" /> -->
|
||||
<uni-nav-bar dark :fixed="true" status-bar left-icon="left" :rightIcon="userInfo.role == '2' ? '' : 'plusempty'"
|
||||
background-color="#fff" color="#111" title="工程管理" @clickLeft="back" @clickRight="add" />
|
||||
<view class="message">
|
||||
<uni-card :title="item.name" :extra="item.projectType" @click="jump('XXX项目1')"
|
||||
v-for="(item, index) in store.data" :key="index">
|
||||
<view class="term-list-bottom">
|
||||
<view class="term-list-bottom-item">
|
||||
<view>设备个数</view>
|
||||
<view>3</view>
|
||||
</view>
|
||||
<view class="term-list-bottom-item">
|
||||
<view>用户个数</view>
|
||||
<view>1</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<Cn-empty v-if="store.empty" style="padding-top:200rpx"></Cn-empty>
|
||||
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import list from '../../common/js/list'
|
||||
export default {
|
||||
mixins: [list],
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
userInfo: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.store = this.DataSource('/engineering/queryEngineering')
|
||||
this.store.params.userId = uni.getStorageSync('userInfo').id
|
||||
this.store.reload()
|
||||
},
|
||||
back () {
|
||||
uni.navigateBack()
|
||||
},
|
||||
add () {
|
||||
uni.navigateTo({
|
||||
url: `/pages/gc/new`
|
||||
})
|
||||
},
|
||||
upgrade (code) {
|
||||
console.log(code);
|
||||
uni.showToast({
|
||||
title: '升级成功',
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
jump (type) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/project/detail?project=${type}`
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad () {
|
||||
this.init()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.message {
|
||||
padding-top: 20rpx;
|
||||
|
||||
.message-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 8rpx #e7e7e74c;
|
||||
|
||||
.message-header-head {
|
||||
margin-right: 30rpx;
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.message-header-name {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
|
||||
.tag {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.message-nav {
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
border-bottom: 1rpx solid #e8e8e8;
|
||||
|
||||
&-icon {
|
||||
margin-right: 30rpx;
|
||||
height: 44rpx;
|
||||
width: 44rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-label {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #111;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.term-list-bottom {
|
||||
.term-list-bottom-item {
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// view:first-of-type{
|
||||
// color: #111;
|
||||
// }
|
||||
}
|
||||
|
||||
.term-list-bottom-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
168
pages/gc/new.vue
Normal file
168
pages/gc/new.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='new'>
|
||||
<view class="content">
|
||||
<uni-forms :label-width="80">
|
||||
<uni-forms-item label="工程名称">
|
||||
<uni-easyinput type="number" v-model="formData.name" placeholder="请输入工程名称" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="位置">
|
||||
<view style="display:flex;">
|
||||
<uni-easyinput :clearable="false" type="textarea" autoHeight v-model="formData.area"
|
||||
placeholder="请输入位置信息" />
|
||||
<uni-icons type="location" color="#007aff" size="26" class="ml20"
|
||||
@click="chooseLocation"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="描述">
|
||||
<uni-easyinput type="textarea" autoHeight v-model="formData.description"
|
||||
placeholder="请输入工程描述" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="submit"> 提交 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { addAppProject } from '../../common/api/project'
|
||||
// import area from '../../common/js/area.json'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
formData: {
|
||||
area: "",
|
||||
files: [],
|
||||
description: '',
|
||||
projectType: '1',
|
||||
name: '',
|
||||
userId: '123456',
|
||||
lat: '2',
|
||||
lng: '3'
|
||||
},
|
||||
TypeRange: [
|
||||
{
|
||||
text: '监测',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
text: '用能',
|
||||
value: '2'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad () {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
console.log('当前位置的经度:' + res.longitude);
|
||||
console.log('当前位置的纬度:' + res.latitude);
|
||||
}
|
||||
});
|
||||
// console.log(area);
|
||||
},
|
||||
methods: {
|
||||
select (e) {
|
||||
console.log(e);
|
||||
},
|
||||
chooseLocation () {
|
||||
|
||||
uni.chooseLocation({
|
||||
success: function (res) {
|
||||
this.address = res.name
|
||||
console.log('位置名称:' + res.name);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
console.log('经度:' + res.longitude);
|
||||
}
|
||||
});
|
||||
},
|
||||
async submit () {
|
||||
if (!this.formData.name) {
|
||||
this.$util.toast('请输入工程名称')
|
||||
return
|
||||
}
|
||||
if (!this.formData.projectType) {
|
||||
this.$util.toast('请选择工程类别')
|
||||
return
|
||||
}
|
||||
if (!this.formData.area) {
|
||||
this.$util.toast('请输入区域信息')
|
||||
return
|
||||
}
|
||||
if (!this.formData.description) {
|
||||
this.$util.toast('请输入工程描述')
|
||||
return
|
||||
}
|
||||
if (!this.formData.files.length) {
|
||||
this.$util.toast('请上传拓扑图')
|
||||
return
|
||||
}
|
||||
let arr = []
|
||||
for (let i = 0; i < this.formData.files.length; i++) {
|
||||
let item = this.formData.files[i]
|
||||
arr.push({
|
||||
name: 'files',
|
||||
url: item.url
|
||||
})
|
||||
}
|
||||
let data = JSON.parse(JSON.stringify(this.formData))
|
||||
delete data.files
|
||||
addAppProject(data, arr).then(res => {
|
||||
console.log(res)
|
||||
this.$util.toast('工程创建成功')
|
||||
// setTimeout(() => {
|
||||
// uni.navigateBack({ delta: 1 })
|
||||
// }, 1500);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.new {
|
||||
padding: 34rpx;
|
||||
|
||||
.content {
|
||||
.content-des {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
margin-bottom: 20rpx;
|
||||
padding: 34rpx;
|
||||
background: $uni-theme-white;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.btn-wrap {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn-wrap-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .uni-drawer__content {
|
||||
width: 100vw !important;
|
||||
}
|
||||
</style>
|
||||
@@ -32,6 +32,12 @@
|
||||
<view class="mine-nav-label">扫一扫</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('gc')"
|
||||
v-if="userInfo.role == 4 || userInfo.role == 3 || userInfo.role == 2">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<view class="mine-nav-label">工程管理</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('project')"
|
||||
v-if="userInfo.role == 4 || userInfo.role == 3 || userInfo.role == 2">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
@@ -143,6 +149,10 @@ export default {
|
||||
url: `/pages/project/list`
|
||||
})
|
||||
break;
|
||||
case 'gc':
|
||||
uni.navigateTo({
|
||||
url: `/pages/gc/list`
|
||||
})
|
||||
break;
|
||||
default:
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<uni-list>
|
||||
<uni-list-item :title="item.createBy" :note="item.chatContent" :rightText="item.createTime"
|
||||
v-for="(item, index) in pageData.csFeedbackChatPOList" :key="index" />
|
||||
<Cn-empty v-if="pageData.csFeedbackChatPOList && pageData.csFeedbackChatPOList.length == 0"></Cn-empty>
|
||||
</uni-list>
|
||||
<!-- 输入框示例 -->
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
|
||||
Reference in New Issue
Block a user