Pārlūkot izejas kodu

完成待测试

soft5566 2 gadi atpakaļ
vecāks
revīzija
6c24dd980f

+ 4 - 0
src/components/pl-upload/index.vue

@@ -88,17 +88,20 @@
 							url: this.linkUrl
 						})
 						this.hideUpload = this.fileList.length >= this.limitCount
+						this.refreshUploadFile()
 					} else {
 						getFileList(this.linkId).then((res) => {
 							const tempData = res.data
 							if (typeof tempData !== 'undefined' && tempData !== '') {
 								for (var i = 0; i < tempData.length; i++) {
 									this.fileList.push(tempData[i])
+									this.uploadFileList.push(tempData[i])
 								}
 							} else {
 								this.fileList = []
 							}
 							this.hideUpload = this.fileList.length >= this.limitCount
+							this.refreshUploadFile()
 						}).catch((err) => {
 							this.$message.error(err.message)
 						})
@@ -132,6 +135,7 @@
 				// 使用filter()方法从数组中删除元素
 				const index = this.fileList.findIndex(item => item.url === file.url)
 				this.fileList.splice(index, 1)
+				this.uploadFileList.splice(index, 1)
 				this.refreshUploadFile()
 				setTimeout(() => {
 					this.hideUpload = this.fileList.length >= this.limitCount

+ 1 - 1
src/layout/components/Sidebar/index.vue

@@ -62,7 +62,7 @@
 						}
 					}
 				}
-
+				// console.log(returnRoutes);
 				// 返回过滤的路由
 				return returnRoutes;
 			},

+ 1 - 1
src/router/index.js

