Kaynağa Gözat

Merge branch '2025北京诚祥' of https://gogs.mtavip.com/wangguoyu/uniProject into 2025北京诚祥

tanxue 2 ay önce
ebeveyn
işleme
26f6d21f8d

+ 6 - 3
pages/admin/Jiazheng/banzhengXinxi.vue

@@ -359,7 +359,7 @@
 				this.formData.needKaoshi = e.detail.value.toString();
 			},
 			currentMove(data) {
-				console.log('');
+				console.log('data',data);
 				// currentMove 编辑状态下的新增
 				this.localStatus = data
 				console.log('localStatus', this.localStatus);
@@ -387,7 +387,7 @@
 					createTime:dayjs().format("YYYY-MM-DD HH:mm:ss")
 				}
 				console.log('req', req);
-				if(this.status =='add'||this.localStatus =='editadd'){
+				if(this.status =='add'||this.localStatus =='editadd'||this.localStatus =='addEdit'){
 					req.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss")
 				}
 				if (this.formData.baozhengJigouType == 1 && (this.formData.shicaochengji == '' || this.formData
@@ -400,7 +400,10 @@
 					return false
 				}
 				if (req.jgId && req.zyId && req.zyLevel) {
-					if (this.status == 'add') {
+					if(this.localStatus == 'addEdit'){
+						this.$emit('addEdit', req,'addEdit',this.currentIndex);
+					}
+					else if (this.status == 'add') {
 						this.$emit('addSave', req);
 					} else if (this.localStatus == 'editAdd') {
 						this.$emit('editSave', req, 'editAdd');

+ 7 - 0
pages/admin/Jiazheng/banzhengXinxiList.vue

@@ -14,6 +14,7 @@
 		</view>
 		<view v-if="list.length>0" class="bzxx-btn-box">
 			<button type="default" @click="addBanzheng" class="phone-white-btn">添加</button>
+			<button type="default" v-if="status!='edit'"  @click="saveBanzheng" class="phone-white-btn">保存</button>
 		</view>
 		<view v-else class="bzxx-add-btn-box">
 			<view  @click="addBanzheng" class="bzxx-add-btn"><text>+</text>添加办证信息</view>
@@ -39,6 +40,9 @@
 				type: Array,
 				default: () => []
 			},
+			status: {
+				type: String,
+			}
 		},
 		computed: {
 
@@ -50,6 +54,9 @@
 			addBanzheng() {
 				this.$emit('addBanzheng');
 			},
+			saveBanzheng() {
+				this.$emit('saveBanzheng');
+			},
 			goEdit(item, index) {
 				this.$emit('editBanzheng', item, index);
 			},

+ 31 - 22
pages/admin/Jiazheng/index.vue

@@ -35,9 +35,8 @@
 		</view>
 		<view>
 			<scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
-				:refresher-threshold="50" @scrolltolower="onScrolltolower" refresher-background="transparent" @refresherrefresh="onRefresh"
-		
-				class="jz-scroll-view">
+				:refresher-threshold="50" @scrolltolower="onScrolltolower" refresher-background="transparent"
+				@refresherrefresh="onRefresh" class="jz-scroll-view">
 				<uni-list class="admin-list-box">
 					<view class="jz-new-btn-box">
 						<button type="default" class="phone-green-btn" @click="addJiazhengRenyuan">新增人员</button>
@@ -49,8 +48,8 @@
 								<view class="head-name">{{item.realName}}</view>
 								<button type="default" class="phone-green-btn bz-bind-btn"
 									@click.stop="kechengBind(item)">课程绑定</button>
-									<button type="default" class="phone-green-btn bz-tel-btn"
-										@click.stop="telephone(item)">打电话</button>
+								<button type="default" class="phone-green-btn bz-tel-btn"
+									@click.stop="telephone(item)">打电话</button>
 								<share :id="item.id" ref="shareRef">分享</share>
 
 							</view>
@@ -68,8 +67,8 @@
 									<view class="content-text-row">
 										{{item.jiguanShengName === item.jiguanShiName ? item.jiguanShengName  : `${item.jiguanShengName} ${item.jiguanShiName}`}}人
 									</view>
-						
-									<view v-if="item.zyNames.length>0"  class="content-lx-box">
+
+									<view v-if="item.zyNames.length>0" class="content-lx-box">
 										<view class="content-lx-item" v-for="item2 in item.zyNames" :key="item2">
 											{{item2}}
 										</view>
@@ -174,11 +173,11 @@
 		refreshData()
 	}
 
-	function onScrolltolower(){
+	function onScrolltolower() {
 		getMore()
 	}
-	
-	
+
+
 	function luruTimeClick() {
 		data.sortType = 2
 		const isFirst = isFirstClickluru.value == 'true';
@@ -309,9 +308,10 @@
 		}
 
 	}
-	function kechengBind(data){
+
+	function kechengBind(data) {
 		uni.redirectTo({
-			url: `/pages/admin/Jiazheng/kechengBind?id=`+ data.id
+			url: `/pages/admin/Jiazheng/kechengBind?id=` + data.id
 		})
 	}
 
@@ -349,10 +349,10 @@
 				const newItem = {
 					...item
 				};
-				if(item.zyNames ==''){
+				if (item.zyNames == '') {
 					newItem.zyNames = []
-				}else{
-				newItem.zyNames = item.zyNames.split(',');
+				} else {
+					newItem.zyNames = item.zyNames.split(',');
 				}
 				return newItem;
 			})
@@ -388,21 +388,27 @@
 		data.page++;
 		opt.page = data.page;
 		getJiazhengList(opt).then(res => {
+
 			data.list = data.list.concat(res.data.data);
 			data.list = data.list.map(item => {
 				const newItem = {
 					...item
 				};
-				if(item.zyNames ==''){
-					newItem.zyNames = []
-				}else{
-				newItem.zyNames = item.zyNames.split(',');
+				// if(item.zyNames ==''){
+				// 	newItem.zyNames = []
+				// }else{
+				// newItem.zyNames = item.zyNames.split(',');
+				// }
+				// 处理 zyNames 字段
+				if (typeof newItem.zyNames !== 'string') {
+					newItem.zyNames = []; 
+				} else {
+					newItem.zyNames = newItem.zyNames.trim() == '' ? [] : newItem.zyNames.split(',');
 				}
 				return newItem;
 			})
 			console.log('data.list', data.list);
 			data.loading = false;
-
 			if (res.data.total > data.list.length) {
 				data.state = 'more';
 				data.loading = false;
@@ -419,9 +425,12 @@
 	function getLeixing() {
 		let req = {}
 		getJiazhengZhiyeAll(req).then(res => {
-			res.data.unshift({id:'',name:'全部职业'});
+			res.data.unshift({
+				id: '',
+				name: '全部职业'
+			});
 			allType = res.data
-		//	allType = dataConversionObject(res.data)
+			//	allType = dataConversionObject(res.data)
 			console.log('allType', allType);
 		})
 	}

+ 117 - 68
pages/admin/Jiazheng/jiazhengUserManager.vue

@@ -13,11 +13,12 @@
 		</qiuzhiXinxi>
 		<zhaopianZiliao ref="zhaopianZiliao" :status='status' @editSave="editSaveZhaopianziliao"
 			@goNext="goNextZhaopianZiliao" v-show="current ==2"></zhaopianZiliao>
-		<banzhengXinxi ref="banzhengXinxi" :status='status' @goBack="goBack" @addSave="addSave" @editSave="editSave"
-			v-show="current ==3">
+		<banzhengXinxi ref="banzhengXinxi" :status='status' @goBack="goBack" @addEdit='addEdit' @addSave="addSave"
+			@editSave="editSave" v-show="banzhengXinxiFlag">
 		</banzhengXinxi>
-		<banzhengXinxiList :list="editInfo.kaozhengList" v-show="banzhengXinxiFlag" @editBanzheng="editBanzheng"
-			@addBanzheng="addBanzheng" @deleteBanzheng="deleteBanzheng" ref="banzhengXinxiList"></banzhengXinxiList>
+		<banzhengXinxiList :status='status' :list="editInfo.kaozhengList" v-show="current ==3&&!banzhengXinxiFlag"
+			@saveBanzheng="saveBanzheng" @editBanzheng="editBanzheng" @addBanzheng="addBanzheng"
+			@deleteBanzheng="deleteBanzheng" ref="banzhengXinxiList"></banzhengXinxiList>
 		<common-dialog ref="commonDialogRef" :title="deleteTitle" :content="deleteConcent"
 			@confirm-btn="deleteQuerenBtn"></common-dialog>
 	</view>
@@ -127,56 +128,70 @@
 		},
 		methods: {
 			goBack() {
-				this.banzhengXinxiFlag = true
+				this.banzhengXinxiFlag = false
 			},
 			editBanzheng(data, index) {
 				console.log('dataasdf', data);
 				this.current = 3
-				this.banzhengXinxiFlag = false
-				this.$refs.banzhengXinxi.editinfo(data, index)
-				this.$refs.banzhengXinxi.currentMove('edit')
+				this.banzhengXinxiFlag = true
+				if (this.status == 'edit') {
+					this.$refs.banzhengXinxi.editinfo(data, index)
+					this.$refs.banzhengXinxi.currentMove('edit')
+				} else {
+					this.$refs.banzhengXinxi.editinfo(data, index)
+					this.$refs.banzhengXinxi.currentMove('addEdit')
+				}
+
 			},
 			addBanzheng(data, index) {
-				this.banzhengXinxiFlag = false
-				this.current = 3
+				this.banzhengXinxiFlag = true
 				this.$refs.banzhengXinxi.resetFun()
-				this.$refs.banzhengXinxi.currentMove('editAdd')
+				//this.current = 3
+				//	this.$refs.banzhengXinxi.resetFun()
+				if (this.status == 'edit') {
+					this.$refs.banzhengXinxi.currentMove('editAdd')
+				}
+
 			},
 			deleteBanzheng(data, index) {
-				console.log('data', data);
-				console.log('index', index);
-				console.log('data.statusBanzheng', data.statusBanzheng);
 				this.deleteId = data.id
 				this.deleteIndex = index
 				if (data.statusBanzheng == '办证完成') {
 					uni.showToast({
-						title: "办证状态为办证完成禁止删除",
+						title: "办证状态为办证完成禁止删除	",
 						icon: 'none',
 						duration: 2000
 					})
 					return false
 				}
 				this.$refs.commonDialogRef.handleShow()
+
 			},
 			deleteQuerenBtn() {
-				jiazhengKaozhengDelete({
-					ids: [this.deleteId]
-				}).then(res => {
-					if (res.code == 0) {
-						uni.showToast({
-							title: "成功",
-							icon: 'none',
-							duration: 2000
-						})
-						this.editInfo.kaozhengList.splice(this.deleteIndex, 1);
-						if (this.editInfo.kaozhengList.length == 0) {
-							this.banzhengXinxiFlag = true
+				if (this.status == 'add') {
+					this.allData.kaozhengList.splice(this.deleteIndex, 1)
+					this.editInfo.kaozhengList.splice(this.deleteIndex, 1)
+				} else {
+					jiazhengKaozhengDelete({
+						ids: [this.deleteId]
+					}).then(res => {
+						if (res.code == 0) {
+							uni.showToast({
+								title: "成功",
+								icon: 'none',
+								duration: 2000
+							})
+							this.editInfo.kaozhengList.splice(this.deleteIndex, 1);
+							if (this.editInfo.kaozhengList.length == 0) {
+								this.banzhengXinxiFlag = true
+							}
 						}
-					}
-				})
+					})
+				}
+
 			},
 			idCardBlur(data) {
-				if(this.status == 'edit'){
+				if (this.status == 'edit') {
 					this.$refs.qiuzhiXinxi.editinfo(data)
 					this.$refs.zhaopianZiliao.editinfo(data)
 				}
@@ -253,13 +268,6 @@
 				})
 			},
 			changeTab(data) {
-				console.log('data', data);
-				if (this.status == 'edit' && data == 3) {
-					this.banzhengXinxiFlag = true
-					return false
-				} else {
-					this.banzhengXinxiFlag = false
-				}
 				if (this.status == 'add') {
 					if (this.current >= 0) {
 						this.current--;
@@ -281,6 +289,11 @@
 						this.$refs.zhaopianZiliao.editinfo(this.editInfo)
 						break;
 					case 3:
+						if (this.editInfo.kaozhengList.length > 0) {
+							this.banzhengXinxiFlag = false
+						} else {
+							this.banzhengXinxiFlag = true
+						}
 						this.$refs.banzhengXinxi.editinfo()
 						break;
 					default:
@@ -337,7 +350,7 @@
 				this.gerenZiliaoDataHandle(data, 'edit')
 			},
 			qiuzhiXinxiDataHandle(data, flag) {
-			//	this.allData.leixing = data.leixing
+				//	this.allData.leixing = data.leixing
 				this.allData.jingyan = data.jingyan
 				this.allData.jineng = data.jineng
 				this.allData.zhuangtai = data.zhuangtai
@@ -420,18 +433,20 @@
 				this.zhaopianziliaoDataHandle(data, 'edit')
 			},
 			addSave(data) {
-				if (this.status == 'add') {
-					this.submitJiazheng(data)
-				} else {}
+				// if (this.status == 'add') {
+				// 	this.submitJiazheng(data)
+				// } else {
 
+				// }
+				this.submitJiazheng(data)
 
 			},
 			submitJiazheng(data) {
-			//	debugger
+				//	debugger
 				console.log('this.allData', this.allData);
 
 				if (data != '') {
-				//	debugger
+
 					this.allData.kaozhengList.push(data)
 				}
 				if (this.allData.kaozhengList.length > 0 && this.allData.icon == '') {
@@ -443,30 +458,64 @@
 					this.allData.kaozhengList = []
 					return false
 				}
-				jiazhengAdd(this.allData).then(res => {
-					if (res.code == 0) {
-						uni.showToast({
-							title: "成功",
-							icon: 'none',
-							duration: 2000
-						})
-						uni.navigateTo({
-							url: `/pages/admin/Jiazheng/index`
-						})
-					} else {
-						uni.showToast({
-							title: "失败",
-							icon: 'none',
-							duration: 2000
-						})
-						return false
-					}
+				this.editInfo.kaozhengList = this.allData.kaozhengList
+				this.banzhengXinxiFlag = false
 
-				})
 
 			},
+			saveBanzheng() {
+				if (this.status == 'add') {
+					jiazhengAdd(this.allData).then(res => {
+						if (res.code == 0) {
+							uni.showToast({
+								title: "成功",
+								icon: 'none',
+								duration: 2000
+							})
+							uni.navigateTo({
+								url: `/pages/admin/Jiazheng/index`
+							})
+						} else {
+							uni.showToast({
+								title: "失败",
+								icon: 'none',
+								duration: 2000
+							})
+							return false
+						}
+
+					})
+				} else {
+
+				}
+			},
+			addEdit(data, flag, index) {
+				uni.showToast({
+					title: "修改成功!",
+					icon: 'none',
+					duration: 2000
+				})
+				this.editInfo.kaozhengList[index].canxunshijian = data.canxunshijian
+				this.editInfo.kaozhengList[index].jgId = data.jgId
+				this.editInfo.kaozhengList[index].jgName = data.jgName
+				this.editInfo.kaozhengList[index].jzId = data.jzId
+				this.editInfo.kaozhengList[index].needKaoshi = data.needKaoshi
+				this.editInfo.kaozhengList[index].needKecheng = data.needKecheng
+				this.editInfo.kaozhengList[index].shicaochengji = data.shicaochengji
+				this.editInfo.kaozhengList[index].statusBanzheng = data.statusBanzheng
+				this.editInfo.kaozhengList[index].statusKaoshi = data.statusKaoshi
+				this.editInfo.kaozhengList[index].zongkeshi = data.zongkeshi
+				this.editInfo.kaozhengList[index].id = data.id
+				this.editInfo.kaozhengList[index].zyId = data.zyId
+				this.editInfo.kaozhengList[index].zyLevel = data.zyLevel
+				this.editInfo.kaozhengList[index].zyLevelName = data.zyLevelName
+				this.editInfo.kaozhengList[index].zyName = data.zyName
+				this.allData.kaozhengList = JSON.parse(JSON.stringify(this.editInfo.kaozhengList));
+				this.banzhengXinxiFlag = false
+			},
+
 			editSave(data, flag, index) {
-			//	debugger
+				//	debugger
 				console.log('this.allData', this.allData);
 				console.log('this.editInfo', this.editInfo);
 				if (flag == 'edit') {
@@ -477,7 +526,6 @@
 								icon: 'none',
 								duration: 2000
 							})
-							this.banzhengXinxiFlag = true
 							this.editInfo.kaozhengList[index].canxunshijian = data.canxunshijian
 							this.editInfo.kaozhengList[index].jgId = data.jgId
 							this.editInfo.kaozhengList[index].jgName = data.jgName
@@ -494,6 +542,7 @@
 							this.editInfo.kaozhengList[index].zyLevel = data.zyLevel
 							this.editInfo.kaozhengList[index].zyLevelName = data.zyLevelName
 							this.editInfo.kaozhengList[index].zyName = data.zyName
+							this.banzhengXinxiFlag = false
 						}
 
 					})
@@ -513,7 +562,7 @@
 							this.allData.kaozhengList.push(data)
 							this.editInfo.kaozhengList.push(data)
 							console.log('this.editInfo.kaozhengList', this.editInfo.kaozhengList);
-							this.banzhengXinxiFlag = true
+							this.banzhengXinxiFlag = false
 						}
 					})
 
@@ -528,16 +577,16 @@
 				// }
 			},
 			goUpPage() {
-				if(this.from =='banzheng'){
+				if (this.from == 'banzheng') {
 					uni.redirectTo({
 						url: "/pages/admin/banzheng/list"
 					})
-				}else{
+				} else {
 					uni.navigateTo({
 						url: `/pages/admin/Jiazheng/index`
 					})
 				}
-				
+
 			}
 
 		}

+ 5 - 1
pages/admin/tongzhi/list.vue

@@ -6,7 +6,7 @@
 		</view>
 		<!-- 课程列表 -->
 		<scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
-			:refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
+			:refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"  @scrolltolower="onScrolltolower"
 			class="admin-phone-tabbar-view">
 			<uni-list class="admin-list-box">
 				<uni-list-item v-for="item in data.list" class="admin-list-item-box">
@@ -70,6 +70,10 @@
 			url: '/pages/admin/ShouYe/shouye'
 		})	
 	}
+	
+	function onScrolltolower() {
+		getMore()
+	}
 
 	function handleSearch() {
 		data.page = 0;

+ 1 - 1
pages/admin/zizhanghao/components/resetPassword.vue

@@ -33,7 +33,7 @@
 	const props = defineProps({
 		title: {
 			type: String,
-			default: ''
+			default: '重置密码'
 		},
 		dialogContentClass: {
 			type: String,