浏览代码

bug 修复

lilei 2 年之前
父节点
当前提交
0d6506887c
共有 2 个文件被更改,包括 19 次插入14 次删除
  1. 17 13
      pages/storeManage/addPerson.vue
  2. 2 1
      pages/vinInput/share.vue

+ 17 - 13
pages/storeManage/addPerson.vue

@@ -21,7 +21,7 @@
 							</u-radio-group>
 						</view>
 					</evanFormItem>
-					<evanFormItem label="岗位" prop="roleNames">
+					<evanFormItem label="岗位" v-if="formData.isManager==0" prop="roleNames">
 						<u-input type="select" style="width:100%" input-align="right" placeholder="请选择岗位" @click="showRoles=true" v-model="formData.roleNames"/>
 						<u-popup v-model="showRoles" mode="bottom">
 							<view style="padding: 1rem;width: 100%;">
@@ -81,7 +81,6 @@
 					name: [{ required: true, message: '请输入员工姓名'}],
 					mobile: [{required: true, min:11, message: '请输入正确手机号码'}],
 					sex: [{ required: true, message: '请选择性别' }],
-					roleNames: [{ required: true, message: '请选择岗位' }]
 				},
 				sexList: [
 					{
@@ -121,6 +120,9 @@
 				if(!!data){
 					this.isEdit = true
 					this.formData = Object.assign({},this.formData,data)
+					if(this.formData.isManager==0){
+						this.ruleValidate.roleNames = [{ required: true, message: '请选择岗位' }]
+					}
 				}else{
 					this.isEdit = false
 					this.formData.workFlag =  '1'
@@ -155,17 +157,19 @@
 				console.log(data)
 				this.$refs[name].validate((valid) => {
 				  if (valid) {
-					saveEmployee(data).then(res=>{
-						console.log(res)
-						if(res.status == 200){
-							uni.showToast({icon: 'none', title:'保存成功'})
-							this.cancel()
-						}else{
-							uni.showToast({icon: 'none', title: res.message})
-						}
-					}).catch(err=>{
-						console.log('保存失败')
-					})
+					if(!this.formData.roleNames && this.formData.isManager==0){
+						uni.showToast({icon: 'none', title: '请选择岗位'})
+					}else{
+						saveEmployee(data).then(res=>{
+							console.log(res)
+							if(res.status == 200){
+								uni.showToast({icon: 'none', title:'保存成功'})
+								this.cancel()
+							}else{
+								uni.showToast({icon: 'none', title: res.message})
+							}
+						})
+					}
 				}
 				})
 			},

+ 2 - 1
pages/vinInput/share.vue

@@ -42,7 +42,7 @@
 		onShareAppMessage(){},
 		onLoad(opts) {
 			this.vinNo = opts.vinNo
-			this.userName = opts.userName || ''
+			this.userName = (opts.userName == 'undefined' || !opts.userName) ? '' : opts.userName
 			this.getInfo()
 		},
 		methods: {
@@ -69,6 +69,7 @@
 				}).then(res => {
 					if (res.status == 200&&res.data) {
 						 this.carInfo = res.data
+						 this.carInfo.icon = this.carInfo.icon ? 'https:'+this.carInfo.icon : ''
 					} else {
 						uni.showModal({
 							title: '匹配错误',