@@ -47,7 +47,7 @@ export const constantRoutes = [{
 		component: Layout,
 		redirect: '/data',
 		children: [{
-			path: 'data',
+			path: '',
 			name: 'Data',
 			component: () => import('@/views/data/index'),
 			meta: {

+ 1 - 1
src/views/login/index.vue

@@ -112,7 +112,7 @@
 							.then((res) => {
 								// console.log(res);
 								if (res.code == 200) {
-									if (res.data.level === 2) {
+									if (res.data.level == 2) {
 										this.$router.push({
 											path: this.redirect || '/'
 										});

+ 346 - 151
src/views/residentialhostelMgr/index.vue

@@ -46,9 +46,6 @@
 										<el-form-item label="权限">
 											<span>{{ props.row.level == 1 ? '管理员' : '超级管理员' }}</span>
 										</el-form-item>
-										<el-form-item label="备注">
-											<span>{{ props.row.remark }}</span>
-										</el-form-item>
 										<el-form-item label="创建时间">
 											<span>{{ props.row.createDate }}</span>
 										</el-form-item>
@@ -398,10 +395,9 @@
 			:close-on-press-escape="false" @close="add_house_dialog_close">
 			<el-row>
 				<el-col :span="24">
-					<!-- <el-form :model="add_dictionary_data" ref="addAccountForm" :rules="addHostelFormRules"> -->
-					<el-form :model="add_dictionary_data" ref="addAccountForm">
+					<el-form :model="add_dictionary_data" ref="addHostelClassForm" :rules="addHostelClassFormRules">
 						<el-form-item label="民宿类型:" :label-width="formLabelWidth" :required="true" prop="name">
-							<el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入民宿类型">
+							<el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="10" placeholder="请输入民宿类型">
 							</el-input>
 						</el-form-item>
 					</el-form>
@@ -412,82 +408,39 @@
 				<el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(1)">确 认</el-button>
 			</div>
 		</el-dialog>
-		<!-- 修改民宿类型配置字典 不带图标-->
-		<el-dialog title="修改民宿类型" custom-class="add-ms-class" :visible.sync="dialogModifyDictionaryFormVisible" :close-on-click-modal="false"
-			:close-on-press-escape="false" @close="add_house_dialog_close">
-			<el-row>
-				<el-col :span="24">
-					<!-- <el-form :model="modify_dictionary_data" ref="addAccountForm" :rules="addHostelFormRules"> -->
-					<el-form :model="modify_dictionary_data" ref="addAccountForm">
-						<el-form-item label="民宿类型:" :label-width="formLabelWidth" :required="true" prop="name">
-							<el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入民宿类型">
-							</el-input>
-						</el-form-item>
-					</el-form>
-				</el-col>
-			</el-row>
-			<div slot="footer" class="dialog-footer">
-				<el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryFormVisible = false">取 消</el-button>
-				<el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(1)">确 认</el-button>
-			</div>
-		</el-dialog>
 		<!-- 添加民宿服务配置字典 带图标-->
 		<el-dialog title="添加民宿服务" custom-class="add-ms-service" :visible.sync="dialogAddDictionaryServiceFormVisible" :close-on-click-modal="false"
 			:close-on-press-escape="false" @close="add_house_dialog_close">
-			<el-row>
-				<el-col :span="24">
-					<!-- <el-form :model="add_dictionary_data" ref="addAccountForm" :rules="addHostelFormRules"> -->
-					<el-form :model="add_dictionary_data" ref="addAccountForm">
+			<el-form :model="add_dictionary_data" ref="addHostelServiceForm" :rules="addHostelServiceFormRules">
+				<el-row>
+					<el-col :span="24">
 						<el-form-item label="民宿服务:" :label-width="formLabelWidth" :required="true" prop="name">
 							<el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入民宿服务">
 							</el-input>
 						</el-form-item>
-					</el-form>
-				</el-col>
-			</el-row>
-			<el-row>
-				<el-col :span="24">
-					<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
-					<pl-upload v-model="add_dictionary_data.fileUrl" :times="times" :linkUrl="add_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
-				</el-col>
-			</el-row>
+					</el-col>
+				</el-row>
+				<el-row>
+					<el-col :span="24">
+						<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
+						<el-form-item label="" :required="true" prop="fileUrl">
+							<pl-upload v-model="add_dictionary_data.fileUrl" :times="times" :linkUrl="add_dictionary_data.url" :limitCount="1"
+								:type="2"></pl-upload>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
 			<div slot="footer" class="dialog-footer">
 				<el-button class="add-info-cancel-btn" @click="dialogAddDictionaryServiceFormVisible = false">取 消</el-button>
 				<el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(2)">确 认</el-button>
 			</div>
 		</el-dialog>
-		<!-- 修改民宿服务配置字典 带图标-->
-		<el-dialog title="修改民宿服务" custom-class="add-ms-service" :visible.sync="dialogModifyDictionaryServiceFormVisible" :close-on-click-modal="false"
-			:close-on-press-escape="false" @close="add_house_dialog_close">
-			<el-row>
-				<el-col :span="24">
-					<!-- <el-form :model="modify_dictionary_data" ref="addAccountForm" :rules="addHostelFormRules"> -->
-					<el-form :model="modify_dictionary_data" ref="addAccountForm">
-						<el-form-item label="民宿服务:" :label-width="formLabelWidth" :required="true" prop="name">
-							<el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入民宿服务">
-							</el-input>
-						</el-form-item>
-					</el-form>
-				</el-col>
-			</el-row>
-			<el-row>
-				<el-col :span="24">
-					<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
-					<pl-upload v-model="modify_dictionary_data.fileUrl" :linkUrl="modify_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
-				</el-col>
-			</el-row>
-			<div slot="footer" class="dialog-footer">
-				<el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryServiceFormVisible = false">取 消</el-button>
-				<el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(2)">确 认</el-button>
-			</div>
-		</el-dialog>
 		<!-- 添加房型名称配置字典 不带图标-->
 		<el-dialog title="添加房型名称" custom-class="add-ms-class" :visible.sync="dialogAddDictionaryNameFormVisible" :close-on-click-modal="false"
 			:close-on-press-escape="false" @close="add_house_dialog_close">
 			<el-row>
 				<el-col :span="24">
-					<!-- <el-form :model="add_dictionary_data" ref="addAccountForm" :rules="addHostelFormRules"> -->
-					<el-form :model="add_dictionary_data" ref="addAccountForm">
+					<el-form :model="add_dictionary_data" ref="addHostelNameForm" :rules="addHostelNameFormRules">
 						<el-form-item label="房型名称:" :label-width="formLabelWidth" :required="true" prop="name">
 							<el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入房型名称">
 							</el-input>
@@ -500,70 +453,116 @@
 				<el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(3)">确 认</el-button>
 			</div>
 		</el-dialog>
-		<!-- 修改房型名称配置字典 不带图标-->
-		<el-dialog title="修改房型名称" custom-class="add-ms-class" :visible.sync="dialogModifyDictionaryNameFormVisible" :close-on-click-modal="false"
+		<!-- 添加房型服务配置字典 带图标-->
+		<el-dialog title="添加房型服务" custom-class="add-ms-service" :visible.sync="dialogAddDictionaryHouseServiceFormVisible" :close-on-click-modal="false"
+			:close-on-press-escape="false" @close="add_house_dialog_close">
+			<el-form :model="add_dictionary_data" ref="addHouseTypeServiceForm" :rules="addHouseTypeServiceFormRules">
+				<el-row>
+					<el-col :span="24">
+						<el-form-item label="房型服务:" :label-width="formLabelWidth" :required="true" prop="name">
+							<el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="8" placeholder="请输入房型服务">
+							</el-input>
+						</el-form-item>
+					</el-col>
+				</el-row>
+				<el-row>
+					<el-col :span="24">
+						<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
+						<el-form-item label="" :required="true" prop="fileUrl">
+							<pl-upload v-model="add_dictionary_data.fileUrl" :times="times" :linkUrl="add_dictionary_data.url" :limitCount="1"
+								:type="2"></pl-upload>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button class="add-info-cancel-btn" @click="dialogAddDictionaryHouseServiceFormVisible = false">取 消</el-button>
+				<el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(4)">确 认</el-button>
+			</div>
+		</el-dialog>
+		<!-- 修改民宿类型配置字典 不带图标-->
+		<el-dialog title="修改民宿类型" custom-class="add-ms-class" :visible.sync="dialogModifyDictionaryFormVisible" :close-on-click-modal="false"
 			:close-on-press-escape="false" @close="add_house_dialog_close">
 			<el-row>
 				<el-col :span="24">
-					<!-- <el-form :model="modify_dictionary_data" ref="addAccountForm" :rules="addHostelFormRules"> -->
-					<el-form :model="modify_dictionary_data" ref="addAccountForm">
-						<el-form-item label="房型名称:" :label-width="formLabelWidth" :required="true" prop="name">
-							<el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入房型名称">
+					<el-form :model="modify_dictionary_data" ref="modifyHostelClassForm" :rules="modifyHostelClassFormRules">
+						<el-form-item label="民宿类型:" :label-width="formLabelWidth" :required="true" prop="name">
+							<el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="10" placeholder="请输入民宿类型">
 							</el-input>
 						</el-form-item>
 					</el-form>
 				</el-col>
 			</el-row>
 			<div slot="footer" class="dialog-footer">
-				<el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryNameFormVisible = false">取 消</el-button>
-				<el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(3)">确 认</el-button>
+				<el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryFormVisible = false">取 消</el-button>
+				<el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(1)">确 认</el-button>
 			</div>
 		</el-dialog>
-		<!-- 添加房型服务配置字典 带图标-->
-		<el-dialog title="添加房型服务" custom-class="add-ms-service" :visible.sync="dialogAddDictionaryHouseServiceFormVisible" :close-on-click-modal="false"
+		<!-- 修改民宿服务配置字典 带图标-->
+		<el-dialog title="修改民宿服务" custom-class="add-ms-service" :visible.sync="dialogModifyDictionaryServiceFormVisible" :close-on-click-modal="false"
+			:close-on-press-escape="false" @close="add_house_dialog_close">
+			<el-form :model="modify_dictionary_data" ref="modifyHostelServiceForm" :rules="modifyHostelServiceFormRules">
+				<el-row>
+					<el-col :span="24">
+						<el-form-item label="民宿服务:" :label-width="formLabelWidth" :required="true" prop="name">
+							<el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入民宿服务">
+							</el-input>
+						</el-form-item>
+					</el-col>
+				</el-row>
+				<el-row>
+					<el-col :span="24">
+						<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
+						<el-form-item label="" :required="true" prop="fileUrl">
+							<pl-upload v-model="modify_dictionary_data.fileUrl" :linkUrl="modify_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryServiceFormVisible = false">取 消</el-button>
+				<el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(2)">确 认</el-button>
+			</div>
+		</el-dialog>
+		<!-- 修改房型名称配置字典 不带图标-->
+		<el-dialog title="修改房型名称" custom-class="add-ms-class" :visible.sync="dialogModifyDictionaryNameFormVisible" :close-on-click-modal="false"
 			:close-on-press-escape="false" @close="add_house_dialog_close">
 			<el-row>
 				<el-col :span="24">
-					<!-- <el-form :model="add_dictionary_data" ref="addAccountForm" :rules="addHostelFormRules"> -->
-					<el-form :model="add_dictionary_data" ref="addAccountForm">
-						<el-form-item label="房型服务:" :label-width="formLabelWidth" :required="true" prop="name">
-							<el-input v-model="add_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入房型服务">
+					<el-form :model="modify_dictionary_data" ref="modifyHostelNameForm" :rules="modifyHostelNameFormRules">
+						<el-form-item label="房型名称:" :label-width="formLabelWidth" :required="true" prop="name">
+							<el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入房型名称">
 							</el-input>
 						</el-form-item>
 					</el-form>
 				</el-col>
 			</el-row>
-			<el-row>
-				<el-col :span="24">
-					<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
-					<pl-upload v-model="add_dictionary_data.fileUrl" :times="times" :linkUrl="add_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
-				</el-col>
-			</el-row>
 			<div slot="footer" class="dialog-footer">
-				<el-button class="add-info-cancel-btn" @click="dialogAddDictionaryHouseServiceFormVisible = false">取 消</el-button>
-				<el-button class="add-info-confirm-btn" @click="add_house_class_dialog_handler(4)">确 认</el-button>
+				<el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryNameFormVisible = false">取 消</el-button>
+				<el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(3)">确 认</el-button>
 			</div>
 		</el-dialog>
 		<!-- 修改房型服务配置字典 带图标-->
 		<el-dialog title="修改房型服务" custom-class="add-ms-service" :visible.sync="dialogModifyDictionaryHouseServiceFormVisible" :close-on-click-modal="false"
 			:close-on-press-escape="false" @close="add_house_dialog_close">
-			<el-row>
-				<el-col :span="24">
-					<!-- <el-form :model="modify_dictionary_data" ref="addAccountForm" :rules="addHostelFormRules"> -->
-					<el-form :model="modify_dictionary_data" ref="addAccountForm">
+			<el-form :model="modify_dictionary_data" ref="modifyHouseTypeServiceForm" :rules="modifyHouseTypeServiceFormRules">
+				<el-row>
+					<el-col :span="24">
 						<el-form-item label="房型服务:" :label-width="formLabelWidth" :required="true" prop="name">
-							<el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="16" placeholder="请输入房型服务">
+							<el-input v-model="modify_dictionary_data.name" autocomplete="off" maxlength="8" placeholder="请输入房型服务">
 							</el-input>
 						</el-form-item>
-					</el-form>
-				</el-col>
-			</el-row>
-			<el-row>
-				<el-col :span="24">
-					<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
-					<pl-upload v-model="modify_dictionary_data.fileUrl" :linkUrl="modify_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
-				</el-col>
-			</el-row>
+					</el-col>
+				</el-row>
+				<el-row>
+					<el-col :span="24">
+						<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">图标</div>
+						<el-form-item label="" :required="true" prop="fileUrl">
+							<pl-upload v-model="modify_dictionary_data.fileUrl" :linkUrl="modify_dictionary_data.url" :limitCount="1" :type="2"></pl-upload>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
 			<div slot="footer" class="dialog-footer">
 				<el-button class="add-info-cancel-btn" @click="dialogModifyDictionaryHouseServiceFormVisible = false">取 消</el-button>
 				<el-button class="add-info-confirm-btn" @click="modify_house_class_dialog_handler(4)">确 认</el-button>
@@ -672,9 +671,9 @@
 					return callback(new Error('请输入银行卡号'));
 				}
 				setTimeout(() => {
-					var reg = /^([1-9]{1})(\d{15}|\d{18})$/
+					var reg = /^([1-9]{1})(\d{15,18})$/
 					if (!reg.test(value)) {
-						callback(new Error('银行卡号长度16-19位'));
+						callback(new Error('银行卡号长度16-19位数字'));
 					} else {
 						callback();
 					}
@@ -707,11 +706,69 @@
 				}, 100);
 			};
 			var checkFileUrl = (rule, value, callback) => {
-				if (value == '[]') {
+				if (value == '[]' || value == '') {
 					return callback(new Error('请上传营业执照'));
 				}
 				callback();
 			};
+			var checkHostelCalssName = (rule, value, callback) => {
+				if (!value) {
+					return callback(new Error('请输入民宿类型'));
+				}
+				setTimeout(() => {
+					var reg = /^[\u4e00-\u9fa5]{2,10}$/
+					if (!reg.test(value)) {
+						callback(new Error('只能包含2到10个汉字'));
+					} else {
+						callback();
+					}
+				}, 100);
+			};
+			var checkHostelServiceName = (rule, value, callback) => {
+				if (!value) {
+					return callback(new Error('请输入民宿服务'));
+				}
+				setTimeout(() => {
+					var reg = /^[\u4e00-\u9fa5]{2,10}$/
+					if (!reg.test(value)) {
+						callback(new Error('只能包含2到10个汉字'));
+					} else {
+						callback();
+					}
+				}, 100);
+			};
+			var checkHostelName = (rule, value, callback) => {
+				if (!value) {
+					return callback(new Error('请输入房型名称'));
+				}
+				setTimeout(() => {
+					var reg = /^[\u4e00-\u9fa5]{2,10}$/
+					if (!reg.test(value)) {
+						callback(new Error('只能包含2到10个汉字'));
+					} else {
+						callback();
+					}
+				}, 100);
+			};
+			var checkHouseTypeService = (rule, value, callback) => {
+				if (!value) {
+					return callback(new Error('请输入房型服务'));
+				}
+				setTimeout(() => {
+					var reg = /^[\u4e00-\u9fa5]{2,8}$/
+					if (!reg.test(value)) {
+						callback(new Error('只能包含2到8个汉字'));
+					} else {
+						callback();
+					}
+				}, 100);
+			};
+			var checkIcon = (rule, value, callback) => {
+				if (value == '[]' || value == '' || value == undefined) {
+					return callback(new Error('请上传图标'));
+				}
+				callback();
+			};
 			return {
 				currentUserLevel: this.$store.state.user.level, // 当前用户的权限
 				activeName: 'first', // 默认激活那个选项卡
@@ -855,9 +912,9 @@
 					bankName: [{
 						validator: checkBankName
 					}],
-					// fileUrl: [{
-					// 	validator: checkFileUrl
-					// }]
+					fileUrl: [{
+						validator: checkFileUrl
+					}]
 				},
 				// 修改字典数据
 				modify_dictionary_data: {
@@ -878,7 +935,59 @@
 				del_dictionary_data: {
 					id: ''
 				},
-				times: ''
+				times: '',
+				addHostelClassFormRules: {
+					name: [{
+						validator: checkHostelCalssName
+					}]
+				},
+				addHostelServiceFormRules: {
+					name: [{
+						validator: checkHostelServiceName
+					}],
+					fileUrl: [{
+						validator: checkIcon
+					}]
+				},
+				addHostelNameFormRules: {
+					name: [{
+						validator: checkHostelName
+					}]
+				},
+				addHouseTypeServiceFormRules: {
+					name: [{
+						validator: checkHouseTypeService
+					}],
+					fileUrl: [{
+						validator: checkIcon
+					}]
+				},
+				modifyHostelClassFormRules: {
+					name: [{
+						validator: checkHostelCalssName
+					}]
+				},
+				modifyHostelServiceFormRules: {
+					name: [{
+						validator: checkHostelServiceName
+					}],
+					fileUrl: [{
+						validator: checkIcon
+					}]
+				},
+				modifyHostelNameFormRules: {
+					name: [{
+						validator: checkHostelName
+					}]
+				},
+				modifyHouseTypeServiceFormRules: {
+					name: [{
+						validator: checkHouseTypeService
+					}],
+					fileUrl: [{
+						validator: checkIcon
+					}]
+				}
 			}
 		},
 		created() {
@@ -1068,6 +1177,8 @@
 			},
 			// 添加民宿字典,先显示对话框
 			add_dictionary_dialog(i) {
+				this.clear_add_dictionary_data()
+
 				if (i === 1) {
 					this.dialogAddDictionaryFormVisible = true
 				} else if (i === 2) {
@@ -1075,7 +1186,7 @@
 				} else if (i === 3) {
 					this.dialogAddDictionaryNameFormVisible = true
 				} else if (i === 4) {
-					this.dialogAddDictionaryServiceFormVisible = true
+					this.dialogAddDictionaryHouseServiceFormVisible = true
 				}
 				this.times = new Date().getTime().toString()
 
@@ -1107,33 +1218,78 @@
 			 * @param {Object} row
 			 */
 			modify_house_class_dialog_handler(i) {
+				var that = this;
+				if (i === 1) {
+					that.$refs["modifyHostelClassForm"].validate(validate => {
+						if (validate) {
+							this.modifyHomestayDictionary_shared(i)
+						} else {
+							that.$message.error('请按规范填写');
+							return false;
+						}
+					})
+				} else if (i === 2) {
+					that.$refs["modifyHostelServiceForm"].validate(validate => {
+						if (validate) {
+							this.modifyHomestayDictionary_shared(i)
+						} else {
+							that.$message.error('请按规范填写');
+							return false;
+						}
+					})
+				} else if (i === 3) {
+					that.$refs["modifyHostelNameForm"].validate(validate => {
+						if (validate) {
+							this.modifyHomestayDictionary_shared(i)
+						} else {
+							that.$message.error('请按规范填写');
+							return false;
+						}
+					})
+				} else if (i === 4) {
+					that.$refs["modifyHouseTypeServiceForm"].validate(validate => {
+						if (validate) {
+							this.modifyHomestayDictionary_shared(i)
+						} else {
+							that.$message.error('请按规范填写');
+							return false;
+						}
+					})
+				}
+			},
+			/**
+			 * 修改民宿字典共享函数
+			 * @param {Object} i
+			 */
+			modifyHomestayDictionary_shared(i) {
+				var that = this;
 				modifyHomestayDictionary(this.modify_dictionary_data).then((res) => {
 					// console.log(res);
 					if (typeof res.code == 'undefined' || res.code == '') {
-						this.$message.error('返回数据格式问题,code未获取到!');
+						that.$message.error('返回数据格式问题,code未获取到!');
 						return;
 					}
 
 					if (res.code === 200) {
 						// 重新读取,刷新表格显示
-						this.getHostelListByCode(i)
+						that.getHostelListByCode(i)
 
 						if (i === 1) {
-							this.dialogModifyDictionaryFormVisible = false
+							that.dialogModifyDictionaryFormVisible = false
 						} else if (i === 2) {
-							this.dialogModifyDictionaryServiceFormVisible = false
+							that.dialogModifyDictionaryServiceFormVisible = false
 						} else if (i === 3) {
-							this.dialogModifyDictionaryNameFormVisible = false
+							that.dialogModifyDictionaryNameFormVisible = false
 						} else if (i === 4) {
-							this.dialogModifyDictionaryHouseServiceFormVisible = false
+							that.dialogModifyDictionaryHouseServiceFormVisible = false
 						}
-						this.$message.success(res.message);
+						that.$message.success(res.message);
 					} else {
-						this.$message.error(res.message);
+						that.$message.error(res.message);
 					}
 				}).catch((err) => {
 					// console.log(err);
-					this.$message.error(err.message);
+					that.$message.error(err.message);
 				})
 			},
 			/**
@@ -1153,7 +1309,7 @@
 			 * 修改民宿
 			 */
 			modify_house_dialog(index, row) {
-				// console.log(index, row);
+				console.log(index, row);
 				this.formModifyHostel.id = row.id;
 				this.formModifyHostel.hotelTownship = row.hotelTownshipName;
 				this.formModifyHostel.hotelName = row.hotelName;
@@ -1163,9 +1319,11 @@
 				this.formModifyHostel.bankCard = row.bankCard;
 				this.formModifyHostel.cardName = row.cardName;
 				this.formModifyHostel.bankName = row.bankName;
-				this.formModifyHostel.fileUrl = row.bankName;
+				// this.formModifyHostel.fileUrl = row.bankName;
 
 				this.dialogModifyHostelFormVisible = true;
+				console.log(this.formModifyHostel.fileUrl);
+				console.log(this.formModifyHostel.url);
 			},
 			/**
 			 * 关闭添加对话框
@@ -1184,6 +1342,50 @@
 			 * 添加民宿类型
 			 */
 			add_house_class_dialog_handler(i) {
+				var that = this;
+				if (i === 1) {
+					that.$refs["addHostelClassForm"].validate(validate => {
+						if (validate) {
+							that.addHostel_shared(i)
+						} else {
+							that.$message.error('请按规范填写');
+							return false;
+						}
+					})
+				} else if (i === 2) {
+					that.$refs["addHostelServiceForm"].validate(validate => {
+						if (validate) {
+							that.addHostel_shared(i)
+						} else {
+							that.$message.error('请按规范填写');
+							return false;
+						}
+					})
+				} else if (i === 3) {
+					that.$refs["addHostelNameForm"].validate(validate => {
+						if (validate) {
+							that.addHostel_shared(i)
+						} else {
+							that.$message.error('请按规范填写');
+							return false;
+						}
+					})
+				} else if (i === 4) {
+					that.$refs["addHouseTypeServiceForm"].validate(validate => {
+						if (validate) {
+							that.addHostel_shared(i)
+						} else {
+							that.$message.error('请按规范填写');
+							return false;
+						}
+					})
+				}
+			},
+			/**
+			 * 
+			 * @param {Object} i
+			 */
+			addHostel_shared(i) {
 				addHomestayDictionary(this.add_dictionary_data).then((res) => {
 					// console.log(res);
 					if (typeof res.code == 'undefined' || res.code == '') {
@@ -1258,21 +1460,18 @@
 				})
 			},
 			clear_data() {
-				this.formAddHostel = {
-					// options: [],  // 无需清空,否则下次添加没有选项
-					id: '',
-					hotelTownship: '',
-					hotelName: '',
-					corpnName: '',
-					corpnPhone: '',
-					adminName: '',
-					bankCard: '',
-					cardName: '',
-					bankName: '',
-					fileUrl: '', // 图片上传列表
-					url: '', // 上传的图片列表
-					level: this.currentUserLevel
-				}
+				this.formAddHostel.id = ''
+				this.formAddHostel.hotelTownship = ''
+				this.formAddHostel.hotelName = ''
+				this.formAddHostel.corpnName = ''
+				this.formAddHostel.corpnPhone = ''
+				this.formAddHostel.adminName = ''
+				this.formAddHostel.bankCard = ''
+				this.formAddHostel.cardName = ''
+				this.formAddHostel.bankName = ''
+				this.formAddHostel.fileUrl = '' // 图片上传列表
+				this.formAddHostel.url = '' // 上传的图片列表
+				this.formAddHostel.level = this.currentUserLevel
 			},
 			/**
 			 * 修改民宿
@@ -1310,22 +1509,18 @@
 				})
 			},
 			clear_modify_data() {
-				this.formModifyHostel = {
-					// options: [],
-					id: '',
-					hotelTownship: '',
-					hotelTownshipName: '',
-					hotelName: '',
-					corpnName: '',
-					corpnPhone: '',
-					adminName: '',
-					bankCard: '',
-					cardName: '',
-					bankName: '',
-					fileUrl: '', // 图片上传列表
-					url: '', // 上传的图片列表
-					// level: this.$store.state.user.level
-				}
+				this.formAddHostel.id = ''
+				this.formAddHostel.hotelTownship = ''
+				this.formAddHostel.hotelName = ''
+				this.formAddHostel.hotelTownshipName = ''
+				this.formAddHostel.corpnName = ''
+				this.formAddHostel.corpnPhone = ''
+				this.formAddHostel.adminName = ''
+				this.formAddHostel.bankCard = ''
+				this.formAddHostel.cardName = ''
+				this.formAddHostel.bankName = ''
+				this.formAddHostel.fileUrl = '' // 图片上传列表
+				this.formAddHostel.url = '' // 上传的图片列表
 			},
 			/**
 			 * 重置密码

+ 1 - 0
src/views/stdbookMgr/index.vue

@@ -136,6 +136,7 @@
 	export default {
 		data() {
 			return {
+				currentUserLevel: this.$store.state.user.level, // 当前用户的权限
 				dialogImageUrl: '',
 				formLabelWidth: '120px',
 				sumAccount: '', // 总金额