wangguoyu 2 tháng trước cách đây
mục cha
commit
d21c14ab57

+ 12 - 0
api/jiazheng.js

@@ -167,3 +167,15 @@ export function getJiazhengJiguan(data = {}) {
     timeout: 20000
   })
 }
+
+export function getJiazhengBanzhengCheckKc(data = {}) {
+  return request({
+    url: '/app/user/jiazheng/kaozheng/check/kecheng',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 107 - 48
pages/admin/Jiazheng/banzhengXinxi.vue

@@ -5,7 +5,8 @@
 			<view class="phone-form-label"><text class="form-label-require">*</text>报证机构</view>
 			<picker mode="selector" :range="jigouNames" @change="jigouChange">
 				<view class="form-radio-select">
-					<view>{{ formData.baozhengJigouName || '请选择报证机构' }}</view><icon></icon>
+					<view>{{ formData.baozhengJigouName || '请选择报证机构' }}</view>
+					<icon></icon>
 				</view>
 			</picker>
 		</view>
@@ -14,7 +15,8 @@
 			<view class="phone-form-label"><text class="form-label-require">*</text>职业名称</view>
 			<picker mode="selector" :range="zhiyeNames" range-key="name" @change="zhiyeChange">
 				<view class="form-radio-select">
-					<view>{{ formData.zhiyeName || '请选择职业名称' }}</view><icon></icon>
+					<view>{{ formData.zhiyeName || '请选择职业名称' }}</view>
+					<icon></icon>
 				</view>
 			</picker>
 		</view>
@@ -23,62 +25,69 @@
 			<view class="phone-form-label"><text class="form-label-require">*</text>职业等级</view>
 			<picker mode="selector" :range="zhiyeLevels" @change="levelChange">
 				<view class="form-radio-select">
-					<view>{{ formData.zhiyeLevelName || '请选择等级' }}</view><icon></icon>
+					<view>{{ formData.zhiyeLevelName || '请选择等级' }}</view>
+					<icon></icon>
 				</view>
 			</picker>
 		</view>
 
-		<view  v-if="formData.banzhengInfoFlag" class="form-label-select">
+		<view v-if="formData.banzhengInfoFlag" class="form-label-select">
 			<view class="phone-form-label"><text class="form-label-require"></text>参训时间</view>
-			<uni-datetime-picker class="form-radio-picker" v-model="formData.canxunShijian" type="date" @change="canxunShijianChange">
+			<uni-datetime-picker class="form-radio-picker" v-model="formData.canxunShijian" type="date"
+				@change="canxunShijianChange">
 				<view class="form-radio-select">
-					<view>{{formData.canxunShijian}}</view><icon></icon>
+					<view>{{formData.canxunShijian}}</view>
+					<icon></icon>
 				</view>
 			</uni-datetime-picker>
 		</view>
 
-		<view  v-if="formData.banzhengInfoFlag" class="form-label-input">
+		<view v-if="formData.banzhengInfoFlag" class="form-label-input">
 			<view class="phone-form-label"><text class="form-label-require">*</text>实操成绩</view>
 			<input v-model="formData.shicaochengji" placeholder="请填写实操成绩" />
 		</view>
-		<view  v-if="formData.banzhengInfoFlag" class="form-label-input">
+		<view v-if="formData.banzhengInfoFlag" class="form-label-input">
 			<view class="phone-form-label"><text class="form-label-require">*</text>总课时</view>
 			<input v-model="formData.zongkeshi" placeholder="请填写总课时" />
 		</view>
 
 
-		<view  v-if="!formData.banzhengInfoFlag" class="form-label-select">
+		<view v-if="formData.needFlag" class="form-label-select">
 			<view class="phone-form-label"><text class="form-label-require"></text>需要课程</view>
 			<radio-group @change="kechengChange">
 				<label class="radio-label">
-					<radio :value="'true'" :checked="formData.needKecheng == 'true'" color="#3fd2a1" style="transform:scale(0.65)"/>
+					<radio :value="'true'" :disabled=" formData.kcDisabled" :checked="formData.needKecheng == 'true'"
+						color="#3fd2a1" style="transform:scale(0.65)" />
 					<text>是</text>
 				</label>
 				<label class="radio-label">
-					<radio :value="'false'" :checked="formData.needKecheng == 'false'" color="#3fd2a1" style="transform:scale(0.65)"/>
+					<radio :value="'false'" :checked="formData.needKecheng == 'false'" color="#3fd2a1"
+						style="transform:scale(0.65)" />
 					<text>否</text>
 				</label>
 			</radio-group>
 		</view>
-		<view v-if="!formData.banzhengInfoFlag" class="form-label-select">
+		<view v-if="formData.needFlag" class="form-label-select">
 			<view class="phone-form-label"><text class="form-label-require"></text>需要考试</view>
 			<radio-group @change="kaoshiChange">
 				<label class="radio-label">
-					<radio :value="'true'" :checked="formData.needKaoshi == 'true'" color="#3fd2a1" style="transform:scale(0.65)"/>
+					<radio :value="'true'" :checked="formData.needKaoshi == 'true'" color="#3fd2a1"
+						style="transform:scale(0.65)" />
 					<text>是</text>
 				</label>
 				<label class="radio-label">
-					<radio :value="'false'" :checked="formData.needKaoshi == 'false'" color="#3fd2a1" style="transform:scale(0.65)"/>
+					<radio :value="'false'" :checked="formData.needKaoshi == 'false'" color="#3fd2a1"
+						style="transform:scale(0.65)" />
 					<text>否</text>
 				</label>
 			</radio-group>
 		</view>
 		<view class="page-btn-box">
-			<button type="default" class="phone-white-btn">上一步</button>
-			<button type="default" class="phone-green-btn">完成</button>
+			<button type="default" @click="goUp" class="phone-white-btn">上一步</button>
+			<button type="default" @click="submitForm" class="phone-green-btn">完成</button>
 		</view>
 		<!-- 提交按钮 -->
-<!-- 		<button class="submit-btn" @click="submitForm">提交</button> -->
+		<!-- 		<button class="submit-btn" @click="submitForm">提交</button> -->
 	</view>
 </template>
 
@@ -86,7 +95,8 @@
 	import {
 		getBaozhengJigou,
 		getJiazhengLevel,
-		getJiazhengZhiye
+		getJiazhengZhiye,
+		getJiazhengBanzhengCheckKc
 	} from "@/api/jiazheng.js"
 	export default {
 		data() {
@@ -104,7 +114,9 @@
 					shicaochengji: '',
 					zongkeshi: '',
 					needKecheng: 'false', // 默认选中"是"
-					needKaoshi: 'false' // 默认选中"是"
+					needKaoshi: 'false', // 默认选中"是"
+					kcDisabled: false,
+					needFlag: false
 				},
 				baozhengJigouOpt: [
 
@@ -167,10 +179,14 @@
 				this.formData.baozhengJigouId = this.baozhengJigouOpt[e.detail.value].jgId;
 				this.formData.baozhengJigouType = this.baozhengJigouOpt[e.detail.value].jgType;
 				this.formData.banzhengInfoFlag = this.baozhengJigouOpt[e.detail.value].jgType == 1;
+
+				console.log('this.formData.banzhengInfoFlag', this.formData.banzhengInfoFlag);
 				if (this.formData.banzhengInfoFlag) {
+					this.formData.needFlag = false
 					this.formData.needKaoshi = 'false'
 					this.formData.needKecheng = 'false'
 				} else {
+					this.formData.needFlag = true
 					this.formData.needKaoshi = 'true'
 					this.formData.needKecheng = 'false'
 				}
@@ -182,7 +198,27 @@
 				this.formData.zhiyeLevelId = this.zhiyelevelsOpt[e.detail.value].id;
 				this.formData.zhiyeLevelName = this.zhiyelevelsOpt[e.detail.value].name;
 			},
-
+			checkKc() {
+				let req = {
+					zyId: this.formData.zhiyeId,
+					zyLevel: this.formData.zhiyeLevelId
+				}
+				getJiazhengBanzhengCheckKc(req).then(res => {
+					console.log('res', res);
+					if (res.data.pass.toString() == 'true') {
+						this.formData.kcDisabled = false
+						this.formData.needKecheng = 'true'
+					} else {
+						uni.showToast({
+							title: res.data.msg,
+							icon: 'none'
+						});
+						this.formData.needKecheng = 'false'
+						this.formData.kcDisabled = true
+					}
+					//	this.zhiyelevelsOpt = res.data
+				})
+			},
 			// 职业名称选择
 			zhiyeChange(e) {
 				this.formData.zhiyeName = this.zhiyeNameOpt[e.detail.value].name;
@@ -196,8 +232,22 @@
 
 			// 需要课程选择
 			kechengChange(e) {
-				console.log('e', e);
 				this.formData.needKecheng = e.detail.value.toString();
+				if (this.formData.needKecheng = 'true') {
+					if (this.formData.zhiyeId && this.formData.zhiyeLevelId) {
+						this.checkKc()
+					} else {
+						uni.showToast({
+							title: '请选择职业以及职业等级',
+							icon: 'none'
+						});
+						setTimeout(() => {
+							this.formData.needKecheng = 'false'
+						}, 1000)
+
+						return false
+					}
+				}
 			},
 
 			// 需要考试选择
@@ -205,37 +255,46 @@
 				this.formData.needKaoshi = e.detail.value.toString();
 			},
 
+			goUp(){
+				this.$emit('goUp',{},3);
+			},
 			// 提交表单
 			submitForm() {
-				// 表单验证
-				if (!this.formData.institution) {
-					uni.showToast({
-						title: '请选择报证机构',
-						icon: 'none'
-					});
-					return;
-				}
-				if (!this.formData.selectedLevel) {
-					uni.showToast({
-						title: '请选择职业等级',
-						icon: 'none'
-					});
-					return;
-				}
-				if (!this.formData.selectedOccupation) {
-					uni.showToast({
-						title: '请选择职业名称',
-						icon: 'none'
-					});
-					return;
+				let req =  {
+					
 				}
+				console.log('req',req);
+				
+				
+				// // 表单验证
+				// if (!this.formData.institution) {
+				// 	uni.showToast({
+				// 		title: '请选择报证机构',
+				// 		icon: 'none'
+				// 	});
+				// 	return;
+				// }
+				// if (!this.formData.selectedLevel) {
+				// 	uni.showToast({
+				// 		title: '请选择职业等级',
+				// 		icon: 'none'
+				// 	});
+				// 	return;
+				// }
+				// if (!this.formData.selectedOccupation) {
+				// 	uni.showToast({
+				// 		title: '请选择职业名称',
+				// 		icon: 'none'
+				// 	});
+				// 	return;
+				// }
 
-				// 提交数据(示例)
-				console.log('提交数据:', this.formData);
-				uni.showToast({
-					title: '提交成功'
-				});
+				// // 提交数据(示例)
+				// console.log('提交数据:', this.formData);
+				// uni.showToast({
+				// 	title: '提交成功'
+				// });
 			}
 		}
 	};
-</script>
+</script>

+ 5 - 1
pages/admin/Jiazheng/jiazhengUserManager.vue

@@ -8,7 +8,7 @@
 		<gerenZiliao ref="gerenZiliao" @goNext="gerenziliaoNext" v-show="current ==0"></gerenZiliao>
 		<qiuzhiXinxi ref="qiuzhiXinxi" @goUp="goUpQiuzhixinxi" @goNext="goNextQiuzhixinxi" v-show="current ==1"></qiuzhiXinxi>
 		<zhaopianZiliao ref="zhaopianZiliao" @goUp="goUpZhaopianZiliao" @goNext="goNextZhaopianZiliao" v-show="current ==2"></zhaopianZiliao>
-		<banzhengXinxi ref="banzhengXinxi" v-show="current ==3"></banzhengXinxi>
+		<banzhengXinxi ref="banzhengXinxi" @goUp="goUpBanzhengXinxi" v-show="current ==3"></banzhengXinxi>
 	</view>
 </template>
 
@@ -55,6 +55,7 @@
 				console.log('num',num);
 				this.current = num + 1
 				this.tabs[this.current].disabled = false
+				console.log('this.tabs',this.tabs);
 			},
 			goUpQiuzhixinxi(data,num){
 				this.current = num - 1
@@ -70,6 +71,9 @@
 				this.current = num + 1
 				this.tabs[this.current].disabled = false
 			},
+			goUpBanzhengXinxi(data,num){
+				this.current = num - 1
+			}
 		}
 	}
 </script>