2 次代碼提交 0f121348ec ... e3399d8d82

作者 SHA1 備註 提交日期
  menchuang e3399d8d82 sync 1 年之前
  menchuang 5f3b6e21da 首页 列表权限完善 1 年之前
共有 10 個文件被更改,包括 253 次插入99 次删除
  1. 8 1
      api/common.js
  2. 3 3
      config.js
  3. 1 1
      manifest.json
  4. 119 26
      pages/bottom_leg/bottom_leg.vue
  5. 2 2
      pages/login.vue
  6. 69 47
      pages/open_bolt/open_bolt.vue
  7. 24 15
      pages/work/index.vue
  8. 12 3
      store/modules/user.js
  9. 13 0
      utils/auth.js
  10. 2 1
      utils/constant.js

+ 8 - 1
api/common.js

@@ -1,6 +1,13 @@
 import request from '@/utils/request'
 
-
+// 新增拆旧管
+export function openBolt(param) {
+	return request({
+		'url': '/zdsz/openbolt',
+		'method': 'post',
+		'data': param
+	})
+}
 //  修改房间信息
 export function putRoomDetails(id, newPhone) {
 	const data = {

+ 3 - 3
config.js

@@ -1,10 +1,10 @@
 // 应用全局配置
 module.exports = {
-	 baseUrl: 'https://www.xcx.cczdsz.cn/prod-api',
+	 // baseUrl: 'https://www.xcx.cczdsz.cn/prod-api',
 	// baseUrl: 'http://192.168.4.6:8080',
 	// baseUrl: 'http://192.168.4.20:8080',
-	// baseUrl: 'http://192.168.4.11:8080',
-	//baseUrl: 'http://192.168.4.23:8080',
+	baseUrl: 'http://192.168.4.11:8080',
+	// baseUrl: 'http://192.168.4.23:8080',
 	// baseUrl: 'http://192.168.4.14:8089',
 	baseIconUrl: 'https://www.xcx.cczdsz.cn/app/images/',
 	// 应用信息

+ 1 - 1
manifest.json

@@ -41,7 +41,7 @@
     },
     "quickapp" : {},
     "mp-weixin" : {
-        "appid" : "wx41e003e1c9067d02",
+        "appid" : "wx6f1b92a9d915fb4d",
         "setting" : {
             "urlCheck" : false,
             "es6" : false,

+ 119 - 26
pages/bottom_leg/bottom_leg.vue

@@ -90,18 +90,70 @@
 							<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
 						</view>
 					</view>
+
+					<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+						<view class="uni-common-mt" style="width: 100%;">
+							<text class="uni-title uni-common-pl">施工内容</text>
+							<view style="width: 100%;box-sizing: border-box;">
+								<textarea class="textarea" placeholder="请输入施工内容" maxlength="255"
+									placeholder-style="padding: 10rpx;"
+									style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
+									auto-height v-model="projectContent"></textarea>
+							</view>
+						</view>
+					</view>
+
+					<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+						<view class="uni-list-cell-left">
+							施工位置
+						</view>
+						<view v-if="this.isEmpty(this.positionKey)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('position')">
+							<span style="color: darkgray;">请选择施工位置</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('position')">
+							<span style="color: black;">{{positionValue}}</span>
+						</view>
+						第
+						<input class="uni-input" type="number" v-model="inputNumberValue" maxlength="6"
+							style="text-align: center; border: 1px solid #cccccc; border-radius: 20rpx;width: 60px;"></input>
+						根
+					</view>
+
 				</view>
-				<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+				<!-- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
 					<text>米 数</text>
-					<!-- style="margin-left: 10px;text-align: right;" -->
 					<view style="display: flex; justify-content: right; width: 70%;">
-					<input class="uni-input" type="number" v-model="inputIntegerNumberValue" maxlength="6"
-						style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx"></input>
-					<text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
-					<input class="uni-input" type="number" v-model="inputDecimalNumberValue" maxlength="1"
-						style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
+						<input class="uni-input" type="number" v-model="inputIntegerNumberValue" maxlength="6"
+							style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx"></input>
+						<text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
+						<input class="uni-input" type="number" v-model="inputDecimalNumberValue" maxlength="1"
+							style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
+					</view>
+				</view> -->
+				<view class="container" style="color: #b2b2b2;">*沟上部分照片</view>
+				<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
+					<image :src="loadImgSrc('updateimg.png')" mode=""
+						style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="chooseimage(0)"
+						v-show="reviewStatus!='1'"></image>
+					<view v-for="(item,index) in imgArr0" :key="index" style="position: relative;">
+						<view
+							v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
+							<image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
+								@click="showPhoto(index,1)">
+							</image>
+						</view>
+						<view v-else>
+							<video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
+						</view>
+						<view @click="remove(index,0)"
+							style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
+							<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
+							</image>
+						</view>
 					</view>
 				</view>
+
 				<view class="container" style="color: #b2b2b2;">*开挖前照片</view>
 				<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
 					<image :src="loadImgSrc('updateimg.png')" mode=""
@@ -124,6 +176,7 @@
 						</view>
 					</view>
 				</view>
+
 				<view class="container" style="color: #b2b2b2;">*下沟照片</view>
 				<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
 					<image :src="loadImgSrc('updateimg.png')" mode=""
@@ -146,6 +199,7 @@
 						</view>
 					</view>
 				</view>
+
 				<view class="container" style="color: #b2b2b2;">*回填照片</view>
 				<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
 					<image :src="loadImgSrc('updateimg.png')" mode=""
@@ -226,6 +280,9 @@
 					openDict: false,
 					selectList: [],
 					dictOptions: [],
+					positionKey: '',
+					positionValue: '',
+					imgArr0: [],
 					imgArr1: [],
 					imgArr2: [],
 					imgArr3: [],
@@ -237,6 +294,7 @@
 					LDValue: {},
 					DYValue: {},
 					time: '', //施工时间
+					projectContent: '', //施工内容
 					XQList: '',
 					LDList: '',
 					DYList: '',
@@ -245,8 +303,8 @@
 					loading: false,
 					historyList: {}, //历史数据
 					inputNumberValue: '',
-					inputIntegerNumberValue: '',
-					inputDecimalNumberValue: '',
+					// inputIntegerNumberValue: '',
+					// inputDecimalNumberValue: '',
 				}
 			},
 
@@ -309,8 +367,8 @@
 				getStatus() {
 					let param = {
 						areaId: this.XQValue.id, // 小区id
-						buildingId: buildingId, // 楼宇id
-						unitId: this.isEmpty(this.DYValue.id)?'':this.DYValue.id,
+						buildingId: this.LDValue.id, // 楼宇id
+						unitId: this.isEmpty(this.DYValue.id) ? '' : this.DYValue.id,
 						enginCycle: this.projectValue.dictValue, // 工程周期
 						enginType: this.objValue.enginType, //写死 上一页面传过来的
 						enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
@@ -350,8 +408,16 @@
 						this.$modal.msg("请选择小区")
 					} else if (this.isEmpty(this.LDValue.id)) {
 						this.$modal.msg("请选择楼栋")
-					} else if (this.isEmpty(this.inputIntegerNumberValue)) {
-						this.$modal.msg("请输入米数")
+					} else if (this.isEmpty(this.positionKey)) {
+						this.$modal.msg("请选择施工位置")
+					} else if (this.isEmpty(this.inputNumberValue)) {
+						this.$modal.msg("请输入施工位置")
+					}
+					// else if (this.isEmpty(this.inputIntegerNumberValue)) {
+					// 	this.$modal.msg("请输入米数")
+					// }
+					else if (this.imgArr0.length <= 0) {
+						this.$modal.msg("请上传沟上部分照片")
 					} else if (this.imgArr1.length <= 0) {
 						this.$modal.msg("请上传开挖前照片")
 					} else if (this.imgArr2.length <= 0) {
@@ -359,18 +425,18 @@
 					} else if (this.imgArr3.length <= 0) {
 						this.$modal.msg("请上传回填照片")
 					} else {
-						if (this.isEmpty(this.inputDecimalNumberValue)) {
-							this.inputNumberValue = this.inputIntegerNumberValue;
-						} else {
-							this.inputNumberValue = this.inputIntegerNumberValue + "." + this.inputDecimalNumberValue;
-						}
+						// if (this.isEmpty(this.inputDecimalNumberValue)) {
+						// 	this.inputNumberValue = this.inputIntegerNumberValue;
+						// } else {
+						// 	this.inputNumberValue = this.inputIntegerNumberValue + "." + this.inputDecimalNumberValue;
+						// }
 
 						uni.showLoading()
 						let param = {
 							district: this.XZQValue.dictValue,
 							areaId: this.XQValue.id,
 							buildingId: this.LDValue.id,
-							unitId: this.isEmpty(this.DYValue.id)?'':this.DYValue.id,
+							unitId: this.isEmpty(this.DYValue.id) ? '' : this.DYValue.id,
 							enginType: this.objValue.enginType, //写死 上一页面传过来的 
 							enginClassification: this.objValue
 								.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
@@ -379,12 +445,14 @@
 								type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
 								zEngineeringInfoBo: {
 									constructTime: this.time, //施工时间
+									onTheDitch: this.imgArr0, //照片集合
 									beforeBottom: this.imgArr1, //照片集合
 									legBackfilling: this.imgArr2, //照片集合
 									inferiorSulcus: this.imgArr3, //照片集合
-
+									constructAddre: this.positionKey,
 									zEngineeringMaterialBo: [{
-										number: this.inputNumberValue //米数
+										number: this.inputNumberValue, //米数
+										remark: this.projectContent, //施工内容
 									}]
 								}
 							}
@@ -419,7 +487,12 @@
 					this.shareState = false;
 				},
 				showPhoto(index, type) {
-					if (type == 1) {
+					if (type == 0) {
+						uni.previewImage({
+							current: index,
+							urls: this.imgArr0,
+						})
+					} else if (type == 1) {
 						uni.previewImage({
 							current: index,
 							urls: this.imgArr1,
@@ -437,7 +510,17 @@
 					}
 				},
 				remove(index, type) {
-					if (type == 1) {
+					if (type == 0) {
+						uni.showModal({
+							title: '提示',
+							content: '是否删除该图片或视频?',
+							success: (res) => {
+								if (res.confirm) {
+									this.imgArr0.splice(index, 1)
+								}
+							}
+						})
+					} else if (type == 1) {
 						uni.showModal({
 							title: '提示',
 							content: '是否删除该图片或视频?',
@@ -508,11 +591,13 @@
 											_this.$modal.msg(data.msg)
 										} else {
 											if (_this.progress === 100) {
-												if (type == 1) {
+												if (type == 0) {
+													_this.imgArr0.push(data.data.url)
+												} else if (type == 1) {
 													_this.imgArr1.push(data.data.url)
 												} else if (type == 2) {
 													_this.imgArr2.push(data.data.url)
-												} else {
+												} else if (type == 3) {
 													_this.imgArr3.push(data.data.url)
 												}
 												_this.$modal.msg('上传成功!')
@@ -591,6 +676,11 @@
 							this.open = true;
 							this.selectList = this.FJList;
 						}
+					} else if (e == 'position') {
+						this.openDict = true;
+						getDicts("construct_addre").then(response => {
+							this.dictOptions = response.data;
+						});
 					}
 
 				},
@@ -606,6 +696,9 @@
 						getAreaList(item.dictValue).then(res => {
 							this.XQList = res.data;
 						})
+					} else if (this.type == 'position') {
+						this.positionKey = item.dictValue;
+						this.positionValue = item.dictLabel;
 					}
 
 				},
@@ -675,7 +768,7 @@
 					let param = {
 						areaId: this.XQValue.id, // 小区id
 						buildingId: this.LDValue.id, // 楼宇id
-						unitId: this.isEmpty(this.DYValue.id)?'':this.DYValue.id, // 单元id
+						unitId: this.isEmpty(this.DYValue.id) ? '' : this.DYValue.id, // 单元id
 						enginCycle: this.projectValue.dictValue, // 工程周期
 						enginType: this.objValue.enginType, //写死 上一页面传过来的  新建/旧改
 						enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空

+ 2 - 2
pages/login.vue

@@ -53,8 +53,8 @@
 				register: false,
 				globalConfig: getApp().globalData.config,
 				loginForm: {
-					username: "admin",
-					password: "admin123",
+					username: "010401001",
+					password: "123456",
 					code: "",
 					uuid: '',
 					type: 'app'

+ 69 - 47
pages/open_bolt/open_bolt.vue

@@ -86,17 +86,34 @@
 			</view>
 
 			<view class="background" style="margin-top: 20px;margin-bottom: 20px;">
+
+				<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+					<view class="uni-list-cell-left">
+						是否开栓
+					</view>
+					<view v-if="this.isEmpty(this.openBoltKey)" class="uni-list-cell-db" style="margin-top: 10;"
+						@click="showActionsheet()">
+						<span style="color: darkgray;">请选择是否开栓</span>
+						<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+					</view>
+					<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="showActionsheet()">
+						<span style="color: black;">{{openBoltValue}}</span>
+						<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+					</view>
+				</view>
+
 				<view class="container" style="border-bottom: 1px solid #f8f8f8;">
 					<view class="uni-common-mt" style="width: 100%;">
-						<text class="uni-title uni-common-pl">描述</text>
+						<text class="uni-title uni-common-pl">备注</text>
 						<view style="width: 100%;box-sizing: border-box;">
-							<textarea class="textarea" placeholder="请输入描述" maxlength="255"
+							<textarea class="textarea" placeholder="请输入备注" maxlength="255"
 								placeholder-style="padding: 10rpx;"
 								style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
 								auto-height v-model="remark"></textarea>
 						</view>
 					</view>
 				</view>
+
 				<view class="container" style="color: #b2b2b2;">*请上传照片</view>
 				<view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
 					<image :src="loadImgSrc('updateimg.png')" mode=""
@@ -126,7 +143,7 @@
 				<button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
 			</view>
 
-			<bottom-sheet ref="refShare" :data="historyList"></bottom-sheet>
+			<!-- <bottom-sheet ref="refShare" :data="historyList"></bottom-sheet> -->
 
 			<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
 				subtitleKey="id" v-model="name"></SelectPicker>
@@ -134,8 +151,8 @@
 			<SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
 				titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
 
-			<yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
-				:time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
+
+			<!-- <bottom-sheet ref="refShare" :data="historyList"></bottom-sheet> -->
 		</scroll-view>
 	</template>
 
@@ -151,7 +168,7 @@
 			getBuildingList,
 			getUnitList,
 			getHousesList,
-			addTearOldPipe,
+			openBolt,
 			getRoomProjectList,
 			getRoomProjectId,
 		} from '@/api/common';
@@ -170,19 +187,22 @@
 					headers: {
 						Authorization: "Bearer " + getToken()
 					},
+					projectValue: {
+						'dictValue': '0'
+					},
+					openBoltKey: '',
+					openBoltValue: '',
+					openBoltText: '',
 					type: '',
-					open: false,
 					reviewStatus: '', //是否可以点击
 					objValue: '', //上一页面传过来的值  新增接口用
+					open: false,
 					openDict: false,
 					selectList: [],
 					dictOptions: [],
 					imgArr: [],
 					XQValue: {},
 					XZQValue: {},
-					projectValue: {
-						'dictValue': '0'
-					},
 					remark: '',
 					LDValue: {},
 					DYValue: {},
@@ -194,28 +214,13 @@
 					progress: 0, //上传图片进度百分比
 					loading: false,
 					historyList: {}, //历史数据
-					inputNumberValue: '',
-					inputIntegerNumberValue: '',
-					inputDecimalNumberValue: '',
 				}
 			},
 			onLoad(options) {
-				if ('params' in options) {
-
-					this.objValue = JSON.parse(decodeURIComponent(options.params));
-
-					if (this.objValue.enginType == `old_renovation`) {
-						this.title = '旧改工程-开栓'
-
-					} else if (this.objValue.enginType == `new_built`) {
-						this.title = '新建工程-开栓'
-					}
-
-					uni.setNavigationBarTitle({
-						title: this.title
-					})
-				}
 
+				uni.setNavigationBarTitle({
+					title: '开栓'
+				})
 			},
 			methods: {
 				//判断是否选择
@@ -223,9 +228,7 @@
 					return (!str || 0 === str.length);
 				},
 				submit() {
-					if (this.isEmpty(this.projectValue.dictValue)) {
-						this.$modal.msg("请选择工程周期")
-					} else if (this.isEmpty(this.XZQValue.dictValue)) {
+					if (this.isEmpty(this.XZQValue.dictValue)) {
 						this.$modal.msg("请选择行政区")
 					} else if (this.isEmpty(this.XQValue.id)) {
 						this.$modal.msg("请选择小区")
@@ -235,6 +238,8 @@
 						this.$modal.msg("请选择单元")
 					} else if (this.isEmpty(this.FJValue.id)) {
 						this.$modal.msg("请选择房间")
+					} else if (this.isEmpty(this.openBoltKey)) {
+						this.$modal.msg("请选择是否开栓")
 					} else if (this.imgArr.length <= 0) {
 						this.$modal.msg("请上传照片")
 					} else {
@@ -244,22 +249,13 @@
 							areaId: this.XQValue.id,
 							buildingId: this.LDValue.id,
 							unitId: this.DYValue.id,
-							houseId:this.FJValue.id,
-							enginType: this.objValue.enginType, //写死 上一页面传过来的 
-							enginClassification: this.objValue
-								.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
-							enginCycle: this.projectValue.dictValue, //工程周期
-							zEngineeringNodeBo: {
-								type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
-								zEngineeringInfoBo: {
-									constructTime: this.time,
-									zEngiineeringPhotoBoList: this.imgArr, //照片集合
-								}
-							}
-
+							houseId: this.FJValue.id,
+							type: 1,
+							isQualified: this.openBoltKey,
+							remark: this.remark,
+							picIds: this.imgArr
 						}
-
-						addTearOldPipe(param).then(res => {
+						openBolt(param).then(res => {
 							uni.hideLoading()
 							if (res.code == '200') {
 								uni.showToast({
@@ -271,11 +267,37 @@
 								setTimeout(function() {
 									uni.navigateBack();
 								}, 1000)
-
+						
 							}
 						})
 						//提交接口执行逻辑
 					}
+
+				},
+				showActionsheet() {
+					//是否
+					getDicts("sys_yes_no").then(response => {
+
+						this.dictOptions = response.data;
+						let array = [];
+						this.dictOptions.forEach((item, index) => {
+							array.push(item.dictLabel)
+						});
+
+						uni.showActionSheet({
+							itemList: array,
+							success: (res) => {
+								// console.log('选择了第' + (res.tapIndex + 1) + '个选项');
+								// console.log(this.dictOptions[res.tapIndex].dictValue)
+								this.openBoltKey = this.dictOptions[res.tapIndex].dictValue;
+								this.openBoltValue = this.dictOptions[res.tapIndex].dictLabel;
+							},
+							fail: (err) => {
+								console.log('弹窗取消');
+							}
+						});
+
+					});
 				},
 				showPhoto(index) {
 					uni.previewImage({

+ 24 - 15
pages/work/index.vue

@@ -2,19 +2,22 @@
 	<view class="work-container">
 		<view style="work-banner">
 			<image :src="loadImgSrc('work-banner.png')" style="width: 100%;height:43vh"></image>
+			<view style="float: left;top: 100px;margin-left: 20px;">{{nickName}}:欢迎登录</view>
 		</view>
+
 		<view class="grid-body">
 			<view class="Grid">
 				<view class="Grid-Item" v-for="item in List" :key="item.id" @click="navClick(item.id)"
-					hover-class="click-hover" hover-start-time="50" hover-stay-time="50">
+					hover-class="click-hover" hover-start-time="50" hover-stay-time="50"
+					v-if="userRole.includes(item.title)">
 					<image class="icon-item" :src="loadImgSrc('mygc.png')" v-if="item.title == '民用工程'"></image>
 					<image class="icon-item" :src="loadImgSrc('gygc.png')" v-if="item.title == '工业工程'"></image>
 					<image class="icon-item" :src="loadImgSrc('szgc.png')" v-if="item.title == '市政工程'"></image>
 					<image class="icon-item" :src="loadImgSrc('wxzy.png')" v-if="item.title == '危险作业工程'"></image>
 					<image class="icon-item" :src="loadImgSrc('dggc.png')" v-if="item.title == '顶管工程'"></image>
 					<image class="icon-item" :src="loadImgSrc('jjgc.png')" v-if="item.title == '基建工程'"></image>
-					<view class="GStitle">{{ item.title }}
-					</view>
+					<image class="icon-item" :src="loadImgSrc('jjgc.png')" v-if="item.title == '开栓'"></image>
+					<view class="GStitle">{{ item.title }}</view>
 				</view>
 			</view>
 			<view v-if="showPopup" class="popup">
@@ -113,10 +116,16 @@ border-radius: 50%; margin-right: 20rpx;">旧</view>
 	import {
 		getDicts
 	} from "@/api/system/dict/data";
+	import {
+		getUserRole
+	} from '@/utils/auth';
+	import user from '@/store/modules/user'
 	export default {
 
 		data() {
 			return {
+				nickName: user.state.nickName,
+				userRole: getUserRole(),
 				showPopup: false,
 				shareState: false,
 				array: [],
@@ -159,7 +168,11 @@ border-radius: 50%; margin-right: 20rpx;">旧</view>
 						img: '/static/logo.png',
 						title: '基建工程'
 					},
-
+					{
+						id: 7,
+						img: '/static/logo.png',
+						title: '开栓'
+					},
 				]
 
 
@@ -171,18 +184,16 @@ border-radius: 50%; margin-right: 20rpx;">旧</view>
 					this.showMinYong()
 				} else if (newId == 2) {
 					this.showGongYe();
-
 				} else if (newId == 3) {
 					this.municipalProjectClick();
-
 				} else if (newId == 4) {
-
 					this.showDangerous();
 				} else if (newId == 5) {
 					this.showTopPipe();
 				} else if (newId == 6) {
 					this.showInfrastructureDialog();
-
+				} else if (newId == 7) {
+					this.showOpenBolt();
 				}
 
 			},
@@ -419,9 +430,7 @@ border-radius: 50%; margin-right: 20rpx;">旧</view>
 							.stringify(
 								obj))
 					})
-
 				}
-
 			},
 			showGongYe() {
 				this.projectType = 'GongYe';
@@ -429,7 +438,6 @@ border-radius: 50%; margin-right: 20rpx;">旧</view>
 				getDicts("engin_classification").then(response => {
 					this.typeList = response.data;
 
-
 				});
 				this.handleShowSheet();
 			},
@@ -437,8 +445,6 @@ border-radius: 50%; margin-right: 20rpx;">旧</view>
 				this.projectType = 'DingGuan';
 				getDicts("pipe_jack").then(response => {
 					this.typeList = response.data;
-
-
 				});
 				this.handleShowSheet();
 			},
@@ -447,8 +453,6 @@ border-radius: 50%; margin-right: 20rpx;">旧</view>
 				//基建工程
 				getDicts("engineering_infrastructure").then(response => {
 					this.typeList = response.data;
-
-
 				});
 				this.handleShowSheet();
 			},
@@ -457,6 +461,11 @@ border-radius: 50%; margin-right: 20rpx;">旧</view>
 					url: '/pages/dangerous/dangerous'
 				})
 			},
+			showOpenBolt() {
+				uni.navigateTo({
+					url: '/pages/open_bolt/open_bolt'
+				})
+			}
 		}
 	}
 </script>

+ 12 - 3
store/modules/user.js

@@ -2,7 +2,7 @@ import config from '@/config'
 import storage from '@/utils/storage'
 import constant from '@/utils/constant'
 import { login, logout, getInfo } from '@/api/login'
-import { getToken, setToken, removeToken } from '@/utils/auth'
+import { getToken, setToken, removeToken, setUserRole,removeUserRole} from '@/utils/auth'
 
 const baseUrl = config.baseUrl
 
@@ -12,7 +12,8 @@ const user = {
     name: storage.get(constant.name),
     avatar: storage.get(constant.avatar),
     roles: storage.get(constant.roles),
-    permissions: storage.get(constant.permissions)
+    permissions: storage.get(constant.permissions),
+	nickName: storage.get(constant.nickName),
   },
 
   mutations: {
@@ -34,7 +35,11 @@ const user = {
     SET_PERMISSIONS: (state, permissions) => {
       state.permissions = permissions
       storage.set(constant.permissions, permissions)
-    }
+    },
+	SET_NICKNAME: (state, nickName) => {
+	  state.nickName = nickName
+	  storage.set(constant.nickName, nickName)
+	}
   },
 
   actions: {
@@ -63,6 +68,8 @@ const user = {
           const user = res.data.user
           const avatar = baseUrl + user.avatar
           const username = (user == null || user.userName == "" || user.userName == null) ? "" : user.userName
+		  const nickName = (user == null || user.nickName == "" || user.nickName == null) ? "" : user.nickName
+		  setUserRole(user.roles != null ? user.roles[0].enginTypeList.split(","):[])
           if (res.data.roles && res.data.roles.length > 0) {
             commit('SET_ROLES', res.data.roles)
             commit('SET_PERMISSIONS', res.data.permissions)
@@ -70,6 +77,7 @@ const user = {
             commit('SET_ROLES', ['ROLE_DEFAULT'])
           }
           commit('SET_NAME', username)
+		  commit('SET_NICKNAME', nickName)
           commit('SET_AVATAR', avatar)
           resolve(res)
         }).catch(error => {
@@ -86,6 +94,7 @@ const user = {
           commit('SET_ROLES', [])
           commit('SET_PERMISSIONS', [])
           removeToken()
+		  removeUserRole()
           storage.clean()
           resolve()
         }).catch(error => {

+ 13 - 0
utils/auth.js

@@ -1,4 +1,5 @@
 const TokenKey = 'App-Token'
+const UserRole = 'App-UserRole'
 
 export function getToken() {
   return uni.getStorageSync(TokenKey)
@@ -11,3 +12,15 @@ export function setToken(token) {
 export function removeToken() {
   return uni.removeStorageSync(TokenKey)
 }
+
+export function getUserRole() {
+  return uni.getStorageSync(UserRole)
+}
+
+export function setUserRole(role) {
+  return uni.setStorageSync(UserRole,role)
+}
+
+export function removeUserRole() {
+  return uni.removeStorageSync(UserRole)
+}

+ 2 - 1
utils/constant.js

@@ -2,7 +2,8 @@ const constant = {
    avatar: 'vuex_avatar',
    name: 'vuex_name',
    roles: 'vuex_roles',
-   permissions: 'vuex_permissions'
+   permissions: 'vuex_permissions',
+   nickName: 'vuex_nickName'
  }
 
  export default constant