lilei 7 tháng trước cách đây
mục cha
commit
3e31669998
2 tập tin đã thay đổi với 12 bổ sung4 xóa
  1. 1 1
      App.vue
  2. 11 3
      pages/storeManage/addPerson.vue

+ 1 - 1
App.vue

@@ -1,7 +1,7 @@
 <script>
 	export default {
 		globalData: {
-			baseUrl: 'http://192.168.2.100:9110/saas/clz/', // 本地
+			baseUrl: 'http://192.168.2.10:9110/saas/clz/', // 本地
 			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},

+ 11 - 3
pages/storeManage/addPerson.vue

@@ -27,8 +27,8 @@
 				</evanForm>
 			</view>
 			<view class="form-footer-btn flex align_center justify_center">
-				<u-button shape="circle" v-if="isEdit&&formData.isManager==0" @click="delPerson()" :custom-style="{width:'300rpx',marginRight:'20rpx' }">删除</u-button>
-				<u-button shape="circle" type="info" :custom-style="{ background: '#066cff', color: '#fff',width:'300rpx' }" @click="save('formData')">保存</u-button>
+				<u-button shape="circle" :disabled="loading" v-if="isEdit&&formData.isManager==0" @click="delPerson()" :custom-style="{width:'300rpx',marginRight:'20rpx' }">删除</u-button>
+				<u-button shape="circle" :disabled="loading" type="info" :custom-style="{ background: '#066cff', color: '#fff',width:'300rpx' }" @click="save('formData')">保存</u-button>
 			</view>
 			<u-popup v-model="showRoles" mode="bottom">
 				<view style="width: 100%;">
@@ -69,6 +69,7 @@
 		},
 		data(){
 			return{
+				loading: false,
 				showRoles: false,
 				roleList: [],  //  角色  数据列表
 				roleArr: [],  //  当前所选角色
@@ -161,14 +162,17 @@
 					if(!this.formData.roleNames && this.formData.isManager==0){
 						uni.showToast({icon: 'none', title: '请选择岗位'})
 					}else{
+						this.loading = true
+						uni.showLoading({title:'正在保存...'})
 						saveEmployee(data).then(res=>{
-							console.log(res)
+							uni.hideLoading()
 							if(res.status == 200){
 								uni.showToast({icon: 'none', title:'保存成功'})
 								this.cancel()
 							}else{
 								uni.showToast({icon: 'none', title: res.message})
 							}
+							this.loading = false
 						})
 					}
 				}
@@ -183,11 +187,15 @@
 					content: '数据删除后无法恢复, 确认删除吗?',
 					success: (ret) => {
 					  if(ret.confirm||ret.index==0){
+						  _this.loading = true
+						  uni.showLoading({title:'正在删除...'})
 						  // 删除数据
 						  delEmployee({id: item.id}).then(res=>{
+							uni.hideLoading()
 						  	if(res.status == 200){
 						  		this.cancel()
 						  	}
+							_this.loading = false
 						  	uni.showToast({icon: 'none', title: res.message})
 						  })
 					  }