wgl 4 лет назад
Родитель
Сommit
35d966bbd6

+ 1 - 1
config/project.js

@@ -1 +1 @@
-exports.name = 'home'
+exports.name = 'business'

+ 11 - 0
src/projects/business/router/master.js

@@ -1030,6 +1030,17 @@ const routesMaster = [
 							title: '注册审核详情',
 						}
 					},
+					//注册审核选择设备
+					{
+						path: 'registerSelectDevice',
+						name: 'MasterCompanyRegisterSelectDevice',
+						component: () => import('../views/Master/Company/RegisterSelectDevice.vue'),
+						meta: {
+							requireAuth: false,
+							role: [],
+							title: '注册审核选择设备',
+						}
+					},
 				]
 			},
 

+ 9 - 11
src/projects/business/views/Master/Company/RegisterExamine.vue

@@ -86,6 +86,7 @@
 		mapGetters,
 		mapMutations
 	} from 'vuex'
+	import * as types from '$project/store/mutation-types'
 	export default {
 		name: 'MasterCompanyRegisterExamine',
 		components: {
@@ -111,7 +112,8 @@
 				subForm: {
 					ids: '',
 					content: '',
-					status: ''
+					status: '',
+					deviceIds: ''
 				},
 				firstRecordsTotal: 0,
 
@@ -205,16 +207,9 @@
 					var btnArray = ['否', '是'];
 					mui.confirm('是否' + _this.subForm.content + '所勾选的注册申请?', '提示', btnArray, function(e) {
 						if (e.index == 1) {
-							_this.isLoading = true;
-							API_Company.doApply(_this.subForm).then(response => {
-								_this.isLoading = false;
-								
-								mui.toast('处理成功');
-								_this.listForm.pageIndex = 1;
-								_this.getList();
-							}).catch(error => {
-								_this.isLoading = false;
-								mui.toast(error);
+							_this.set_register_examine_form(_this.subForm);
+							_this.$router.push({
+								name: 'MasterCompanyRegisterSelectDevice'
 							})
 						}
 					})
@@ -223,6 +218,9 @@
 			asynCallBack() {
 
 			},
+			...mapMutations({
+				set_register_examine_form: types.SET_REGISTER_EXAMINE_FORM,
+			})
 		},
 		mounted() {
 			this.getList();

+ 13 - 12
src/projects/business/views/Master/Company/RegisterInfo.vue

@@ -82,6 +82,7 @@
 		mapGetters,
 		mapMutations
 	} from 'vuex'
+	import * as types from '$project/store/mutation-types'
 	export default {
 		name: 'MasterCompanyRegisterInfo',
 		components: {
@@ -99,7 +100,8 @@
 				subForm: {
 					ids: '',
 					content: '',
-					status: ''
+					status: '',
+					deviceIds: ''
 				},
 				detail: {},
 
@@ -152,16 +154,12 @@
 					var btnArray = ['否', '是'];
 					mui.confirm('是否' + _this.subForm.content + '所勾选的注册申请?', '提示', btnArray, function(e) {
 						if (e.index == 1) {
-							_this.isLoading = true;
-							API_Company.doApply(_this.subForm).then(response => {
-								_this.isLoading = false;
-
-								mui.toast('处理成功');
-								_this.getDetail();
-							}).catch(error => {
-								_this.isLoading = false;
-								mui.toast(error);
-							})
+							if (e.index == 1) {
+								_this.set_register_examine_form(_this.subForm);
+								_this.$router.push({
+									name: 'MasterCompanyRegisterSelectDevice'
+								})
+							}
 						}
 					})
 				}
@@ -169,6 +167,9 @@
 			asynCallBack() {
 
 			},
+			...mapMutations({
+				set_register_examine_form: types.SET_REGISTER_EXAMINE_FORM,
+			})
 		},
 		mounted() {
 			//获取详情
@@ -196,7 +197,7 @@
 					console.log(newValue)
 				}
 			},
-			companyNameLabel:{
+			companyNameLabel: {
 				// getter
 				get: function() {
 					if (this.detail.sceneId == '1') {

+ 134 - 0
src/projects/business/views/Master/Company/RegisterSelectDevice.vue

@@ -0,0 +1,134 @@
+<template>
+	<div>
+		<common @asynCallBack="asynCallBack"></common>
+		<top-header :pageTitle="pageTitle"></top-header>
+
+		<div class="mui-content">
+			<div class="mui-content-padded">
+				<h5>请选择设备</h5>
+				<form class="mui-input-group">
+					<div v-for="(item,index) in recordList" class="mui-input-row mui-checkbox">
+						<label v-text="item.aliasName"></label>
+						<input name="id" :value="item.id" type="checkbox" v-model="checkVal">
+					</div>
+				</form>
+			</div>
+		</div>
+		<div class="fyy-footer">
+			<div class="bindfyy-btn"><button type="submit" class="mui-btn mui-btn-primary" @click="submit">提交</button></div>
+		</div>
+
+		<div v-show="successVisible" class="mui-backdrop mui-active" style=""></div>
+		<div v-show="successVisible" class="fyy-popup" @click="successTo">
+			<span class="mui-icon iconfont icon-dui"></span>
+			<p>提交成功</p>
+		</div>
+	</div>
+</template>
+
+<script>
+	import * as API_Company from '@/apis/Master/company'
+	import Common from '$project/components/Common.vue'
+	import Loading from '$project/components/Loading.vue'
+	import TopHeader from '$project/components/TopHeader.vue'
+	import {
+		mapGetters,
+		mapMutations
+	} from 'vuex'
+	export default {
+		name: 'MasterCompanyRegisterSelectDevice',
+		components: {
+			Common,
+			Loading,
+			TopHeader
+		},
+		data() {
+			return {
+				pageTitle: '注册审核选择设备',
+
+				isLoading: false,
+
+				subForm: {
+					ids: '',
+					content: '',
+					status: '',
+					deviceIds: ''
+				},
+
+				checkVal: [],
+				recordList: [],
+				successVisible: false,
+			}
+		},
+		created() {
+			if (this.register_examine_form) {
+				this.subForm = this.register_examine_form;
+			}
+			if (!this.subForm.ids || !this.subForm.status) {
+				this.$router.go(-1);
+			}
+		},
+		methods: {
+			//获取设备列表
+			getList() {
+				this.isLoading = true;
+				API_Company.getDeviceList().then(response => {
+					this.isLoading = false;
+					this.recordList = response;
+				}).catch(error => {
+					this.isLoading = false;
+					mui.toast(error);
+				})
+			},
+			//表单检测
+			checkForm() {
+				if (!this.subForm.bindDevices) {
+					mui.toast('请选择设备');
+					return false;
+				} else {
+					return true;
+				}
+			},
+			//提交
+			submit() {
+				this.subForm.bindDevices = this.checkVal.join(',');
+
+				if (this.checkForm()) {
+					this.isLoading = true;
+					API_Company.doApply(this.subForm).then(response => {
+						this.isLoading = false;
+						this.successVisible = true;
+					}).catch(error => {
+						this.isLoading = false;
+						mui.toast(error);
+					})
+				}
+			},
+			//成功后的点击
+			successTo() {
+				this.$router.go(-1);
+			},
+			asynCallBack() {
+
+			},
+		},
+		mounted() {
+			//获取设备列表
+			this.getList();
+		},
+		destroyed() {},
+		computed: {
+			...mapGetters({
+				openId: 'wx_openid',
+				token: 'token',
+				register_examine_form: 'register_examine_form'
+			})
+		}
+	}
+</script>
+
+<style scoped src="$project/assets/css/sczpfyy.css"></style>
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
+<style src="$project/assets/css/iconfont.css"></style>
+<style scoped>
+</style>

+ 2 - 0
src/store/getters.js

@@ -25,3 +25,5 @@ export const persion_home_model = state => state.persion_home_model
 export const old_relation_form_data = state => state.old_relation_form_data
 
 export const wx_pay_back_url = state => state.wx_pay_back_url
+
+export const register_examine_form = state => state.register_examine_form

+ 1 - 0
src/store/mutation-types.js

@@ -13,3 +13,4 @@ export const SET_COMMON_MENU_LIST = 'SET_COMMON_MENU_LIST'
 export const SET_PERSION_HOME_MODEL = 'SET_PERSION_HOME_MODEL'
 export const SET_OLD_RELATION_FORM_DATA = 'SET_OLD_RELATION_FORM_DATA'
 export const SET_WX_PAY_BACK_URL = 'SET_WX_PAY_BACK_URL'
+export const SET_REGISTER_EXAMINE_FORM = 'SET_REGISTER_EXAMINE_FORM'

+ 4 - 0
src/store/mutations.js

@@ -92,6 +92,10 @@ const mutations = {
 		setWxPayBackUrl(storage_prefix, data)
 		state.wx_pay_back_url = data
 	},
+	
+	[types.SET_REGISTER_EXAMINE_FORM](state, data) {
+		state.register_examine_form = data
+	},
 }
 
 export default mutations

+ 2 - 1
src/store/state.js

@@ -32,7 +32,8 @@ const state = {
 	app_version: getAppVersion(storage_prefix),
 	persion_home_model: getPersionHomeModel(storage_prefix),
 	old_relation_form_data: getOldRelationFormData(storage_prefix),
-	wx_pay_back_url: getWxPayBackUrl(storage_prefix)
+	wx_pay_back_url: getWxPayBackUrl(storage_prefix),
+	register_examine_form: '',
 }
 
 export default state