wangguoyu пре 2 месеци
родитељ
комит
3802594af8
1 измењених фајлова са 31 додато и 11 уклоњено
  1. 31 11
      pages/admin/Jiazheng/jiazhengUserManager.vue

+ 31 - 11
pages/admin/Jiazheng/jiazhengUserManager.vue

@@ -269,8 +269,8 @@
 			},
 			changeTab(data) {
 				this.banzhengXinxiFlag = false
-				
-				if(this.$refs.zhaopianZiliao){
+
+				if (this.$refs.zhaopianZiliao) {
 					this.$refs.zhaopianZiliao.zhankaiFlag = false
 				}
 				if (this.status == 'add') {
@@ -456,14 +456,14 @@
 							item.zyLevelName == data.zyLevelName &&
 							item.zyName == data.zyName;
 					});
-					if(isDuplicate){
-						 uni.showToast({
-						    title: '此用户的职业等级系统已存在,如想继续添加,请联系管理员处理!',
-						    icon: 'none',
-						    duration: 2000
-						  });
-						  
-						  return false
+					if (isDuplicate) {
+						uni.showToast({
+							title: '此用户的职业等级系统已存在,如想继续添加,请联系管理员处理!',
+							icon: 'none',
+							duration: 2000
+						});
+
+						return false
 					}
 				}
 				if (data != '') {
@@ -541,7 +541,8 @@
 				console.log('this.allData', this.allData);
 				console.log('this.editInfo', this.editInfo);
 				data.userId = this.userId
-				if (flag == 'edit') {
+
+				if (flag == 'edit' && this.allData.kaozhengList.length > 0) {
 					jiazhengKaozhengUpdate(data).then(res => {
 						if (res.code == 0) {
 							uni.showToast({
@@ -570,6 +571,25 @@
 						}
 
 					})
+				} else if (flag == 'edit' && this.allData.kaozhengList.length == 0) {
+					data.userId = this.userId
+					if (this.allData.icon == '') {
+						uni.showToast({
+							title: "当录入办证信息时候,头像必填",
+							icon: 'none',
+							duration: 2000
+						})
+						return false
+					}
+					jiazhengKaozhengAdd(data).then(res => {
+						if (res.code == 0) {
+							data.id = res.data
+							this.allData.kaozhengList.push(data)
+							this.editInfo.kaozhengList.push(data)
+							console.log('this.editInfo.kaozhengList', this.editInfo.kaozhengList);
+							this.banzhengXinxiFlag = false
+						}
+					})
 				} else if (flag == 'editAdd') {
 					data.userId = this.userId
 					if (this.allData.icon == '') {