Explorar el Código

2022-09-06 修改租户配额输入框

zhuliu hace 3 años
padre
commit
2975add3ef
Se han modificado 2 ficheros con 21 adiciones y 5 borrados
  1. 13 4
      src/views/client/index.vue
  2. 8 1
      src/views/user/index.vue

+ 13 - 4
src/views/client/index.vue

@@ -103,8 +103,8 @@
         </el-row>
         <el-row :gutter="24">
           <el-col :span="24">
-            <el-form-item label="用户账号配额" prop="number">
-              <el-input v-model="ruleForm.number" placeholder="请输入用户账号配额"></el-input>
+            <el-form-item label="用户账号配额" prop="number" >
+              <el-input-number style="width:100%" controls-position="right" :max="99" :min="0" v-model="ruleForm.number" :step="10" placeholder="请输入用户账号配额"></el-input-number>
             </el-form-item>
           </el-col>
         
@@ -329,10 +329,13 @@ export default {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
            this.ruleForm.functions=[]
-        for(var i =0;i<this.ruleForm.function.length;i++){
+           if(this.ruleForm.hasOwnProperty('function')){
+             for(var i =0;i<this.ruleForm.function.length;i++){
           var a =this.ruleForm.function[i].join(',')
           this.ruleForm.functions.push(a)
         }
+           }
+       
           this.btnLoading = true
           if (this.ruleForm.id) {
             this.$api.editTenant(this.ruleForm).then(response => {
@@ -397,8 +400,14 @@ export default {
   }
 }
 </script>
-
+<style lang="scss">
+  .el-input-number .el-input__inner{
+    text-align: left;
+    padding-left: 0;
+  }
+</style>
 <style lang="scss" scoped>
+
 .admin-client {
 
 }

+ 8 - 1
src/views/user/index.vue

@@ -647,6 +647,7 @@
 				}
 			},
 			"ruleForm.email"(val) {
+				console.log(val)
 				if (val.indexOf("@qq.com") != -1) {
 					var index = val.indexOf("@qq.com");
 					var str = val.substring(0, index);
@@ -724,6 +725,7 @@
 					gender: 0,
 					state: 1,
 					positions: [],
+					email:''
 				};
 			},
 			handleEdit(row) {
@@ -827,7 +829,12 @@
 							this.$api
 								.addPersonnel(this.ruleForm)
 								.then((response) => {
-									this.$message.success("新增成功");
+									if(response.code == 200){
+										this.$message.success("新增成功");
+									}else if(response.code == 0){
+										this.$message.error("新增失败")
+									}
+									console.log(1212)
 									this.btnLoading = false;
 									this.getList();
 									this.close();